From ba5bd31c6e9b4b0b4b54659ea6a1147f62d9bf46 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jordan=20Aug=C3=A9?= Date: Wed, 26 Feb 2014 17:27:20 +0100 Subject: [PATCH] Instituiton - list of slices - ple.upmc hardcoded --- portal/templates/institution.html | 81 ++++++++++++++++++++++--------- rest/__init__.py | 2 +- 2 files changed, 59 insertions(+), 24 deletions(-) diff --git a/portal/templates/institution.html b/portal/templates/institution.html index 0f68468e..44aa55d9 100644 --- a/portal/templates/institution.html +++ b/portal/templates/institution.html @@ -69,29 +69,22 @@ @@ -111,6 +104,48 @@ window.location="/portal/slice_request/"; */ }); + {% if person %} + $.getJSON("/rest/slice/", function( data ) { + var list_slices = []; + var table_slices = []; + /* "slice_hrn", "slice_description", "slice_type", "parent_authority", "created", "nodes", "slice_url", "slice_last_updated", "user", "slice_urn", "slice_expires" */ + $.each( data, function( key, val ) { + list_slices.push( "
  • " + val.slice_hrn + "
  • " ); + if(val.nodes=="undefined" || val.nodes==null){ + nodes_length=0; + }else{ + nodes_length=val.nodes.length; + } + + if(val.user=="undefined" || val.user==null){ + user_length=0; + }else{ + user_length=val.user.length; + } + + if(val.slice_url=="undefined" || val.slice_url==null){ + slice_url=""; + }else{ + slice_url=""+val.slice_url+""; + } + + slice_row = ""; + slice_row += ""; + slice_row += "" + val.slice_hrn + ""; + slice_row += ""+user_length+""; + slice_row += ""+slice_url+""; + slice_row += ""+nodes_length+""; + slice_row += ""+val.slice_expires+""; + table_slices.push(slice_row); + + }); + + /* $("div#slice-list").html($( "