MyAcc: look & fill
[myslice.git] / portal / templates / account-view.html
1 {% extends "layout-unfold1.html" %}
2 {% block unfold_main %}
3
4 <h2>User Profile <small>User info. in Myslice platform</small></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                                  {%endif%}              
126                                 </tr>
127                                 <tr class="odd">
128                                 <td colspan="2">
129                                         <p class="message" id="pkey_del_msg"><b> Tradeoff:</b> Ease-of-use vs Security.<br>
130                                                         <b>Ease-of-use:</b> Automatic account delegation. Don't delete private key.<br>
131                                                         <b>Security:</b> Manual account delegation. Download & Delete private key.
132                                                 </p>
133                                 </td>
134                                 </tr>
135                         </table>
136         </div>
137 </div>
138
139
140 <h2>Account Information</h2>
141 <h3>Principal Account <small>Account used for delegating credentials</small></h3>
142 <div id="middle" align="center">
143         <div class="well">
144                 <table class="table table-bordered table-hover  mytable"> 
145                         <tr class="odd"> 
146                         <th>Platform</th> 
147                         <th>Account Type</th>
148                                 <th>Account Delegation</th>
149                         <th>User hrn</th>
150                         <!--<th>Pub Key</th> -->
151                 </tr>   
152                         {% for row in principal_acc %}         
153                         <tr class="border_bottom">
154                         <td class="odd"> {{ row.platform_name }} </td>
155                         <td class="odd"> {{ row.account_type }} </td>
156                                 <td class="odd"> {{ row.delegation_type }} </td>
157                         <td class="odd"> {{ row.usr_hrn }}  </td>
158                 <!--    <td class="even"> {{ row.usr_pubkey }} </td> -->
159                 </tr> 
160                         {%endfor%}               
161                 </table>
162         </div>
163 </div>
164
165
166
167
168 <h3 id="show-pending" class="plugin-show" style="display: block;">
169 <span class="glyphicon glyphicon-chevron-right"></span>
170 <a href="#" class="plugin-tooltip" data-toggle="tooltip" data-original-title="Show plugin &quot;Pending operations&quot; (QueryUpdater)"></a>Credentials</h3>
171
172 <div id="hide-pending" class="plugin-hide" style="display: none;">
173 <span class="glyphicon glyphicon-chevron-down"></span>
174 <a href="#" class="plugin-tooltip" data-toggle="tooltip" data-original-title="Hide plugin &quot;Pending operations&quot; (QueryUpdater)">Credentials</a>
175
176 <h5>Delegated Credentials to Principal Account</h5>
177 <div id="middle" align="center">
178     <div class="well">
179         <table class="mytable table table-bordered table-hover">
180                         <caption><b>Delegated User Credential</b></caption> 
181             <tr class="odd"> 
182                 <th>Expiration Date</th>
183                                 <th>Download</th>
184             </tr>
185                         {% for row in my_users %}         
186                         <tr class="border_bottom">
187                         <td class="odd"> {{ row.cred_exp }} </td>
188                                 <td class="odd">
189                                         <button class="btn btn-default btn-xs" name= "dl_user_cred" type="submit" title="Download User Credential">
190                                                 <span class="glyphicon glyphicon-download"></span> Download
191                                         </button>
192                                 </td>
193                         </tr>
194                         {%endfor%}
195                  </table>
196                 <p></p>
197                 <table class="mytable table table-bordered table-hover">
198                         <caption><b>Delegated Slice Credentials</b></caption>  
199                 <tr class="odd"> 
200                                 <th>Slice Name</th> 
201                         <th>Expiration Date</th>
202                                 <th>Download</th>
203                 </tr>
204                         {% for row in my_slices %}     
205                 <tr class="border_bottom">
206                         <td class="odd"> {{ row.slice_name }} </td>
207                                 <td class="odd"> {{ row.cred_exp }} </td>
208                                 <td class="odd"> 
209                                         <button class="btn btn-default btn-xs" name= "dl_{{row.slice_name}}" type="submit" title="Download Slice Credentials">
210                                                 <span class="glyphicon glyphicon-download"></span> Download
211                                         </button> 
212                                 </td>
213                 </tr>
214                 {%endfor%}
215                 </table>
216                 <p></p>
217                 <table class="mytable table table-bordered table-hover">
218                         <caption><b>Delegated Authority Credentials</b></caption>
219                         <tr class="odd"> 
220                         <th>Authority Name</th> 
221                         <th>Expiration Date</th>
222                                 <th>Download</th>
223                         </tr>
224                         {% for row in my_auths %}
225                         <tr class="border_bottom">
226                         <td class="odd"> {{ row.auth_name }} </td>
227                         <td class="odd"> {{ row.cred_exp }} </td>
228                                 <td class="odd">
229                                         <button class="btn btn-default btn-xs" name= "dl_{{row.auth_name}}" type="submit" title="Download Authority Credentials">
230                                                 <span class="glyphicon glyphicon-download"></span> Download
231                                         </button>
232                                 </td>
233                         </tr>
234                         {%endfor%}
235                 </table>
236                 <p></p> 
237                 <p><button class="btn btn-danger btn-lg btn-block"   name= "clear_cred" type="submit" title="Clear All Credentials">Clear Credentials</button></p>
238     </div>
239 </div>
240 </div>
241
242
243 <h3 id="show-filters" class="plugin-show" style="display: block;">
244 <span class="glyphicon glyphicon-chevron-right"></span>
245 <a href="#" class="plugin-tooltip" data-toggle="tooltip" data-original-title="Show plugin &quot;Pending operations&quot; (QueryUpdater)"></a>TestBed Accounts</h3>
246
247 <div id="hide-filters" class="plugin-hide" style="display: none;">
248 <span class="glyphicon glyphicon-chevron-down"></span>
249 <a href="#" class="plugin-tooltip" data-toggle="tooltip" data-original-title="Hide plugin &quot;Pending operations&quot; (QueryUpdater)">TestBed Accounts</a>
250
251 <h5>Reference Accounts in the following testbeds</h5>
252 <div id="middle" align="center">
253     <div class="well">
254         <table class="mytable table table-bordered table-hover"> 
255             <tr class="odd"> 
256                 <th>Platform</th> 
257                 <th>Account Type</th>
258                                 <th>Reference to</th>
259                                 <th>Remove Account</th>
260             </tr>   
261             {% for row in ref_acc %}         
262             <tr class="border_bottom">
263                 <td class="odd"> {{ row.platform_name }} </td>
264                 <td class="odd"> {{ row.account_type }} </td>
265                                 <td class="odd"> {{ row.account_reference }} </td>
266                                 <td class="odd">
267                                 <button class="btn btn-danger btn-xs" name="delete_{{row.platform_name}}" type="submit" title="Delete account from this platform">
268                                                 <span class="glyphicon glyphicon-minus"></span>
269                                         </button>
270                                 </td>
271             </tr> 
272             {%endfor%}               
273         </table>
274     </div>
275 </div>
276 </div>
277
278
279 <h3 id="show-resources" class="plugin-show" style="display: block;">
280 <span class="glyphicon glyphicon-chevron-right"></span>
281 <a href="#" class="plugin-tooltip" data-toggle="tooltip" data-original-title="Show plugin &quot;Pending operations&quot; (QueryUpdater)"></a>Add Accounts</h3>
282
283 <div id="hide-resources" class="plugin-hide" style="display: none;">
284 <span class="glyphicon glyphicon-chevron-down"></span>
285 <a href="#" class="plugin-tooltip" data-toggle="tooltip" data-original-title="Hide plugin &quot;Pending operations&quot; (QueryUpdater)">Add Accounts</a>
286
287
288 <h5>Add reference account to the following testbeds</h5>
289 <div id="middle" align="center">
290     <div class="well">
291         <table class="mytable table table-bordered table-hover"> 
292             <tr class="odd"> 
293                 <th>Platforms</th> 
294                 <th>Add Account</th>
295             </tr>   
296             {% for platform in platform_list %}         
297             <tr class="border_bottom">
298                 <td class="odd"> {{ platform.platform_no_access }} </td>
299                 <td class="odd">
300                                         <button class="btn btn-success btn-xs" name= "add_{{platform.platform_no_access}}" type="submit" title="Add account to this platform">
301                                                 <span class="glyphicon glyphicon-plus"></span>
302                                         </button>
303                                 </td>
304             </tr> 
305             {%endfor%}               
306         </table>
307     </div>
308 </div>
309 </div>
310
311 </form>
312
313 {% endblock %}