{% endblock head %}
{% block content %}
+<div class="container">
+ <div class="row">
+ <div class="col-md-12">
+ <div class="breadcrumbs">
+ Management > Institution: <span id="authority_name"></span>
+ </div>
+ </div>
+ </div>
+</div>
<div class="container">
<div class="row">
<div class="col-md-12">
<ul class="nav nav-tabs nav-section">
- <li class="active"><a href="#info"><img src="{{ STATIC_URL }}icons/authority-xs.png" alt="Institution" /> Institution {{user_details.parent_authority}}</a></li>
+ <li class="active"><a href="#info">About</a></li>
<li><a href="#users">Users</a></li>
<li><a href="#slices">Slices</a></li>
+ <li><a href="#requests">Requests</a></li>
</ul>
</div>
</div>
</div>
<div class="container tab-content">
<div class="tab-pane active row" id="info">
- <div class="col-md-12">
+ <div class="col-md-12 el">
<div id="authority-tab-loading"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Authority" /></div>
<div id="authority-tab-loaded" style="display:none;">
<div id="authority-data" style="float:left; width:50%;"></div>
</div>
<div class="tab-pane row" id="users" data-authority="{{user_details.parent_authority}}">
- <div class="col-md-12">
+ <div class="col-md-12 el">
<div id="user-tab-loading"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
<div id="user-tab-loaded" style="display:none;">
- <table id="user-tab">
+ <table id="user-tab" class="table">
<tr>
<th>+/-</th>
- <th>email</th>
- <th>user_hrn</th>
- <th>first name</th>
- <th>last name</th>
- <th>enabled</th>
+ <th>Email</th>
+ <th>User hrn</th>
+ <th>First name</th>
+ <th>Last name</th>
+ <th>Enabled</th>
</tr>
</table>
- {%if 'is_pi' in pi %}
- <div>
- <button id="deleteusers" type="button" class="btn btn-default"><span class="glyphicon glyphicon-remove"></span> Delete Users</button>
- </div>
- {%endif%}
+
+ </div>
+ {%if 'is_pi' in pi %}
+ <div>
+ <button id="deleteusers" type="button" class="btn btn-danger"><span class="glyphicon glyphicon-remove"></span> Delete selected users</button>
</div>
+ {% endif %}
</div>
</div>
<div class="tab-pane row" id="slices">
- {%if 'is_pi' in pi %}
- <button id="createslice" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> create slice</button>
- {%else%}
- <button id="createslice" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> request slice</button>
- {%endif%}
+ <div class="col-md-12 el">
+ {% if 'is_pi' in pi %}
+ <button id="createslice" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Create slice</button>
+ {% else %}
+ <button id="createslice" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Request slice</button>
+ {% endif %}
+ <br /><br />
<div id="slice-tab-loading"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
<div id="slice-tab-loaded" style="display:none;">
- <table id="slice-tab">
+ <table id="slice-tab" class="table">
<tr>
<th>+/-</th>
- <th>slice_hrn</th>
- <th>users</th>
- <th>url</th>
+ <th>Slice hrn</th>
+ <th>Users</th>
+ <th>Url</th>
<!-- <th>nodes</th> -->
- <th>expiration</th>
+ <th>Expiration</th>
</tr>
- </table>
- <br>
- {%if 'is_pi' in pi %}
- <div>
- <button id="renewslices" type="button" class="btn btn-default"><span class="glyphicon glyphicon-refresh"></span> Renew Slices</button>
- <button id="deleteslices" type="button" class="btn btn-default"><span class="glyphicon glyphicon-remove"></span> Delete Slices</button>
- </div>
- {%endif%}
+ </table>
</div>
+ {% if 'is_pi' in pi %}
+ <div>
+ <button id="renewslices" type="button" class="btn btn-primary"><span class="glyphicon glyphicon-refresh"></span> Renew Slices</button>
+ <button id="deleteslices" type="button" class="btn btn-danger"><span class="glyphicon glyphicon-remove"></span> Delete Slices</button>
+ </div>
+ {% endif %}
+ </div>
+ </div>
+ <div class="tab-pane row" id="requests">
</div>
</div>
<script>
{% if user_details.parent_authority %}
$.post("/rest/authority/",{'filters':{'authority_hrn':'{{user_details.parent_authority}}'}}, function( data ) {
+
var authority_data = [];
var onelab_data = [];
/* 'city','enabled','legal','longitude','onelab_membership','address','parent_authority','slice','user','country',
'tech','abbreviated_name','url','postcode','description','scientific','authority_hrn','latitude','name' */
$.each( data, function( key, val ) {
+ $('#authority_name').text(val.name);
authority_row = "<img src='{{ STATIC_URL }}img/institutions/{{user_details.parent_authority}}.gif' alt='' /><br>";
authority_row += "<br>";
authority_row += "<b>authority:</b> "+val.authority_hrn+"<br>";
{% endif %}
}); // End document.ready
+
+$(document).ready(function() {
+ $('.nav-tabs a').click(function (e) {
+ e.preventDefault();
+ $(this).tab('show');
+ var id = $(this).attr('href').substr(1);
+ if (id == 'requests')
+ $("#" + id).load('/management/' + id);
+ });
+ var hash = window.location.hash;
+ if (hash) {
+ $('.nav-tabs a[href='+hash+']').click();
+ }
+});
</script>
{% endblock %}