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