1a010ae1f85ab1efd4979fedf2fbe0b66de1fc0c
[unfold.git] / portal / templates / account-view.html
1 {% extends "layout-unfold1.html" %}
2
3 {% block head %}
4 <link rel="stylesheet" type="text/css" href="{{STATIC_URL}}/css/onelab.css"/>
5 <link rel="stylesheet" type="text/css" href="{{STATIC_URL}}/css/account_view.css" />
6 <script type="text/javascript" src="{{STATIC_URL}}/js/jquery.validate.js"></script> 
7 <script type="text/javascript" src="{{STATIC_URL}}/js/my_account.edit_profile.js"></script>
8 <script type="text/javascript" src="{{STATIC_URL}}/js/my_account.register.js"></script>
9 {% endblock %}
10
11 {% block unfold_main %}
12
13 <h2>User Profile <small>User info. in Myslice platform</small></h2>
14
15 {% if messages %}
16 <ul class="messages">
17     {% for message in messages %}
18     <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
19     {% endfor %}
20 </ul>
21 {% endif %}
22
23
24 <form id="editForm"  method="POST" action="account_process" enctype="multipart/form-data">
25 <div id="middle" align="center">
26         <div class="well">
27                 {% csrf_token %}
28                         <table class="profile">          
29                         <tr class="odd">
30                                 <td colspan="2">
31                                                 <div id="info">Platform: Myslice</div>
32                                 </td>
33                         </tr>
34                         <tr class="even">
35                                 <td class="key">Email</td>
36                                 <td class="value">
37                                                 <span id="emailval" class="value" >{{ person.email }}</span>
38                                                 <img class="img-thumbnail" src="{{STATIC_URL}}/img/ques_icon.png" onclick="emailAlert()"  title="To change your email please contact the administrator" 
39                                                          style="height: 24px;  position: absolute; left: 625px; left: 900px; margin-top: -3px;">
40                                         </td>
41                         </tr>
42                         <tr class="odd">
43                                         <td class="key">Password</td>
44                                         <td class="value"> 
45                                                 <button class="btn btn-default btn-xs" type="button" title="Password" name="edit_pass" id="edit_pass">Edit</button>
46                                                 <span id="passval"class="value">******** </span>
47                                                 <span class="hide_this" id="span_pass">
48                                                 <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_pass_change"> Cancel </button>
49                                                 <div style='display:none;' id="pass_form">
50                                                 <input type='hidden'  value='' /></div>
51                                                 <table id="edit_password">
52                                                         <tr>
53                                                                         <td>Enter password: </td>
54                                                                         <td class="field"> <input type="password" name="password" id="password" /> </td>
55                                                                 </tr>
56                                                                 <tr>
57                                                                         <td>Confirm password: </td>
58                                                                         <td class="field"> 
59                                                                                 <input type="password" name="confirmpassword" id="confirmpassword" /> 
60                                                                                 <input type="submit" class="btn btn-default btn-xs" name="submit_pass" value="Save"/> 
61                                                                         </td>
62                                                         </tr>
63                                                 </table>
64                                                 </span> 
65                                         </td>
66                         </tr>
67                         <tr class="even">
68                                         <td class="key">Full Name</td>
69                                         <td class="value">
70                                                 <span id="nameval" class="value" >{{ fullname }} </span>
71                                                 <span class="hide_this" id="span_name">
72                                                 <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_name_change"> Cancel </button> 
73                                                 <div style='display:none;'><input type='hidden'  name='nameform'  /></div>
74                                                 <input id="fname" type="text" name="fname" class="required"  maxlength="200" value="{{firstname}}" />
75                                                 <input id="lname" type="text" name="lname" class="required"  maxlength="200" value="{{lastname}}" />
76                                                 <input type="submit" class="btn btn-default btn-xs" name="submit_name" value="Save"/>
77                                                 </span>
78                                                 <button class="btn btn-default btn-xs" type="button"title="Full Name" id="edit_name">Edit</button>
79                                         </td>
80                         </tr>
81                         <tr class="odd">
82                                         <td class="key">Authority</td>
83                                         <td class="value">
84                                                 <span id="affval" class="value">{{ authority }}</span>
85                                                 <img class="img-thumbnail" src="{{STATIC_URL}}/img/ques_icon.png" onclick="affAlert()"  title="To change your affiliation please contact the administrator" 
86                                                          style="height: 24px; position: absolute; left: 625px; left: 900px; margin-top:-3px; ">
87                                         </td>
88                                 </tr>
89                                 <tr class="even">
90                                         <td class="key">Generate Keys</td>
91                                         <td> 
92                                                 <button id="generate_keypair" class="btn btn-danger btn-xs" name="generate" type="submit" onclick="myFunction()" 
93                                                                 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 
94                                                 </button>
95                                 </td> 
96                         </tr>
97                         <tr class="odd">
98                                 <td class="key">Public Key</td>
99                                 <td class="value">
100                                                 <span id="keyval" class="value">******** </span>
101                                                 <span class="hide_this" id="span_upload">
102                                                         <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_upload"> Cancel </button>
103                                                         <div style='display:none;'>
104                                                         <input type='hidden'  name='upload'  /></div>
105                                                         <input type="file" name="pubkey" class="required" id="pubkey"/>  
106                                                         <button class="btn btn-default btn-xs" name="upload_key" id="upload_key"  type="submit" title="Delete your private key">Upload </button>
107                                                 </span>
108                                                 <div style='display:none;'> <input type='hidden'  name='dload'  /> </div> 
109                                                 <button type="submit" name="dl_pubkey" class="btn btn-default btn-xs" title="Download your public key" id="dl_file"> Download </button>
110                                                 <button class="btn btn-default btn-xs" id="upload_file" type="button" title="Upload a public key"> Upload </button>       
111                                 </td>
112                         </tr>
113                         <tr class="even" id="pkey_row">
114                                  {%if 'N/A' not in user_private_key%}
115                                 <td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform   -->
116                                 <td class="value">********<a href="#">
117                                         <button type="submit" name="dl_pkey" class="btn btn-default btn-xs" title="Download your privaye key" id="dl_pkey"> Download </button>
118                                         <button class="btn btn-danger btn-xs" id="delete" name="delete" type="submit" title="Delete your private key">Delete </button>
119                                 </td>
120                                  {%endif%}              
121                                 </tr>
122                                 <tr class="odd">
123                                 <td colspan="2">
124                                         <p class="message" id="pkey_del_msg"><b> Tradeoff:</b> Ease-of-use vs Security.<br>
125                                                         <b>Ease-of-use:</b> Automatic account delegation. Don't delete private key.<br>
126                                                         <b>Security:</b> Manual account delegation. Download & Delete private key.
127                                                 </p>
128                                 </td>
129                                 </tr>
130                         </table>
131         </div>
132 </div>
133
134 <h2>Account Information</h2>
135 <h3>Principal Account <small>Account used for delegating credentials</small></h3>
136 <div id="middle" align="center">
137         <div class="well">
138                 <table class="table table-bordered table-hover  mytable"> 
139                         <tr class="odd"> 
140                         <th>Platform</th> 
141                         <th>Account Type</th>
142                                 <th>Account_delegation</th>
143                         <th>user_hrn</th>
144                         <!--<th>Pub Key</th> -->
145                 </tr>   
146                         {% for row in data %}         
147                         <tr class="border_bottom">
148                         <td class="odd"> {{ row.platform_name }} </td>
149                         <td class="odd"> {{ row.account_type }} </td>
150                                 <td class="odd"> {{ row.delegation_type }} </td>
151                         <td class="odd"> {{ row.usr_hrn }}  </td>
152                 <!--    <td class="even"> {{ row.usr_pubkey }} </td> -->
153                 </tr> 
154                         {%endfor%}               
155                 </table>
156         </div>
157 </div>
158
159
160 <h3>Credentials</h3>
161 <div id="middle" align="center">
162     <div class="well">
163         <table class="mytable table table-bordered table-hover">
164                         <caption><b>Delegated User Credential</b></caption> 
165             <tr class="odd"> 
166                 <th>Expiration Date</th>
167                                 <th>Download</th>
168             </tr>
169                         {% for row in my_users %}         
170                         <tr class="border_bottom">
171                         <td class="odd"> {{ row.cred_exp }} </td>
172                                 <td class="odd"><button class="btn btn-default btn-xs" name= "dl_user_cred" type="submit" title="Download User Credential">Download</button></td>
173                         </tr>
174                         {%endfor%}
175                  </table>
176                 <p></p>
177                 <table class="mytable table table-bordered table-hover">
178                         <caption><b>Delegated Slice Credentials</b></caption>  
179                 <tr class="odd"> 
180                                 <th>Slice Name</th> 
181                         <th>Expiration Date</th>
182                                 <th>Download</th>
183                 </tr>
184                         {% for row in my_slices %}     
185                 <tr class="border_bottom">
186                         <td class="odd"> {{ row.slice_name }} </td>
187                                 <td class="odd"> {{ row.cred_exp }} </td>
188                                 <td class="odd"> <button class="btn btn-default btn-xs" name= "dl_slice_cred" type="submit" title="Download Slice Credentials">Download</button> </td>
189                 </tr>
190                 {%endfor%}
191                 </table>
192                 <p></p>
193                 <table class="mytable table table-bordered table-hover">
194                         <caption><b>Delegated Authority Credentials</b></caption>
195                         <tr class="odd"> 
196                         <th>Authority Name</th> 
197                         <th>Expiration Date</th>
198                                 <th>Download</th>
199                         </tr>
200                         {% for row in my_auths %}
201                         <tr class="border_bottom">
202                         <td class="odd"> {{ row.auth_name }} </td>
203                         <td class="odd"> {{ row.cred_exp }} </td>
204                                 <td class="odd"><button class="btn btn-default btn-xs" name= "dl_auth_cred" type="submit" title="Download Authority Credentials">Download</button></td>
205                         </tr>
206                         {%endfor%}
207                 </table>
208                 <p></p> 
209                 <p><button class="btn btn-danger btn-lg btn-block"   name= "clear_cred" type="submit" title="Clear All Credentials">Clear Credentials</button></p>
210     </div>
211 </div>
212
213
214
215
216 <h3>Testbed Accounts <small>User accounts in other testbeds</small></h3>
217 <div id="middle" align="center">
218     <div class="well">
219         <table class="mytable table table-bordered table-hover"> 
220             <tr class="odd"> 
221                 <th>Platform</th> 
222                 <th>Account Type</th>
223                                 <th>Reference to</th>
224                                 <th>Remove Account</th>
225             </tr>   
226             {% for row in ref_acc %}         
227             <tr class="border_bottom">
228                 <td class="odd"> {{ row.platform_name }} </td>
229                 <td class="odd"> {{ row.account_type }} </td>
230                                 <td class="odd"> {{ row.account_reference }} </td>
231                                 <td class="odd">
232                                 <button class="btn btn-danger btn-xs" name="delete_{{row.platform_name}}" type="submit" title="Delete account from this platform">Delete {{row.platform_name}}</button>
233                                 </td>
234             </tr> 
235             {%endfor%}               
236         </table>
237     </div>
238 </div>
239
240 <h3>Add Accounts</h3>
241 <div id="middle" align="center">
242     <div class="well">
243         <table class="mytable table table-bordered table-hover"> 
244             <tr class="odd"> 
245                 <th>Platforms</th> 
246                 <th>Request Access</th>
247             </tr>   
248             {% for platform in platform_list %}         
249             <tr class="border_bottom">
250                 <td class="odd"> {{ platform.platform_no_access }} </td>
251                 <td class="odd">
252                                         <button class="btn btn-default btn-xs" name= "add_{{platform.platform_no_access}}" type="submit" title="Add account to this platform">Add {{platform.platform_no_access}}</button>
253                                 </td>
254             </tr> 
255             {%endfor%}               
256         </table>
257     </div>
258 </div>
259
260 </form>
261
262 {% endblock %}