MyAcc: Adopted look & fill from Slice page
[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                                                 <img class="img-thumbnail" src="{{STATIC_URL}}/img/ques_icon.png" onclick="emailAlert()"  title="To change your email please contact the administrator" 
30                                                          style="height: 24px;  position: absolute; left: 625px; left: 900px; margin-top: -3px;">
31                                         </td>
32                         </tr>
33                         <tr class="odd">
34                                         <td class="key">Password</td>
35                                         <td class="value"> 
36                                                 <button class="btn btn-default btn-xs" type="button" title="Password" name="edit_pass" id="edit_pass">Edit</button>
37                                                 <span id="passval"class="value">******** </span>
38                                                 <span class="hide_this" id="span_pass">
39                                                 <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_pass_change"> Cancel </button>
40                                                 <div style='display:none;' id="pass_form">
41                                                 <input type='hidden'  value='' /></div>
42                                                 <table id="edit_password">
43                                                         <tr>
44                                                                         <td>Enter password: </td>
45                                                                         <td class="field"> <input type="password" name="password" id="password" /> </td>
46                                                                 </tr>
47                                                                 <tr>
48                                                                         <td>Confirm password: </td>
49                                                                         <td class="field"> 
50                                                                                 <input type="password" name="confirmpassword" id="confirmpassword" /> 
51                                                                                 <input type="submit" class="btn btn-default btn-xs" name="submit_pass" value="Save"/> 
52                                                                         </td>
53                                                         </tr>
54                                                 </table>
55                                                 </span> 
56                                         </td>
57                         </tr>
58                         <tr class="even">
59                                         <td class="key">Full Name</td>
60                                         <td class="value">
61                                                 <span id="nameval" class="value" >{{ fullname }} </span>
62                                                 <span class="hide_this" id="span_name">
63                                                 <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_name_change"> Cancel </button> 
64                                                 <div style='display:none;'><input type='hidden'  name='nameform'  /></div>
65                                                 <input id="fname" type="text" name="fname" class="required"  maxlength="200" value="{{firstname}}" />
66                                                 <input id="lname" type="text" name="lname" class="required"  maxlength="200" value="{{lastname}}" />
67                                                 <input type="submit" class="btn btn-default btn-xs" name="submit_name" value="Save"/>
68                                                 </span>
69                                                 <button class="btn btn-default btn-xs" type="button"title="Full Name" id="edit_name">Edit</button>
70                                         </td>
71                         </tr>
72                         <tr class="odd">
73                                         <td class="key">Authority</td>
74                                         <td class="value">
75                                                 <span id="affval" class="value">{{ authority }}</span>
76                                                 <img class="img-thumbnail" src="{{STATIC_URL}}/img/ques_icon.png" onclick="affAlert()"  title="To change your affiliation please contact the administrator" 
77                                                          style="height: 24px; position: absolute; left: 625px; left: 900px; margin-top:-3px; ">
78                                         </td>
79                                 </tr>
80                                 <tr class="even">
81                                         <td class="key">Generate Keys</td>
82                                         <td> 
83                                                 <button id="generate_keypair" class="btn btn-danger btn-xs" name="generate" type="submit" onclick="myFunction()" 
84                                                                 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 
85                                                 </button>
86                                 </td> 
87                         </tr>
88                         <tr class="odd">
89                                 <td class="key">Public Key</td>
90                                 <td class="value">
91                                                 <span id="keyval" class="value">******** </span>
92                                                 <span class="hide_this" id="span_upload">
93                                                         <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_upload"> Cancel </button>
94                                                         <div style='display:none;'>
95                                                         <input type='hidden'  name='upload'  /></div>
96                                                         <input type="file" name="pubkey" class="required" id="pubkey"/>  
97                                                         <button class="btn btn-default btn-xs" name="upload_key" id="upload_key"  type="submit" title="Delete your private key">Upload </button>
98                                                 </span>
99                                                 <div style='display:none;'> <input type='hidden'  name='dload'  /> </div> 
100                                                 <button type="submit" name="dl_pubkey" class="btn btn-default btn-xs" title="Download your public key" id="dl_file"> Download </button>
101                                                 <button class="btn btn-default btn-xs" id="upload_file" type="button" title="Upload a public key"> Upload </button>       
102                                 </td>
103                         </tr>
104                         <tr class="even" id="pkey_row">
105                                  {%if 'N/A' not in user_private_key%}
106                                 <td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform   -->
107                                 <td class="value">********<a href="#">
108                                         <button type="submit" name="dl_pkey" class="btn btn-default btn-xs" title="Download your privaye key" id="dl_pkey"> Download </button>
109                                         <button class="btn btn-danger btn-xs" id="delete" name="delete" type="submit" title="Delete your private key">Delete </button>
110                                 </td>
111                                  {%endif%}              
112                                 </tr>
113                                 <tr class="odd">
114                                 <td colspan="2">
115                                         <p class="message" id="pkey_del_msg"><b> Tradeoff:</b> Ease-of-use vs Security.<br>
116                                                         <b>Ease-of-use:</b> Automatic account delegation. Don't delete private key.<br>
117                                                         <b>Security:</b> Manual account delegation. Download & Delete private key.
118                                                 </p>
119                                 </td>
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>Pub Key</th> -->
137                 </tr>   
138                         {% for row in principal_acc %}         
139                         <tr class="border_bottom">
140                         <td class="odd"> {{ row.platform_name }} </td>
141                         <td class="odd"> {{ row.account_type }} </td>
142                                 <td class="odd"> {{ row.delegation_type }} </td>
143                         <td class="odd"> {{ row.usr_hrn }}  </td>
144                 <!--    <td class="even"> {{ row.usr_pubkey }} </td> -->
145                 </tr> 
146                         {%endfor%}               
147                 </table>
148         </div>
149 </div>
150
151
152
153
154 <h3 id="show-pending" class="plugin-show" style="display: block;">
155 <span class="glyphicon glyphicon-chevron-right"></span>
156 <a href="#" class="plugin-tooltip" data-toggle="tooltip" data-original-title="Show plugin &quot;Pending operations&quot; (QueryUpdater)"></a>Credentials</h3>
157
158 <div id="hide-pending" class="plugin-hide" style="display: none;">
159 <span class="glyphicon glyphicon-chevron-down"></span>
160 <a href="#" class="plugin-tooltip" data-toggle="tooltip" data-original-title="Hide plugin &quot;Pending operations&quot; (QueryUpdater)">Credentials</a>
161
162 <h5>Delegated Credentials to Principal Account</h5>
163 <div id="middle" align="center">
164     <div class="well">
165         <table class="mytable table table-bordered table-hover">
166                         <caption><b>Delegated User Credential</b></caption> 
167             <tr class="odd"> 
168                 <th>Expiration Date</th>
169                                 <th>Download</th>
170             </tr>
171                         {% for row in my_users %}         
172                         <tr class="border_bottom">
173                         <td class="odd"> {{ row.cred_exp }} </td>
174                                 <td class="odd"><button class="btn btn-default btn-xs" name= "dl_user_cred" type="submit" title="Download User Credential">Download</button></td>
175                         </tr>
176                         {%endfor%}
177                  </table>
178                 <p></p>
179                 <table class="mytable table table-bordered table-hover">
180                         <caption><b>Delegated Slice Credentials</b></caption>  
181                 <tr class="odd"> 
182                                 <th>Slice Name</th> 
183                         <th>Expiration Date</th>
184                                 <th>Download</th>
185                 </tr>
186                         {% for row in my_slices %}     
187                 <tr class="border_bottom">
188                         <td class="odd"> {{ row.slice_name }} </td>
189                                 <td class="odd"> {{ row.cred_exp }} </td>
190                                 <td class="odd"> <button class="btn btn-default btn-xs" name= "dl_{{row.slice_name}}" type="submit" title="Download Slice Credentials">Download</button> </td>
191                 </tr>
192                 {%endfor%}
193                 </table>
194                 <p></p>
195                 <table class="mytable table table-bordered table-hover">
196                         <caption><b>Delegated Authority Credentials</b></caption>
197                         <tr class="odd"> 
198                         <th>Authority Name</th> 
199                         <th>Expiration Date</th>
200                                 <th>Download</th>
201                         </tr>
202                         {% for row in my_auths %}
203                         <tr class="border_bottom">
204                         <td class="odd"> {{ row.auth_name }} </td>
205                         <td class="odd"> {{ row.cred_exp }} </td>
206                                 <td class="odd"><button class="btn btn-default btn-xs" name= "dl_{{row.auth_name}}" type="submit" title="Download Authority Credentials">Download</button></td>
207                         </tr>
208                         {%endfor%}
209                 </table>
210                 <p></p> 
211                 <p><button class="btn btn-danger btn-lg btn-block"   name= "clear_cred" type="submit" title="Clear All Credentials">Clear Credentials</button></p>
212     </div>
213 </div>
214 </div>
215
216
217 <h3 id="show-filters" class="plugin-show" style="display: block;">
218 <span class="glyphicon glyphicon-chevron-right"></span>
219 <a href="#" class="plugin-tooltip" data-toggle="tooltip" data-original-title="Show plugin &quot;Pending operations&quot; (QueryUpdater)"></a>TestBed Accounts</h3>
220
221 <div id="hide-filters" class="plugin-hide" style="display: none;">
222 <span class="glyphicon glyphicon-chevron-down"></span>
223 <a href="#" class="plugin-tooltip" data-toggle="tooltip" data-original-title="Hide plugin &quot;Pending operations&quot; (QueryUpdater)">TestBed Accounts</a>
224
225 <h5>Reference Accounts in the following testbeds</h5>
226 <div id="middle" align="center">
227     <div class="well">
228         <table class="mytable table table-bordered table-hover"> 
229             <tr class="odd"> 
230                 <th>Platform</th> 
231                 <th>Account Type</th>
232                                 <th>Reference to</th>
233                                 <th>Remove Account</th>
234             </tr>   
235             {% for row in ref_acc %}         
236             <tr class="border_bottom">
237                 <td class="odd"> {{ row.platform_name }} </td>
238                 <td class="odd"> {{ row.account_type }} </td>
239                                 <td class="odd"> {{ row.account_reference }} </td>
240                                 <td class="odd">
241                                 <button class="btn btn-danger btn-xs" name="delete_{{row.platform_name}}" type="submit" title="Delete account from this platform">Delete</button>
242                                 </td>
243             </tr> 
244             {%endfor%}               
245         </table>
246     </div>
247 </div>
248 </div>
249
250
251 <h3 id="show-resources" class="plugin-show" style="display: block;">
252 <span class="glyphicon glyphicon-chevron-right"></span>
253 <a href="#" class="plugin-tooltip" data-toggle="tooltip" data-original-title="Show plugin &quot;Pending operations&quot; (QueryUpdater)"></a>Add Accounts</h3>
254
255 <div id="hide-resources" class="plugin-hide" style="display: none;">
256 <span class="glyphicon glyphicon-chevron-down"></span>
257 <a href="#" class="plugin-tooltip" data-toggle="tooltip" data-original-title="Hide plugin &quot;Pending operations&quot; (QueryUpdater)">Add Accounts</a>
258
259
260 <h5>Add reference account to the following testbeds</h5>
261 <div id="middle" align="center">
262     <div class="well">
263         <table class="mytable table table-bordered table-hover"> 
264             <tr class="odd"> 
265                 <th>Platforms</th> 
266                 <th>Add Account</th>
267             </tr>   
268             {% for platform in platform_list %}         
269             <tr class="border_bottom">
270                 <td class="odd"> {{ platform.platform_no_access }} </td>
271                 <td class="odd">
272                                         <button class="btn btn-success btn-xs" name= "add_{{platform.platform_no_access}}" type="submit" title="Add account to this platform">Add</button>
273                                 </td>
274             </tr> 
275             {%endfor%}               
276         </table>
277     </div>
278 </div>
279 </div>
280
281 </form>
282
283 {% endblock %}