1 {% extends "layout.html" %}
5 <div class="col-md-12">
6 <h1><img src="{{ STATIC_URL }}icons/users-xs.png" alt="Manage Users" /> Manage Users</h1>
13 {% for message in messages %}
14 <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
20 <ul class="nav nav-tabs">
21 <li class="active"><a class="home-tab" data-panel="user_profile" href="#">User Profile</a></li>
22 <li><a class="home-tab" data-panel="principal_acc" href="#">User Account</a></li>
23 <li><a class="home-tab" data-panel="ref_acc" href="#">Testbed Access</a></li>
25 <div class="home-panel" id="user_profile">
26 <form id="editForm" method="POST" action="{{user_email}}/user_process" enctype="multipart/form-data">
27 <div id="middle" align="center">
30 <table class="profile">
33 <div id="info">Platform: Myslice</div>
37 <td class="key">Email</td>
38 <td class="value"> <span id="emailval" class="value" >{{ user_email }}</span> </td>
41 <td class="key">Full Name</td>
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"/>
51 <button class="btn btn-default btn-xs" type="button"title="Full Name" id="edit_name">
52 <span class="glyphicon glyphicon-edit"></span> Edit
57 <td class="key">Authority</td>
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"/>
66 <button class="btn btn-default btn-xs" type="button"title="auth" id="edit_auth">
67 <span class="glyphicon glyphicon-edit"></span> Edit
72 <td class="key">Generate Keys</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."/>
80 <td class="key">Public Key</td>
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.');"/>
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
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
106 <div class="home-panel" id="principal_acc" style="display:none;">
109 <h3>Principal Account <small>Account used for delegating credentials</small></h3>
111 <table class="table table-bordered table-hover mytable">
114 <th>Account Type</th>
115 <th>Account Delegation</th>
118 <!--<th>Pub Key</th> -->
120 {% for row in principal_acc %}
121 <tr class="border_bottom">
122 <td class="odd"> {{ row.platform_name }} </td>
123 <td class="odd"> {{ row.account_type }} </td>
124 <td class="odd"> {{ row.delegation_type }} </td>
125 <td class="odd"> {{ row.usr_hrn }} </td>
126 <td class="odd"> {{ row.user_status }} </td>
127 <!-- <td class="even"> {{ row.usr_pubkey }} </td> -->
135 {%if 'Enabled' in user_status %}
137 <h3>Credentials <small>Delegated to Principal Account</small></h3>
138 <table class="mytable table table-bordered table-hover">
139 <caption><b>Delegated User Credential</b></caption>
141 <th>Expiration Date</th>
144 {% for row in my_users %}
145 <tr class="border_bottom">
146 <td class="odd"> {{ row.cred_exp }} </td>
148 <button class="btn btn-default btn-xs" name= "dl_user_cred" type="submit" title="Download User Credential">
149 <span class="glyphicon glyphicon-download"></span> Download
156 <table class="mytable table table-bordered table-hover">
157 <caption><b>Delegated Slice Credentials</b></caption>
160 <th>Expiration Date</th>
163 {% for row in my_slices %}
164 <tr class="border_bottom">
165 <td class="odd"> {{ row.slice_name }} </td>
166 <td class="odd"> {{ row.cred_exp }} </td>
168 <button class="btn btn-default btn-xs" name= "dl_{{row.slice_name}}" type="submit" title="Download Slice Credentials">
169 <span class="glyphicon glyphicon-download"></span> Download
176 <table class="mytable table table-bordered table-hover">
177 <caption><b>Delegated Authority Credentials</b></caption>
179 <th>Authority Name</th>
180 <th>Expiration Date</th>
183 {% for row in my_auths %}
184 <tr class="border_bottom">
185 <td class="odd"> {{ row.auth_name }} </td>
186 <td class="odd"> {{ row.cred_exp }} </td>
188 <button class="btn btn-default btn-xs" name= "dl_{{row.auth_name}}" type="submit" title="Download Authority Credentials">
189 <span class="glyphicon glyphicon-download"></span> Download
196 {%if '' not in my_users%}
197 <p><button class="btn btn-danger btn-lg btn-block" name= "clear_cred" type="submit" title="Clear All Credentials">Clear Credentials</button></p>
199 <p><button class="btn btn-danger btn-lg btn-block disabled" name= "clear_cred" type="submit" title="Clear All Credentials">Clear Credentials</button></p>
205 <div class="home-panel" id="ref_acc" style="display:none;">
206 <h3>Testbed Access <small>Reference Accounts in the following testbeds</small></h3>
207 <table class="mytable table table-bordered table-hover">
210 <th>Account Type</th>
211 <th>Reference to</th>
212 <th>Remove Account</th>
214 {% for row in ref_acc %}
215 <tr class="border_bottom">
216 <td class="odd"> {{ row.platform_name }} </td>
217 <td class="odd"> {{ row.account_type }} </td>
218 <td class="odd"> {{ row.account_reference }} </td>
220 <button class="btn btn-danger btn-xs" name="delete_{{row.platform_name}}" type="submit" title="Delete account from this platform">
221 <span class="glyphicon glyphicon-minus"></span>
229 <h3>Add reference account to the following testbeds</h3>
231 <table class="mytable table table-bordered table-hover">
236 {% for platform in platform_list %}
237 <tr class="border_bottom">
238 <td class="odd"> {{ platform.platform_no_access }} </td>
240 <button class="btn btn-success btn-sm" name= "add_{{platform.platform_no_access}}" type="submit" title="Add account to this platform">
241 <span class="glyphicon glyphicon-plus"></span>
255 $(document).ready(function() {
256 $('a.home-tab').click(function() {
257 $('ul.nav-tabs li').removeClass('active');
258 $(this).parent().addClass('active');
259 $('div.home-panel').hide();
260 $('div#'+$(this).data('panel')).show();
262 $('button#createslice').click(function() {
263 window.location="/portal/slice_request/";
265 ;$('button#slicerequestbtn').click(function() {
267 window.location="/portal/slice_request/";