X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=portal%2Ftemplates%2Fbase.html;h=8bc204ac736c8d13ecf2d58f542db5446cdda9eb;hb=02a8b0acf7a47f0cb740239d0a035a4e53f1af19;hp=9bc52dd1264ed28f021eb0382d64c1df2e3ccc2a;hpb=472a1ed07124ac7df43c71024c17ec72362486d8;p=unfold.git diff --git a/portal/templates/base.html b/portal/templates/base.html index 9bc52dd1..8bc204ac 100644 --- a/portal/templates/base.html +++ b/portal/templates/base.html @@ -1,9 +1,19 @@ {% load portal_filters %} {# This is required by insert_above #}{% insert_handler %} - + + {{theme}} portal - {{ section }} - + + +{% if theme == "fed4fire" %} + +{% elif theme == "smartfire" %} + +{% else %} + +{% endif %} + {# This is where insert_str will end up #}{% media_container prelude %} {% include 'messages-transient-header.html' %} @@ -11,13 +21,19 @@ - + + + + + + {{ header_prelude }} {% block head %} {% endblock head %} {# let's add these ones no matter what #} +{#NOTE: DO NOT ADD JQUERY-UI JS & CSS HERE. IT BREAKS THE RESOURCE BROWSING PAGE -- DETAILS WITH JORDAN AUGE#} {% insert_str prelude "js/jquery.min.js" %} {% insert_str prelude "js/angular/angular.min.js" %} {% insert_str prelude "js/jquery.html5storage.min.js" %} @@ -38,6 +54,7 @@ {% insert_str prelude "css/slider.css" %} {% insert_str prelude "css/topmenu.css" %} {% insert_str prelude "js/logout.js" %} + @@ -48,53 +65,96 @@ XXX TODO: session This list of slices should go into SESSION ! */ $(document).ready(function() { - {% if username %} - myslice.login(); +{% if username %} + myslice.login(function(){ + user = myslice.get_user(); - user = myslice.user(); - - var slices = []; - if($.isEmptyObject(user)){ - $.post("/rest/user/",{'filters':{'user_hrn':'$user_hrn'}}, function( data ) { - if(data.length > 0){ - drawSlices(data[0].slices); - }else{ - $("div#home-slice-list").html( - "
You do not yet have a slice
"); - $("ul#dropdown-slice-list").append("
  • no slice
  • "); - slices.push("no slice"); - } - }); - }else{ - slices = user.slices; - drawSlices(slices); - } + var slices = []; + if($.isEmptyObject(user)){ + $("div#home-slice-list").html( + "
    You do not yet have a slice
    "); + $("ul#dropdown-slice-list").append("
  • no slice
  • "); + slices.push("no slice"); + }else{ + slices = user.slices; + } + p = myslice.get_projects(); + if(p != null){ + //drawProjects(p); + drawProjectsTree(p,slices); + } + }); - /* - Launch queries to get the resources and leases in Manifold Cache - */ - function drawSlices(slices){ var items = []; - + console.log(slices); $.each( slices, function(i, val) { - items.push( "
  • " + val + "
  • " ); - /* - // Launch a Query for each slice to get resources and leases in Manifold Cache - // Now only done in Homeview to speed up the other pages - $.post("/rest/slice/", { 'filters': { 'slice_hrn' : val } }, function(data) { - }); - */ + items.push( "
  • " + val + "
  • " ); }); $("div#home-slice-list").html($( "