3675c9af27fd8f3e889c1ca14bfc05dd47bd9c7d
[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                         <tr class="odd" id="pkey_row">
90                                  {%if 'N/A' not in user_private_key%}
91                                 <td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform   -->
92                                 <td class="value">********<a href="#">
93                                         <button type="submit" name="dl_pkey" class="btn btn-default btn-xs" title="Download your privaye key" id="dl_pkey">
94                                                         <span class="glyphicon glyphicon-download"></span> Download     
95                                                 </button>
96                                         <input class="btn btn-danger btn-xs" id="delete" name="delete" type="submit"  value="Delete" title="Delete your private key"
97                                                                 onclick="return confirm('Are you sure? If you do so, you have to delegate your credentials manually.');"/> 
98                                 </td>
99                                   {%else%}
100                                         <td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform   -->
101                                         <td class="value">********<a href="#">
102                                         <button type="submit" name="dl_pkey" class="btn btn-default btn-xs disabled" title="Download your privaye key" id="dl_pkey">
103                                                 <span class="glyphicon glyphicon-download"></span> Download 
104                                         </button>
105                                         <input class="btn btn-danger btn-xs disabled" id="delete" name="delete" type="submit" title="Delete your private key"
106                                                                 value="Delete"  />
107                                         </td>
108                                  {%endif%}              
109                                 </tr>
110                         </table>
111         </div>
112 </div>
113
114
115 <h2>Account Information</h2>
116 <h3>Principal Account <small>Account used for delegating credentials</small></h3>
117 <div id="middle" align="center">
118         <div class="well">
119                 <table class="table table-bordered table-hover  mytable"> 
120                         <tr class="odd"> 
121                         <th>Platform</th> 
122                         <th>Account Type</th>
123                                 <th>Account Delegation</th>
124                         <th>User hrn</th>
125                                 <th>User Status</th>
126                         <!--<th>Pub Key</th> -->
127                 </tr>   
128                         {% for row in principal_acc %}         
129                         <tr class="border_bottom">
130                         <td class="odd"> {{ row.platform_name }} </td>
131                         <td class="odd"> {{ row.account_type }} </td>
132                                 <td class="odd"> {{ row.delegation_type }} </td>
133                         <td class="odd"> {{ row.usr_hrn }}  </td>
134                                 <td class="odd"> {{ row.user_status }}  </td>
135                 <!--    <td class="even"> {{ row.usr_pubkey }} </td> -->
136                 </tr> 
137                         {%endfor%}               
138                 </table>
139         </div>
140 </div>
141
142
143
144 {%if 'Enabled'  in user_status %}
145 <h3 id="show-pending" class="plugin-show" style="display: block;">
146 <span class="glyphicon glyphicon-chevron-right"></span>
147 <a href="#" class="plugin-tooltip" data-toggle="tooltip" data-original-title="Show plugin &quot;Pending operations&quot; (QueryUpdater)"></a>Credentials</h3>
148
149 <div id="hide-pending" class="plugin-hide" style="display: none;">
150 <span class="glyphicon glyphicon-chevron-down"></span>
151 <a href="#" class="plugin-tooltip" data-toggle="tooltip" data-original-title="Hide plugin &quot;Pending operations&quot; (QueryUpdater)">Credentials</a>
152
153 <h5>Delegated Credentials to Principal Account</h5>
154 <div id="middle" align="center">
155     <div class="well">
156         <table class="mytable table table-bordered table-hover">
157                         <caption><b>Delegated User Credential</b></caption> 
158             <tr class="odd"> 
159                 <th>Expiration Date</th>
160                                 <th>Download</th>
161             </tr>
162                         {% for row in my_users %}         
163                         <tr class="border_bottom">
164                         <td class="odd"> {{ row.cred_exp }} </td>
165                                 <td class="odd">
166                                         <button class="btn btn-default btn-xs" name= "dl_user_cred" type="submit" title="Download User Credential">
167                                                 <span class="glyphicon glyphicon-download"></span> Download
168                                         </button>
169                                 </td>
170                         </tr>
171                         {%endfor%}
172                  </table>
173                 <p></p>
174                 <table class="mytable table table-bordered table-hover">
175                         <caption><b>Delegated Slice Credentials</b></caption>  
176                 <tr class="odd"> 
177                                 <th>Slice Name</th> 
178                         <th>Expiration Date</th>
179                                 <th>Download</th>
180                 </tr>
181                         {% for row in my_slices %}     
182                 <tr class="border_bottom">
183                         <td class="odd"> {{ row.slice_name }} </td>
184                                 <td class="odd"> {{ row.cred_exp }} </td>
185                                 <td class="odd"> 
186                                         <button class="btn btn-default btn-xs" name= "dl_{{row.slice_name}}" type="submit" title="Download Slice Credentials">
187                                                 <span class="glyphicon glyphicon-download"></span> Download
188                                         </button> 
189                                 </td>
190                 </tr>
191                 {%endfor%}
192                 </table>
193                 <p></p>
194                 <table class="mytable table table-bordered table-hover">
195                         <caption><b>Delegated Authority Credentials</b></caption>
196                         <tr class="odd"> 
197                         <th>Authority Name</th> 
198                         <th>Expiration Date</th>
199                                 <th>Download</th>
200                         </tr>
201                         {% for row in my_auths %}
202                         <tr class="border_bottom">
203                         <td class="odd"> {{ row.auth_name }} </td>
204                         <td class="odd"> {{ row.cred_exp }} </td>
205                                 <td class="odd">
206                                         <button class="btn btn-default btn-xs" name= "dl_{{row.auth_name}}" type="submit" title="Download Authority Credentials">
207                                                 <span class="glyphicon glyphicon-download"></span> Download
208                                         </button>
209                                 </td>
210                         </tr>
211                         {%endfor%}
212                 </table>
213                 <p></p>
214                  {%if '' not in my_users%}      
215                 <p><button class="btn btn-danger btn-lg btn-block"   name= "clear_cred" type="submit" title="Clear All Credentials">Clear Credentials</button></p>
216                 {%else%}
217                 <p><button class="btn btn-danger btn-lg btn-block disabled"   name= "clear_cred" type="submit" title="Clear All Credentials">Clear Credentials</button></p>
218                 {%endif%}
219     </div>
220 </div>
221 </div>
222
223
224 <h3 id="show-filters" class="plugin-show" style="display: block;">
225 <span class="glyphicon glyphicon-chevron-right"></span>
226 <a href="#" class="plugin-tooltip" data-toggle="tooltip" data-original-title="Show plugin &quot;Pending operations&quot; (QueryUpdater)"></a>TestBed Accounts</h3>
227
228 <div id="hide-filters" class="plugin-hide" style="display: none;">
229 <span class="glyphicon glyphicon-chevron-down"></span>
230 <a href="#" class="plugin-tooltip" data-toggle="tooltip" data-original-title="Hide plugin &quot;Pending operations&quot; (QueryUpdater)">TestBed Accounts</a>
231
232 <h5>Reference Accounts in the following testbeds</h5>
233 <div id="middle" align="center">
234     <div class="well">
235         <table class="mytable table table-bordered table-hover"> 
236             <tr class="odd"> 
237                 <th>Platform</th> 
238                 <th>Account Type</th>
239                                 <th>Reference to</th>
240                                 <th>Remove Account</th>
241             </tr>   
242             {% for row in ref_acc %}         
243             <tr class="border_bottom">
244                 <td class="odd"> {{ row.platform_name }} </td>
245                 <td class="odd"> {{ row.account_type }} </td>
246                                 <td class="odd"> {{ row.account_reference }} </td>
247                                 <td class="odd">
248                                 <button class="btn btn-danger btn-xs" name="delete_{{row.platform_name}}" type="submit" title="Delete account from this platform">
249                                                 <span class="glyphicon glyphicon-minus"></span>
250                                         </button>
251                                 </td>
252             </tr> 
253             {%endfor%}               
254         </table>
255     </div>
256 </div>
257 </div>
258
259
260 <h3 id="show-resources" class="plugin-show" style="display: block;">
261 <span class="glyphicon glyphicon-chevron-right"></span>
262 <a href="#" class="plugin-tooltip" data-toggle="tooltip" data-original-title="Show plugin &quot;Pending operations&quot; (QueryUpdater)"></a>Add Accounts</h3>
263
264 <div id="hide-resources" class="plugin-hide" style="display: none;">
265 <span class="glyphicon glyphicon-chevron-down"></span>
266 <a href="#" class="plugin-tooltip" data-toggle="tooltip" data-original-title="Hide plugin &quot;Pending operations&quot; (QueryUpdater)">Add Accounts</a>
267
268
269 <h5>Add reference account to the following testbeds</h5>
270 <div id="middle" align="center">
271     <div class="well">
272         <table class="mytable table table-bordered table-hover"> 
273             <tr class="odd"> 
274                 <th>Platforms</th> 
275                 <th>Add Account</th>
276             </tr>   
277             {% for platform in platform_list %}         
278             <tr class="border_bottom">
279                 <td class="odd"> {{ platform.platform_no_access }} </td>
280                 <td class="odd">
281                                         <button class="btn btn-success btn-sm" name= "add_{{platform.platform_no_access}}" type="submit" title="Add account to this platform">
282                                                 <span class="glyphicon glyphicon-plus"></span>
283                                         </button>
284                                 </td>
285             </tr> 
286             {%endfor%}               
287         </table>
288     </div>
289 </div>
290 </div>
291 {%endif%} 
292
293 </form>
294
295 {% endblock %}