1 {% extends "layout-unfold1.html" %}
2 {% block unfold_main %}
7 {% for message in messages %}
8 <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
13 <div class="wrapper" id="institution">
14 <ul class="nav nav-tabs">
15 <li class="active"><a class="home-tab" data-panel="user_profile" href="#">User Profile</a></li>
16 <li><a class="home-tab" data-panel="principal_acc" href="#">User Account</a></li>
17 <li><a class="home-tab" data-panel="ref_acc" href="#">Testbed Access</a></li>
19 <div class="home-panel" id="user_profile">
21 <form id="editForm" method="POST" action="account_process" enctype="multipart/form-data">
22 <div id="middle" align="center">
25 <table class="profile">
28 <div id="info">Platform: Myslice</div>
32 <td class="key">Email</td>
34 <span id="emailval" class="value" >{{ person.email }}</span>
35 <button class="btn btn-default btn-xs" type="button" id="edit_email" onclick="editAlert()" title="To change your affiliation please contact the administrator">
36 <span class="glyphicon glyphicon-question-sign"></span> Edit
41 <td class="key">Password</td>
43 <button class="btn btn-default btn-xs" type="button" title="Password" name="edit_pass" id="edit_pass">
44 <span class="glyphicon glyphicon-edit"></span> Edit
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">
53 <td>Enter password: </td>
54 <td class="field"> <input type="password" name="password" id="password" /> </td>
57 <td>Confirm password: </td>
59 <input type="password" name="confirmpassword" id="confirmpassword" />
60 <input type="submit" class="btn btn-default btn-xs" name="submit_pass" value="Save"/>
68 <td class="key">Full Name</td>
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"/>
78 <button class="btn btn-default btn-xs" type="button"title="Full Name" id="edit_name">
79 <span class="glyphicon glyphicon-edit"></span> Edit
84 <td class="key">Authority</td>
86 <span id="affval" class="value">{{ authority }}</span>
87 <button class="btn btn-default btn-xs" type="button" id="edit_auth" onclick="editAlert()" title="To change your authority please contact the administrator">
88 <span class="glyphicon glyphicon-question-sign"></span> Edit
93 <td class="key">Generate Keys</td>
95 <input type="submit" name="generate" class="btn btn-danger btn-xs" value="Generate a new Key Pair" id="generate_keypair"
96 onclick="return confirm('Are you sure? If you do so, your current credentials will be overwritten.');"
97 title="It will generate a new key Pair and your current credentials will be overwritten."/>
101 <td class="key">Public Key</td>
103 <span id="keyval" class="value">******** </span>
104 <span class="hide_this" id="span_upload">
105 <button type="button" class="btn btn-default btn-xs" title="Cancel" id="cancel_upload"> Cancel </button>
106 <div style='display:none;'>
107 <input type='hidden' name='upload' /></div>
108 <input type="file" name="pubkey" class="required" id="pubkey"/>
109 <input class="btn btn-default btn-xs" name="upload_key" id="upload_key" type="submit" title="Upload your public key" value="Upload"
110 onclick="return confirm('Are you sure? It will overwrite your current credentials and you have delegate it manually.');"/>
112 <div style='display:none;'> <input type='hidden' name='dload' /> </div>
113 <button type="submit" name="dl_pubkey" class="btn btn-default btn-xs" title="Download your public key" id="dl_file">
114 <span class="glyphicon glyphicon-download"></span> Download
116 <button class="btn btn-default btn-xs" id="upload_file" type="button" title="Upload a public key">
117 <span class="glyphicon glyphicon-upload"></span> Upload
121 <tr class="even" id="pkey_row">
122 {%if 'N/A' not in user_private_key%}
123 <td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform -->
124 <td class="value">********<a href="#">
125 <button type="submit" name="dl_pkey" class="btn btn-default btn-xs" title="Download your privaye key" id="dl_pkey">
126 <span class="glyphicon glyphicon-download"></span> Download
128 <input class="btn btn-danger btn-xs" id="delete" name="delete" type="submit" value="Delete" title="Delete your private key"
129 onclick="return confirm('Are you sure? If you do so, you have to delegate your credentials manually.');"/>
132 <td class="key">Private Key </td> <!-- Hide if priv_key doesn't exist in myslice platform -->
133 <td class="value">********<a href="#">
134 <button type="submit" name="dl_pkey" class="btn btn-default btn-xs disabled" title="Download your privaye key" id="dl_pkey">
135 <span class="glyphicon glyphicon-download"></span> Download
137 <input class="btn btn-danger btn-xs disabled" id="delete" name="delete" type="submit" title="Delete your private key"
144 <p class="message" id="pkey_del_msg"><b> Tradeoff:</b> Ease-of-use vs Security.<br>
145 <b>Ease-of-use:</b> Automatic account delegation. Don't delete private key.<br>
146 <b>Security:</b> Manual account delegation. Download & Delete private key.
155 <div class="home-panel" id="principal_acc" style="display:none;">
157 <h3>Principal Account <small>Account used for delegating credentials</small></h3>
158 <div id="middle" align="center">
160 <table class="table table-bordered table-hover mytable">
163 <th>Account Type</th>
164 <th>Account Delegation</th>
167 <!--<th>Pub Key</th> -->
169 {% for row in principal_acc %}
170 <tr class="border_bottom">
171 <td class="odd"> {{ row.platform_name }} </td>
172 <td class="odd"> {{ row.account_type }} </td>
173 <td class="odd"> {{ row.delegation_type }} </td>
174 <td class="odd"> {{ row.usr_hrn }} </td>
175 <td class="odd"> {{ row.user_status }} </td>
176 <!-- <td class="even"> {{ row.usr_pubkey }} </td> -->
185 {%if 'Enabled' in user_status %}
186 <h3>Credentials <small>Delegated to Principal Account</small></h3>
187 <div id="middle" align="center">
189 <table class="mytable table table-bordered table-hover">
190 <caption><b>Delegated User Credential</b></caption>
192 <th>Expiration Date</th>
195 {% for row in my_users %}
196 <tr class="border_bottom">
197 <td class="odd"> {{ row.cred_exp }} </td>
199 <button class="btn btn-default btn-xs" name= "dl_user_cred" type="submit" title="Download User Credential">
200 <span class="glyphicon glyphicon-download"></span> Download
207 <table class="mytable table table-bordered table-hover">
208 <caption><b>Delegated Slice Credentials</b></caption>
211 <th>Expiration Date</th>
214 {% for row in my_slices %}
215 <tr class="border_bottom">
216 <td class="odd"> {{ row.slice_name }} </td>
217 <td class="odd"> {{ row.cred_exp }} </td>
219 <button class="btn btn-default btn-xs" name= "dl_{{row.slice_name}}" type="submit" title="Download Slice Credentials">
220 <span class="glyphicon glyphicon-download"></span> Download
227 <table class="mytable table table-bordered table-hover">
228 <caption><b>Delegated Authority Credentials</b></caption>
230 <th>Authority Name</th>
231 <th>Expiration Date</th>
234 {% for row in my_auths %}
235 <tr class="border_bottom">
236 <td class="odd"> {{ row.auth_name }} </td>
237 <td class="odd"> {{ row.cred_exp }} </td>
239 <button class="btn btn-default btn-xs" name= "dl_{{row.auth_name}}" type="submit" title="Download Authority Credentials">
240 <span class="glyphicon glyphicon-download"></span> Download
247 {%if '' not in my_users%}
248 <p><button class="btn btn-danger btn-lg btn-block" name= "clear_cred" type="submit" title="Clear All Credentials">Clear Credentials</button></p>
250 <p><button class="btn btn-danger btn-lg btn-block disabled" name= "clear_cred" type="submit" title="Clear All Credentials">Clear Credentials</button></p>
257 <div class="home-panel" id="ref_acc" style="display:none;">
258 <h3>Testbed Access <small>Reference Accounts in the following testbeds</small></h3>
259 <div id="middle" align="center">
261 <table class="mytable table table-bordered table-hover">
264 <th>Account Type</th>
265 <th>Reference to</th>
266 <th>Remove Account</th>
268 {% for row in ref_acc %}
269 <tr class="border_bottom">
270 <td class="odd"> {{ row.platform_name }} </td>
271 <td class="odd"> {{ row.account_type }} </td>
272 <td class="odd"> {{ row.account_reference }} </td>
274 <button class="btn btn-danger btn-xs" name="delete_{{row.platform_name}}" type="submit" title="Delete account from this platform">
275 <span class="glyphicon glyphicon-minus"></span>
286 <h3>Add reference account to the following testbeds</h3>
287 <div id="middle" align="center">
289 <table class="mytable table table-bordered table-hover">
294 {% for platform in platform_list %}
295 <tr class="border_bottom">
296 <td class="odd"> {{ platform.platform_no_access }} </td>
298 <button class="btn btn-success btn-sm" name= "add_{{platform.platform_no_access}}" type="submit" title="Add account to this platform">
299 <span class="glyphicon glyphicon-plus"></span>
314 $(document).ready(function() {
315 $('a.home-tab').click(function() {
316 $('ul.nav-tabs li').removeClass('active');
317 $(this).parent().addClass('active');
318 $('div.home-panel').hide();
319 $('div#'+$(this).data('panel')).show();
321 $('button#createslice').click(function() {
322 window.location="/portal/slice_request/";
324 ;$('button#slicerequestbtn').click(function() {
326 window.location="/portal/slice_request/";