MyAcc: page object included
[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 <h2>Account Information</h2>
126 <h3>Principal Account <small>Account used for delegating credentials</small></h3>
127 <div id="middle" align="center">
128         <div class="well">
129                 <table class="table table-bordered table-hover  mytable"> 
130                         <tr class="odd"> 
131                         <th>Platform</th> 
132                         <th>Account Type</th>
133                                 <th>Account Delegation</th>
134                         <th>User hrn</th>
135                         <!--<th>Pub Key</th> -->
136                 </tr>   
137                         {% for row in principal_acc %}         
138                         <tr class="border_bottom">
139                         <td class="odd"> {{ row.platform_name }} </td>
140                         <td class="odd"> {{ row.account_type }} </td>
141                                 <td class="odd"> {{ row.delegation_type }} </td>
142                         <td class="odd"> {{ row.usr_hrn }}  </td>
143                 <!--    <td class="even"> {{ row.usr_pubkey }} </td> -->
144                 </tr> 
145                         {%endfor%}               
146                 </table>
147         </div>
148 </div>
149
150
151 <h3>Credentials</h3>
152 <div id="middle" align="center">
153     <div class="well">
154         <table class="mytable table table-bordered table-hover">
155                         <caption><b>Delegated User Credential</b></caption> 
156             <tr class="odd"> 
157                 <th>Expiration Date</th>
158                                 <th>Download</th>
159             </tr>
160                         {% for row in my_users %}         
161                         <tr class="border_bottom">
162                         <td class="odd"> {{ row.cred_exp }} </td>
163                                 <td class="odd"><button class="btn btn-default btn-xs" name= "dl_user_cred" type="submit" title="Download User Credential">Download</button></td>
164                         </tr>
165                         {%endfor%}
166                  </table>
167                 <p></p>
168                 <table class="mytable table table-bordered table-hover">
169                         <caption><b>Delegated Slice Credentials</b></caption>  
170                 <tr class="odd"> 
171                                 <th>Slice Name</th> 
172                         <th>Expiration Date</th>
173                                 <th>Download</th>
174                 </tr>
175                         {% for row in my_slices %}     
176                 <tr class="border_bottom">
177                         <td class="odd"> {{ row.slice_name }} </td>
178                                 <td class="odd"> {{ row.cred_exp }} </td>
179                                 <td class="odd"> <button class="btn btn-default btn-xs" name= "dl_{{row.slice_name}}" type="submit" title="Download Slice Credentials">Download</button> </td>
180                 </tr>
181                 {%endfor%}
182                 </table>
183                 <p></p>
184                 <table class="mytable table table-bordered table-hover">
185                         <caption><b>Delegated Authority Credentials</b></caption>
186                         <tr class="odd"> 
187                         <th>Authority Name</th> 
188                         <th>Expiration Date</th>
189                                 <th>Download</th>
190                         </tr>
191                         {% for row in my_auths %}
192                         <tr class="border_bottom">
193                         <td class="odd"> {{ row.auth_name }} </td>
194                         <td class="odd"> {{ row.cred_exp }} </td>
195                                 <td class="odd"><button class="btn btn-default btn-xs" name= "dl_{{row.auth_name}}" type="submit" title="Download Authority Credentials">Download</button></td>
196                         </tr>
197                         {%endfor%}
198                 </table>
199                 <p></p> 
200                 <p><button class="btn btn-danger btn-lg btn-block"   name= "clear_cred" type="submit" title="Clear All Credentials">Clear Credentials</button></p>
201     </div>
202 </div>
203
204
205
206
207 <h3>Testbed Accounts <small>Reference accounts in the following testbeds</small></h3>
208 <div id="middle" align="center">
209     <div class="well">
210         <table class="mytable table table-bordered table-hover"> 
211             <tr class="odd"> 
212                 <th>Platform</th> 
213                 <th>Account Type</th>
214                                 <th>Reference to</th>
215                                 <th>Remove Account</th>
216             </tr>   
217             {% for row in ref_acc %}         
218             <tr class="border_bottom">
219                 <td class="odd"> {{ row.platform_name }} </td>
220                 <td class="odd"> {{ row.account_type }} </td>
221                                 <td class="odd"> {{ row.account_reference }} </td>
222                                 <td class="odd">
223                                 <button class="btn btn-danger btn-xs" name="delete_{{row.platform_name}}" type="submit" title="Delete account from this platform">Delete</button>
224                                 </td>
225             </tr> 
226             {%endfor%}               
227         </table>
228     </div>
229 </div>
230
231 <h3>Add Accounts <small>Add ref. account to the following testbeds</small></h3>
232 <div id="middle" align="center">
233     <div class="well">
234         <table class="mytable table table-bordered table-hover"> 
235             <tr class="odd"> 
236                 <th>Platforms</th> 
237                 <th>Add Account</th>
238             </tr>   
239             {% for platform in platform_list %}         
240             <tr class="border_bottom">
241                 <td class="odd"> {{ platform.platform_no_access }} </td>
242                 <td class="odd">
243                                         <button class="btn btn-success btn-xs" name= "add_{{platform.platform_no_access}}" type="submit" title="Add account to this platform">Add</button>
244                                 </td>
245             </tr> 
246             {%endfor%}               
247         </table>
248     </div>
249 </div>
250
251 </form>
252
253 {% endblock %}