- $(document).ready(function() {
- $('a.home-tab').click(function() {
- $('ul.nav-tabs li').removeClass('active');
- $(this).parent().addClass('active');
- $('div.home-panel').hide();
- $('div#'+$(this).data('panel')).show();
- });
- var url = window.location;
- if(url.hash) {
- // Fragment exists
- tab = url.href.split("#")[1];
- tab_exists = $('div#'+tab).length;
- if (tab_exists) {
- $('ul.nav-tabs li').removeClass('active');
- $('li#'+tab+'-tab').addClass('active');
- $('div.home-panel').hide();
- $('div#'+tab).show();
- }
- }
- $('button#createslice').click(function() {
- window.location="/portal/slice_request/";
- })
- ;$('button#slicerequestbtn').click(function() {
- /*
- window.location="/portal/slice_request/";
- */
- });
- {% if person %}
- {% 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_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>";
- authority_row += "<br>";
- authority_row += "<b>"+val.name+"</b><br>";
- authority_row += "<br>";
- authority_row += "<b>Address:</b> "+val.address+"<br>";
- authority_row += "<b>City:</b> "+val.postcode+" "+val.city+"<br>";
- authority_row += "<br>";
- authority_row += "<b>Country:</b> "+val.country+"<br>";
- authority_row += "<br>";
- authority_row += "<br>";
- authority_row += "<h2>Contacts</h2>";
- authority_row += "<b>Legal:</b> ";
- /*