ManageUser: Edit Pkey disabled
[myslice.git] / portal / templates / manageuserview.html
1 {% extends "layout-unfold1.html" %}
2 {% block unfold_main %}
3
4 <h2>User Profile</h2>
5
6 {% if messages %}
7 <ul class="messages">
8     {% for message in messages %}
9     <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
10     {% endfor %}
11 </ul>
12 {% endif %}
13
14
15 <form id="editForm"  method="POST" action="{{user_email}}/user_process" enctype="multipart/form-data">
16 <div id="middle" align="center">
17         <div class="well">
18                 {% csrf_token %}
19                         <table class="profile">          
20                         <tr class="odd">
21                                 <td colspan="2">
22                                                 <div id="info">Platform: Myslice</div>
23                                 </td>
24                         </tr>
25                                 <tr class="even">
26                                 <td class="key">Email</td>
27                                 <td class="value"> <span id="emailval" class="value" >{{ user_email }}</span> </td>
28                                 </tr>
29                         <tr class="odd">
30                                         <td class="key">Full Name</td>
31                                         <td class="value">
32                                                 <span id="nameval" class="value" >{{ fullname }} </span>
33                                                 <span class="hide_this" id="span_name">
34                                                 <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_name_change"> Cancel </button> 
35                                                 <div style='display:none;'><input type='hidden'  name='nameform'  /></div>
36                                                 <input id="fname" type="text" name="fname" class="required"  maxlength="200" value="{{firstname}}" />
37                                                 <input id="lname" type="text" name="lname" class="required"  maxlength="200" value="{{lastname}}" />
38                                                 <input type="submit" class="btn btn-default btn-xs" name="submit_name" value="Save"/>
39                                                 </span>
40                                                 <button class="btn btn-default btn-xs" type="button"title="Full Name" id="edit_name">
41                                                         <span class="glyphicon glyphicon-edit"></span> Edit
42                                                 </button>
43                                         </td>
44                         </tr>
45                                 <tr class="even">
46                                 <td class="key">Authority</td>
47                                 <td class="value">
48                                         <span id="authval" class="value" >{{ authority }} </span>
49                                         <span class="hide_this" id="span_auth">
50                                         <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_auth_change"> Cancel </button>
51                                         <div style='display:none;'><input type='hidden'  name='authform'  /></div>
52                                         <input id="authority" type="text" name="authority" class="required"  maxlength="200" value="{{authority}}" />
53                                         <input type="submit" class="btn btn-default btn-xs" name="submit_auth" value="Save"/>
54                                         </span>
55                                         <button class="btn btn-default btn-xs" type="button"title="auth" id="edit_auth">
56                                         <span class="glyphicon glyphicon-edit"></span> Edit
57                                         </button>
58                                 </td>
59                                 </tr>     
60                                 <tr class="odd">
61                                         <td class="key">Generate Keys</td>
62                                         <td>
63                                                 <input type="submit" name="generate" class="btn btn-danger btn-xs" value="Generate a new Key Pair" id="generate_keypair" 
64                                                            onclick="return confirm('Are you sure? If you do so, your current credentials will be overwritten.');" 
65                                                            title="It will generate a new key Pair and your current credentials will be overwritten."/>
66                                 </td> 
67                         </tr>
68                         <tr class="even">
69                                 <td class="key">Public Key</td>
70                                 <td class="value">
71                                                 <span id="keyval" class="value">******** </span>
72                                                 <span class="hide_this" id="span_upload">
73                                                         <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_upload"> Cancel </button>
74                                                         <div style='display:none;'>
75                                                                 <input type='hidden'  name='upload'  /></div>
76                                                                 <input type="file" name="pubkey" class="required" id="pubkey"/>  
77                                                                 <input class="btn btn-default btn-xs" name="upload_key" id="upload_key"  type="submit" title="Upload your public key" value="Upload"
78                                                                    onclick="return confirm('Are you sure? It will overwrite your current credentials and you have delegate it manually.');"/>
79                                                 </span>
80                                                 <div style='display:none;'> <input type='hidden'  name='dload'  /> </div> 
81                                                 <button type="submit" name="dl_pubkey" class="btn btn-default btn-xs" title="Download your public key" id="dl_file">
82                                                         <span class="glyphicon glyphicon-download"></span> Download
83                                                 </button>
84                                                 <button class="btn btn-default btn-xs" id="upload_file" type="button" title="Upload a public key">
85                                                         <span class="glyphicon glyphicon-upload"></span> Upload
86                                                 </button>       
87                                 </td>
88                         </tr>
89                         </table>
90         </div>
91 </div>
92
93
94 <h2>Account Information</h2>
95 <h3>Principal Account <small>Account used for delegating credentials</small></h3>
96 <div id="middle" align="center">
97         <div class="well">
98                 <table class="table table-bordered table-hover  mytable"> 
99                         <tr class="odd"> 
100                         <th>Platform</th> 
101                         <th>Account Type</th>
102                                 <th>Account Delegation</th>
103                         <th>User hrn</th>
104                                 <th>User Status</th>
105                         <!--<th>Pub Key</th> -->
106                 </tr>   
107                         {% for row in principal_acc %}         
108                         <tr class="border_bottom">
109                         <td class="odd"> {{ row.platform_name }} </td>
110                         <td class="odd"> {{ row.account_type }} </td>
111                                 <td class="odd"> {{ row.delegation_type }} </td>
112                         <td class="odd"> {{ row.usr_hrn }}  </td>
113                                 <td class="odd"> {{ row.user_status }}  </td>
114                 <!--    <td class="even"> {{ row.usr_pubkey }} </td> -->
115                 </tr> 
116                         {%endfor%}               
117                 </table>
118         </div>
119 </div>
120
121
122
123 {%if 'Enabled'  in user_status %}
124 <h3 id="show-pending" class="plugin-show" style="display: block;">
125 <span class="glyphicon glyphicon-chevron-right"></span>
126 <a href="#" class="plugin-tooltip" data-toggle="tooltip" data-original-title="Show plugin &quot;Pending operations&quot; (QueryUpdater)"></a>Credentials</h3>
127
128 <div id="hide-pending" class="plugin-hide" style="display: none;">
129 <span class="glyphicon glyphicon-chevron-down"></span>
130 <a href="#" class="plugin-tooltip" data-toggle="tooltip" data-original-title="Hide plugin &quot;Pending operations&quot; (QueryUpdater)">Credentials</a>
131
132 <h5>Delegated Credentials to Principal Account</h5>
133 <div id="middle" align="center">
134     <div class="well">
135         <table class="mytable table table-bordered table-hover">
136                         <caption><b>Delegated User Credential</b></caption> 
137             <tr class="odd"> 
138                 <th>Expiration Date</th>
139                                 <th>Download</th>
140             </tr>
141                         {% for row in my_users %}         
142                         <tr class="border_bottom">
143                         <td class="odd"> {{ row.cred_exp }} </td>
144                                 <td class="odd">
145                                         <button class="btn btn-default btn-xs" name= "dl_user_cred" type="submit" title="Download User Credential">
146                                                 <span class="glyphicon glyphicon-download"></span> Download
147                                         </button>
148                                 </td>
149                         </tr>
150                         {%endfor%}
151                  </table>
152                 <p></p>
153                 <table class="mytable table table-bordered table-hover">
154                         <caption><b>Delegated Slice Credentials</b></caption>  
155                 <tr class="odd"> 
156                                 <th>Slice Name</th> 
157                         <th>Expiration Date</th>
158                                 <th>Download</th>
159                 </tr>
160                         {% for row in my_slices %}     
161                 <tr class="border_bottom">
162                         <td class="odd"> {{ row.slice_name }} </td>
163                                 <td class="odd"> {{ row.cred_exp }} </td>
164                                 <td class="odd"> 
165                                         <button class="btn btn-default btn-xs" name= "dl_{{row.slice_name}}" type="submit" title="Download Slice Credentials">
166                                                 <span class="glyphicon glyphicon-download"></span> Download
167                                         </button> 
168                                 </td>
169                 </tr>
170                 {%endfor%}
171                 </table>
172                 <p></p>
173                 <table class="mytable table table-bordered table-hover">
174                         <caption><b>Delegated Authority Credentials</b></caption>
175                         <tr class="odd"> 
176                         <th>Authority Name</th> 
177                         <th>Expiration Date</th>
178                                 <th>Download</th>
179                         </tr>
180                         {% for row in my_auths %}
181                         <tr class="border_bottom">
182                         <td class="odd"> {{ row.auth_name }} </td>
183                         <td class="odd"> {{ row.cred_exp }} </td>
184                                 <td class="odd">
185                                         <button class="btn btn-default btn-xs" name= "dl_{{row.auth_name}}" type="submit" title="Download Authority Credentials">
186                                                 <span class="glyphicon glyphicon-download"></span> Download
187                                         </button>
188                                 </td>
189                         </tr>
190                         {%endfor%}
191                 </table>
192                 <p></p>
193                  {%if '' not in my_users%}      
194                 <p><button class="btn btn-danger btn-lg btn-block"   name= "clear_cred" type="submit" title="Clear All Credentials">Clear Credentials</button></p>
195                 {%else%}
196                 <p><button class="btn btn-danger btn-lg btn-block disabled"   name= "clear_cred" type="submit" title="Clear All Credentials">Clear Credentials</button></p>
197                 {%endif%}
198     </div>
199 </div>
200 </div>
201
202
203 <h3 id="show-filters" class="plugin-show" style="display: block;">
204 <span class="glyphicon glyphicon-chevron-right"></span>
205 <a href="#" class="plugin-tooltip" data-toggle="tooltip" data-original-title="Show plugin &quot;Pending operations&quot; (QueryUpdater)"></a>TestBed Accounts</h3>
206
207 <div id="hide-filters" class="plugin-hide" style="display: none;">
208 <span class="glyphicon glyphicon-chevron-down"></span>
209 <a href="#" class="plugin-tooltip" data-toggle="tooltip" data-original-title="Hide plugin &quot;Pending operations&quot; (QueryUpdater)">TestBed Accounts</a>
210
211 <h5>Reference Accounts in the following testbeds</h5>
212 <div id="middle" align="center">
213     <div class="well">
214         <table class="mytable table table-bordered table-hover"> 
215             <tr class="odd"> 
216                 <th>Platform</th> 
217                 <th>Account Type</th>
218                                 <th>Reference to</th>
219                                 <th>Remove Account</th>
220             </tr>   
221             {% for row in ref_acc %}         
222             <tr class="border_bottom">
223                 <td class="odd"> {{ row.platform_name }} </td>
224                 <td class="odd"> {{ row.account_type }} </td>
225                                 <td class="odd"> {{ row.account_reference }} </td>
226                                 <td class="odd">
227                                 <button class="btn btn-danger btn-xs" name="delete_{{row.platform_name}}" type="submit" title="Delete account from this platform">
228                                                 <span class="glyphicon glyphicon-minus"></span>
229                                         </button>
230                                 </td>
231             </tr> 
232             {%endfor%}               
233         </table>
234     </div>
235 </div>
236 </div>
237
238
239 <h3 id="show-resources" class="plugin-show" style="display: block;">
240 <span class="glyphicon glyphicon-chevron-right"></span>
241 <a href="#" class="plugin-tooltip" data-toggle="tooltip" data-original-title="Show plugin &quot;Pending operations&quot; (QueryUpdater)"></a>Add Accounts</h3>
242
243 <div id="hide-resources" class="plugin-hide" style="display: none;">
244 <span class="glyphicon glyphicon-chevron-down"></span>
245 <a href="#" class="plugin-tooltip" data-toggle="tooltip" data-original-title="Hide plugin &quot;Pending operations&quot; (QueryUpdater)">Add Accounts</a>
246
247
248 <h5>Add reference account to the following testbeds</h5>
249 <div id="middle" align="center">
250     <div class="well">
251         <table class="mytable table table-bordered table-hover"> 
252             <tr class="odd"> 
253                 <th>Platforms</th> 
254                 <th>Add Account</th>
255             </tr>   
256             {% for platform in platform_list %}         
257             <tr class="border_bottom">
258                 <td class="odd"> {{ platform.platform_no_access }} </td>
259                 <td class="odd">
260                                         <button class="btn btn-success btn-sm" name= "add_{{platform.platform_no_access}}" type="submit" title="Add account to this platform">
261                                                 <span class="glyphicon glyphicon-plus"></span>
262                                         </button>
263                                 </td>
264             </tr> 
265             {%endfor%}               
266         </table>
267     </div>
268 </div>
269 </div>
270 {%endif%} 
271
272 </form>
273
274 {% endblock %}