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){
114 if(item.name.toLowerCase().indexOf("santander") >= 0){
115 imgsrc = "smartsantander.png";
116 } else if(item.name.toLowerCase().indexOf("hadoop") >= 0){
117 imgsrc = "hadoop.png";
120 var row = $('<div class="row">').append(
121 $('<div>').addClass("col-md-3 portfolio-item").append(
122 $('<img>').attr('src', "{{ STATIC_URL }}img/servicedirectory/" + imgsrc)
124 $('<div>').addClass("col-md-6 portfolio-item").append(
125 $('<p id="name-' + item.name.replace(/ /g,'') + '">').text(item.name),
126 $('<p>').text(item.briefDescription),
127 $('<p>').text("Provider: " + item.provider),
128 $('<p>').append('Endpoint: <a href="' + item.endPoint + '">' + item.endPoint + "</a>"),
129 $('<p id="expandable-' + item.name.replace(/ /g,'') + '">').text(item.fullDescription).hide(),
130 $('<p id="expandable-' + item.name.replace(/ /g,'') + '">').text("Protocol: " + item.protocol).hide(),
131 $('<p id="expandable-' + item.name.replace(/ /g,'') + '">')
132 .append('API documentation: <a href="' + item.APILink + '">' + item.APILink + "</a>").hide(),
133 $('<p id="expandable-' + item.name.replace(/ /g,'') + '">').text(item.APIBasic).hide()
136 $("#appservices-tab").append(row);
137 $('p#name-' + item.name.replace(/ /g,'')).click(createToggle(item.name.replace(/ /g,'')));
141 $("div#appservices-tab-loaded").css("display","block");
142 $("div#appservices-tab-loading").css("display","none");
144 error: function(jqXHR, status){
145 console.log("ERROR: " + status);
153 url: "{{ servdirurl }}fedservices/",
154 success: function(data, status, jqXHR){
155 // console.log(data);
156 $.each(data, function(i, item){
158 var tr = $('<tr>').append(
159 $('<td>').text(item.name),
160 $('<td>').text(item.briefDescription),
161 $('<td>').append('<a href="' + item.endPoint + '">' + item.endPoint + "</a>")
163 $("#fedservices-tab > tbody:last").append(tr);
167 $("div#fedservices-tab-loaded").css("display","block");
168 $("div#fedservices-tab-loading").css("display","none");
170 error: function(jqXHR, status){
171 console.log("ERROR: " + status);
175 // $.post("/rest/authority/",{'filters':{'authority_hrn':'{{user_details.parent_authority}}'}}, function( data ) {
176 // var authority_data = [];
177 // var onelab_data = [];
178 // /* 'city','enabled','legal','longitude','onelab_membership','address','parent_authority','slice','user','country',
179 // 'tech','abbreviated_name','url','postcode','description','scientific','authority_hrn','latitude','name' */
180 // $.each( data, function( key, val ) {
181 // authority_row = "<img src='{{ STATIC_URL }}img/institutions/{{user_details.parent_authority}}.gif' alt='' /><br>";
182 // authority_row += "<br>";
183 // authority_row += "<b>authority:</b> "+val.authority_hrn+"<br>";
184 // authority_data.push(authority_row);
186 // $("div#authority-data").html(authority_data.join( "" ));
187 // $("div#onelab-data").html(onelab_data.join( "" ));
188 // $("div#authority-tab-loaded").css("display","block");
189 // $("div#authority-tab-loading").css("display","none");
192 // $.post("/rest/slice/",{'filters':{'parent_authority':'{{user_details.parent_authority}}'}}, function( data ) {
193 // var list_slices = [];
194 // var table_slices = [];
195 // /* "slice_hrn", "slice_description", "slice_type", "parent_authority", "created", "nodes", "slice_url", "slice_last_updated", "users", "slice_urn", "slice_expires" */
196 // $.each( data, function( key, val ) {
197 // list_slices.push( "<li><a href=\"portal/slice/"+val.slice_hrn+"\">" + val.slice_hrn + "</a></li>" );
198 // if(val.nodes=="undefined" || val.nodes==null){
201 // nodes_length=val.nodes.length;
203 // if(val.users=="undefined" || val.users==null){
206 // users_length=val.users.length;
209 // if(val.slice_url=="undefined" || val.slice_url==null){
212 // slice_url="<a href='"+val.slice_url+"' target='_blank'>"+val.slice_url+"</a>";
215 // slice_row = "<tr id='"+val.slice_hrn+"'>";
216 // slice_row += "<td><input type='checkbox' class='slice' id='"+val.slice_hrn+"'></td>";
217 // slice_row += "<td><a href=\"/slice/"+val.slice_hrn+"\">" + val.slice_hrn + "</a></td>";
218 // slice_row += "<td>"+users_length+"</td>";
219 // slice_row += "<td>"+slice_url+"</td>";
220 // //slice_row += "<td>"+nodes_length+"</td>";
221 // slice_row += "<td>"+val.slice_expires+"</td>";
222 // slice_row += "</tr>";
223 // table_slices.push(slice_row);
227 // /* $("div#slice-list").html($( "<ul/>", { html: list_slices.join( "" ) })); */
228 // $("table#slice-tab tr:last").after(table_slices.join( "" ));
229 // $("div#slice-tab-loaded").css("display","block");
230 // $("div#slice-tab-loading").css("display","none");
233 // $.post("/rest/user/",{'filters':{'parent_authority':'{{user_details.parent_authority}}'}}, function( data ) {
234 // var list_users = [];
235 // var table_users = [];
236 // /* Available fields
237 // user_gid, user_enabled, slices, pi_authorities, keys, parent_authority, user_first_name,
238 // user_urn, user_last_name, user_phone, user_hrn, user_email, user_type
240 // $.each( data, function( key, val ) {
241 // list_users.push( "<li><a href=\"portal/user/"+val.user_email+"\">" + val.user_email + "</a></li>" );
242 // user_row = "<tr id='"+val.user_hrn+"'>";
243 // user_row += "<td><input type='checkbox' class='user' id='"+val.user_hrn+"'></td>";
244 // user_row += "<td>"+val.user_email+"</td>";
245 // user_row += "<td>"+val.user_hrn+"</td>";
246 // user_row += "<td>"+val.user_first_name+"</td>";
247 // user_row += "<td>"+val.user_last_name+"</td>";
248 // user_row += "<td>"+val.user_enabled+"</td>";
249 // user_row += "</tr>";
250 // table_users.push(user_row);
252 // $("table#user-tab tr:last").after(table_users.join( "" ));
253 // $("div#user-tab-loaded").css("display","block");
254 // $("div#user-tab-loading").css("display","none");
259 }); // end document.ready