ManageUser: Display OK. Edit- ToDo
[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="account_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">
28                                                 <span id="emailval" class="value" >{{ user_email }}</span>
29                                                 <button class="btn btn-default btn-xs" type="button" id="edit_email"  title="To change your affiliation please contact the administrator">
30                                                 <span class="glyphicon glyphicon-edit"></span> Edit
31                                                 </button>
32                                         </td>
33                         </tr>
34                         <tr class="even">
35                                         <td class="key">Full Name</td>
36                                         <td class="value">
37                                                 <span id="nameval" class="value" >{{ fullname }} </span>
38                                                 <span class="hide_this" id="span_name">
39                                                 <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_name_change"> Cancel </button> 
40                                                 <div style='display:none;'><input type='hidden'  name='nameform'  /></div>
41                                                 <input id="fname" type="text" name="fname" class="required"  maxlength="200" value="{{firstname}}" />
42                                                 <input id="lname" type="text" name="lname" class="required"  maxlength="200" value="{{lastname}}" />
43                                                 <input type="submit" class="btn btn-default btn-xs" name="submit_name" value="Save"/>
44                                                 </span>
45                                                 <button class="btn btn-default btn-xs" type="button"title="Full Name" id="edit_name">
46                                                         <span class="glyphicon glyphicon-edit"></span> Edit
47                                                 </button>
48                                         </td>
49                         </tr>
50                         <tr class="odd">
51                                         <td class="key">Authority</td>
52                                         <td class="value">
53                                                 <span id="affval" class="value">{{ authority }}</span>
54                                                  <button class="btn btn-default btn-xs" type="button" id="edit_auth"   title="To change your authority please contact the administrator">
55                                                 <span class="glyphicon glyphicon-edit"></span> Edit
56                                                  </button>
57                                         </td>
58                                 </tr>
59                                 <tr class="even">
60                                         <td class="key">Generate Keys</td>
61                                         <td>
62                                                 <input type="submit" name="generate" class="btn btn-danger btn-xs" value="Generate a new Key Pair" id="generate_keypair" 
63                                                            onclick="return confirm('Are you sure? If you do so, your current credentials will be overwritten.');" 
64                                                            title="It will generate a new key Pair and your current credentials will be overwritten."/>
65                                 </td> 
66                         </tr>
67                         <tr class="odd">
68                                 <td class="key">Public Key</td>
69                                 <td class="value">
70                                                 <span id="keyval" class="value">******** </span>
71                                                 <span class="hide_this" id="span_upload">
72                                                         <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_upload"> Cancel </button>
73                                                         <div style='display:none;'>
74                                                                 <input type='hidden'  name='upload'  /></div>
75                                                                 <input type="file" name="pubkey" class="required" id="pubkey"/>  
76                                                                 <input class="btn btn-default btn-xs" name="upload_key" id="upload_key"  type="submit" title="Upload your public key" value="Upload"
77                                                                    onclick="return confirm('Are you sure? It will overwrite your current credentials and you have delegate it manually.');"/>
78                                                 </span>
79                                                 <div style='display:none;'> <input type='hidden'  name='dload'  /> </div> 
80                                                 <button type="submit" name="dl_pubkey" class="btn btn-default btn-xs" title="Download your public key" id="dl_file">
81                                                         <span class="glyphicon glyphicon-download"></span> Download
82                                                 </button>
83                                                 <button class="btn btn-default btn-xs" id="upload_file" type="button" title="Upload a public key">
84                                                         <span class="glyphicon glyphicon-upload"></span> Upload
85                                                 </button>       
86                                 </td>
87                         </tr>
88                         <tr class="even" id="pkey_row">
89                                  {%if 'N/A' not in user_private_key%}
90                                 <td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform   -->
91                                 <td class="value">********<a href="#">
92                                         <button type="submit" name="dl_pkey" class="btn btn-default btn-xs" title="Download your privaye key" id="dl_pkey">
93                                                         <span class="glyphicon glyphicon-download"></span> Download     
94                                                 </button>
95                                         <input class="btn btn-danger btn-xs" id="delete" name="delete" type="submit"  value="Delete" title="Delete your private key"
96                                                                 onclick="return confirm('Are you sure? If you do so, you have to delegate your credentials manually.');"/> 
97                                 </td>
98                                   {%else%}
99                                         <td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform   -->
100                                         <td class="value">********<a href="#">
101                                         <button type="submit" name="dl_pkey" class="btn btn-default btn-xs disabled" title="Download your privaye key" id="dl_pkey">
102                                                 <span class="glyphicon glyphicon-download"></span> Download 
103                                         </button>
104                                         <input class="btn btn-danger btn-xs disabled" id="delete" name="delete" type="submit" title="Delete your private key"
105                                                                 value="Delete"  />
106                                         </td>
107                                  {%endif%}              
108                                 </tr>
109                         </table>
110         </div>
111 </div>
112
113
114 <h2>Account Information</h2>
115 <h3>Principal Account <small>Account used for delegating credentials</small></h3>
116 <div id="middle" align="center">
117         <div class="well">
118                 <table class="table table-bordered table-hover  mytable"> 
119                         <tr class="odd"> 
120                         <th>Platform</th> 
121                         <th>Account Type</th>
122                                 <th>Account Delegation</th>
123                         <th>User hrn</th>
124                                 <th>User Status</th>
125                         <!--<th>Pub Key</th> -->
126                 </tr>   
127                         {% for row in principal_acc %}         
128                         <tr class="border_bottom">
129                         <td class="odd"> {{ row.platform_name }} </td>
130                         <td class="odd"> {{ row.account_type }} </td>
131                                 <td class="odd"> {{ row.delegation_type }} </td>
132                         <td class="odd"> {{ row.usr_hrn }}  </td>
133                                 <td class="odd"> {{ row.user_status }}  </td>
134                 <!--    <td class="even"> {{ row.usr_pubkey }} </td> -->
135                 </tr> 
136                         {%endfor%}               
137                 </table>
138         </div>
139 </div>
140
141
142
143 {%if 'Enabled'  in user_status %}
144 <h3 id="show-pending" class="plugin-show" style="display: block;">
145 <span class="glyphicon glyphicon-chevron-right"></span>
146 <a href="#" class="plugin-tooltip" data-toggle="tooltip" data-original-title="Show plugin &quot;Pending operations&quot; (QueryUpdater)"></a>Credentials</h3>
147
148 <div id="hide-pending" class="plugin-hide" style="display: none;">
149 <span class="glyphicon glyphicon-chevron-down"></span>
150 <a href="#" class="plugin-tooltip" data-toggle="tooltip" data-original-title="Hide plugin &quot;Pending operations&quot; (QueryUpdater)">Credentials</a>
151
152 <h5>Delegated Credentials to Principal Account</h5>
153 <div id="middle" align="center">
154     <div class="well">
155         <table class="mytable table table-bordered table-hover">
156                         <caption><b>Delegated User Credential</b></caption> 
157             <tr class="odd"> 
158                 <th>Expiration Date</th>
159                                 <th>Download</th>
160             </tr>
161                         {% for row in my_users %}         
162                         <tr class="border_bottom">
163                         <td class="odd"> {{ row.cred_exp }} </td>
164                                 <td class="odd">
165                                         <button class="btn btn-default btn-xs" name= "dl_user_cred" type="submit" title="Download User Credential">
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 Slice Credentials</b></caption>  
175                 <tr class="odd"> 
176                                 <th>Slice Name</th> 
177                         <th>Expiration Date</th>
178                                 <th>Download</th>
179                 </tr>
180                         {% for row in my_slices %}     
181                 <tr class="border_bottom">
182                         <td class="odd"> {{ row.slice_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.slice_name}}" type="submit" title="Download Slice Credentials">
186                                                 <span class="glyphicon glyphicon-download"></span> Download
187                                         </button> 
188                                 </td>
189                 </tr>
190                 {%endfor%}
191                 </table>
192                 <p></p>
193                 <table class="mytable table table-bordered table-hover">
194                         <caption><b>Delegated Authority Credentials</b></caption>
195                         <tr class="odd"> 
196                         <th>Authority Name</th> 
197                         <th>Expiration Date</th>
198                                 <th>Download</th>
199                         </tr>
200                         {% for row in my_auths %}
201                         <tr class="border_bottom">
202                         <td class="odd"> {{ row.auth_name }} </td>
203                         <td class="odd"> {{ row.cred_exp }} </td>
204                                 <td class="odd">
205                                         <button class="btn btn-default btn-xs" name= "dl_{{row.auth_name}}" type="submit" title="Download Authority Credentials">
206                                                 <span class="glyphicon glyphicon-download"></span> Download
207                                         </button>
208                                 </td>
209                         </tr>
210                         {%endfor%}
211                 </table>
212                 <p></p>
213                  {%if '' not in my_users%}      
214                 <p><button class="btn btn-danger btn-lg btn-block"   name= "clear_cred" type="submit" title="Clear All Credentials">Clear Credentials</button></p>
215                 {%else%}
216                 <p><button class="btn btn-danger btn-lg btn-block disabled"   name= "clear_cred" type="submit" title="Clear All Credentials">Clear Credentials</button></p>
217                 {%endif%}
218     </div>
219 </div>
220 </div>
221
222
223 <h3 id="show-filters" class="plugin-show" style="display: block;">
224 <span class="glyphicon glyphicon-chevron-right"></span>
225 <a href="#" class="plugin-tooltip" data-toggle="tooltip" data-original-title="Show plugin &quot;Pending operations&quot; (QueryUpdater)"></a>TestBed Accounts</h3>
226
227 <div id="hide-filters" class="plugin-hide" style="display: none;">
228 <span class="glyphicon glyphicon-chevron-down"></span>
229 <a href="#" class="plugin-tooltip" data-toggle="tooltip" data-original-title="Hide plugin &quot;Pending operations&quot; (QueryUpdater)">TestBed Accounts</a>
230
231 <h5>Reference Accounts in the following testbeds</h5>
232 <div id="middle" align="center">
233     <div class="well">
234         <table class="mytable table table-bordered table-hover"> 
235             <tr class="odd"> 
236                 <th>Platform</th> 
237                 <th>Account Type</th>
238                                 <th>Reference to</th>
239                                 <th>Remove Account</th>
240             </tr>   
241             {% for row in ref_acc %}         
242             <tr class="border_bottom">
243                 <td class="odd"> {{ row.platform_name }} </td>
244                 <td class="odd"> {{ row.account_type }} </td>
245                                 <td class="odd"> {{ row.account_reference }} </td>
246                                 <td class="odd">
247                                 <button class="btn btn-danger btn-xs" name="delete_{{row.platform_name}}" type="submit" title="Delete account from this platform">
248                                                 <span class="glyphicon glyphicon-minus"></span>
249                                         </button>
250                                 </td>
251             </tr> 
252             {%endfor%}               
253         </table>
254     </div>
255 </div>
256 </div>
257
258
259 <h3 id="show-resources" class="plugin-show" style="display: block;">
260 <span class="glyphicon glyphicon-chevron-right"></span>
261 <a href="#" class="plugin-tooltip" data-toggle="tooltip" data-original-title="Show plugin &quot;Pending operations&quot; (QueryUpdater)"></a>Add Accounts</h3>
262
263 <div id="hide-resources" class="plugin-hide" style="display: none;">
264 <span class="glyphicon glyphicon-chevron-down"></span>
265 <a href="#" class="plugin-tooltip" data-toggle="tooltip" data-original-title="Hide plugin &quot;Pending operations&quot; (QueryUpdater)">Add Accounts</a>
266
267
268 <h5>Add reference account to the following testbeds</h5>
269 <div id="middle" align="center">
270     <div class="well">
271         <table class="mytable table table-bordered table-hover"> 
272             <tr class="odd"> 
273                 <th>Platforms</th> 
274                 <th>Add Account</th>
275             </tr>   
276             {% for platform in platform_list %}         
277             <tr class="border_bottom">
278                 <td class="odd"> {{ platform.platform_no_access }} </td>
279                 <td class="odd">
280                                         <button class="btn btn-success btn-sm" name= "add_{{platform.platform_no_access}}" type="submit" title="Add account to this platform">
281                                                 <span class="glyphicon glyphicon-plus"></span>
282                                         </button>
283                                 </td>
284             </tr> 
285             {%endfor%}               
286         </table>
287     </div>
288 </div>
289 </div>
290 {%endif%} 
291
292 </form>
293
294 {% endblock %}