1 {% extends "layout_wide.html" %}
4 <!-- <script type="text/javascript" src="{{STATIC_URL}}/js/institution.js"></script> -->
8 <div class="container">
10 <div class="col-md-12">
11 <ul class="nav nav-tabs nav-section-mod">
12 <li class="active"><a href="#appservices"> Application Services </a></li>
13 <li><a href="#fedservices"> Federation Services </a></li>
18 <div class="container tab-content">
19 <div class="tab-pane active row" id="appservices">
20 <div class="col-md-12">
21 <div id="appservices-tab-loading"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Services" /></div>
22 <div id="appservices-tab-loaded" style="display:none;">
23 <div class="container" id="appservices-tab">
25 <!-- <table class="table" id="appservices-tab">
32 <th>Brief Description</th>
40 <div class="tab-pane row" id="fedservices" data-authority="{{user_details.parent_authority}}">
41 <div class="col-md-12">
42 <div id="fedservices-tab-loading"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Services" /></div>
43 <div id="fedservices-tab-loaded" style="display:none;">
44 <table class="table" id="fedservices-tab">
47 <th>Brief Description</th>
58 $(document).ready(function() {
62 $('.nav-tabs a').click(function (e) {
65 // id = $(this).attr('href').substr(1);
66 // if (!(id in loadedTabs)) {
70 // loadedTabs[id] = true;
83 url: "{{ servdirurl }}appservices/",
84 success: function(data, status, jqXHR){
86 // $.each(data, function(i, item){
88 // var tr = $('<tr>').append(
89 // $('<td id="name">').text(item.name),
90 // $('<td>').text(item.provider),
91 // $('<td>').append('<a href="' + item.endPoint + '">' + item.endPoint + "</a>"),
92 // $('<td>').text(item.protocol),
93 // $('<td>').text(item.APIBasic),
94 // $('<td>').text(item.briefDescription)
96 // $("#appservices-tab > tbody:last").append(tr);
97 // $("td#name").click(function(){
98 // window.location.href = data.endPoint;
101 function createToggle(name){
103 var el = $('p#expandable-' + name);
104 if(!el.is(':animated')){
110 $.each(data, function(i, item){
113 var row = $('<div class="row">').append(
114 $('<div>').addClass("col-md-3 portfolio-item").append(
115 $('<img>').attr('src', "http://placehold.it/150x150")
117 $('<div>').addClass("col-md-6 portfolio-item").append(
118 $('<p id="name-' + item.name.replace(/ /g,'') + '">').text(item.name),
119 $('<p>').text(item.briefDescription),
120 $('<p>').text("Provider: " + item.provider),
121 $('<p>').append('Endpoint: <a href="' + item.endPoint + '">' + item.endPoint + "</a>"),
122 $('<p id="expandable-' + item.name.replace(/ /g,'') + '">').text(item.fullDescription).hide(),
123 $('<p id="expandable-' + item.name.replace(/ /g,'') + '">').text("Protocol: " + item.protocol).hide(),
124 $('<p id="expandable-' + item.name.replace(/ /g,'') + '">')
125 .append('API documentation: <a href="' + item.APILink + '">' + item.APILink + "</a>").hide(),
126 $('<p id="expandable-' + item.name.replace(/ /g,'') + '">').text(item.APIBasic).hide()
129 $("#appservices-tab").append(row);
130 $('p#name-' + item.name.replace(/ /g,'')).click(createToggle(item.name.replace(/ /g,'')));
134 $("div#appservices-tab-loaded").css("display","block");
135 $("div#appservices-tab-loading").css("display","none");
137 error: function(jqXHR, status){
138 console.log("ERROR: " + status);
146 url: "{{ servdirurl }}fedservices/",
147 success: function(data, status, jqXHR){
148 // console.log(data);
149 $.each(data, function(i, item){
151 var tr = $('<tr>').append(
152 $('<td>').text(item.name),
153 $('<td>').text(item.briefDescription),
154 $('<td>').append('<a href="' + item.endPoint + '">' + item.endPoint + "</a>")
156 $("#fedservices-tab > tbody:last").append(tr);
160 $("div#fedservices-tab-loaded").css("display","block");
161 $("div#fedservices-tab-loading").css("display","none");
163 error: function(jqXHR, status){
164 console.log("ERROR: " + status);
168 // $.post("/rest/authority/",{'filters':{'authority_hrn':'{{user_details.parent_authority}}'}}, function( data ) {
169 // var authority_data = [];
170 // var onelab_data = [];
171 // /* 'city','enabled','legal','longitude','onelab_membership','address','parent_authority','slice','user','country',
172 // 'tech','abbreviated_name','url','postcode','description','scientific','authority_hrn','latitude','name' */
173 // $.each( data, function( key, val ) {
174 // authority_row = "<img src='{{ STATIC_URL }}img/institutions/{{user_details.parent_authority}}.gif' alt='' /><br>";
175 // authority_row += "<br>";
176 // authority_row += "<b>authority:</b> "+val.authority_hrn+"<br>";
177 // authority_data.push(authority_row);
179 // $("div#authority-data").html(authority_data.join( "" ));
180 // $("div#onelab-data").html(onelab_data.join( "" ));
181 // $("div#authority-tab-loaded").css("display","block");
182 // $("div#authority-tab-loading").css("display","none");
185 // $.post("/rest/slice/",{'filters':{'parent_authority':'{{user_details.parent_authority}}'}}, function( data ) {
186 // var list_slices = [];
187 // var table_slices = [];
188 // /* "slice_hrn", "slice_description", "slice_type", "parent_authority", "created", "nodes", "slice_url", "slice_last_updated", "users", "slice_urn", "slice_expires" */
189 // $.each( data, function( key, val ) {
190 // list_slices.push( "<li><a href=\"portal/slice/"+val.slice_hrn+"\">" + val.slice_hrn + "</a></li>" );
191 // if(val.nodes=="undefined" || val.nodes==null){
194 // nodes_length=val.nodes.length;
196 // if(val.users=="undefined" || val.users==null){
199 // users_length=val.users.length;
202 // if(val.slice_url=="undefined" || val.slice_url==null){
205 // slice_url="<a href='"+val.slice_url+"' target='_blank'>"+val.slice_url+"</a>";
208 // slice_row = "<tr id='"+val.slice_hrn+"'>";
209 // slice_row += "<td><input type='checkbox' class='slice' id='"+val.slice_hrn+"'></td>";
210 // slice_row += "<td><a href=\"/slice/"+val.slice_hrn+"\">" + val.slice_hrn + "</a></td>";
211 // slice_row += "<td>"+users_length+"</td>";
212 // slice_row += "<td>"+slice_url+"</td>";
213 // //slice_row += "<td>"+nodes_length+"</td>";
214 // slice_row += "<td>"+val.slice_expires+"</td>";
215 // slice_row += "</tr>";
216 // table_slices.push(slice_row);
220 // /* $("div#slice-list").html($( "<ul/>", { html: list_slices.join( "" ) })); */
221 // $("table#slice-tab tr:last").after(table_slices.join( "" ));
222 // $("div#slice-tab-loaded").css("display","block");
223 // $("div#slice-tab-loading").css("display","none");
226 // $.post("/rest/user/",{'filters':{'parent_authority':'{{user_details.parent_authority}}'}}, function( data ) {
227 // var list_users = [];
228 // var table_users = [];
229 // /* Available fields
230 // user_gid, user_enabled, slices, pi_authorities, keys, parent_authority, user_first_name,
231 // user_urn, user_last_name, user_phone, user_hrn, user_email, user_type
233 // $.each( data, function( key, val ) {
234 // list_users.push( "<li><a href=\"portal/user/"+val.user_email+"\">" + val.user_email + "</a></li>" );
235 // user_row = "<tr id='"+val.user_hrn+"'>";
236 // user_row += "<td><input type='checkbox' class='user' id='"+val.user_hrn+"'></td>";
237 // user_row += "<td>"+val.user_email+"</td>";
238 // user_row += "<td>"+val.user_hrn+"</td>";
239 // user_row += "<td>"+val.user_first_name+"</td>";
240 // user_row += "<td>"+val.user_last_name+"</td>";
241 // user_row += "<td>"+val.user_enabled+"</td>";
242 // user_row += "</tr>";
243 // table_users.push(user_row);
245 // $("table#user-tab tr:last").after(table_users.join( "" ));
246 // $("div#user-tab-loaded").css("display","block");
247 // $("div#user-tab-loading").css("display","none");
252 }); // end document.ready