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