X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=portal%2Ftemplates%2Fbase.html;h=8fbc2bbfd6ac55dc01bb2a842c890c312fb12dfe;hb=225a0f7799c43d63e04ec5639f14690bc941b5b2;hp=5989508a39d52aba756e5b1b578803be00187b05;hpb=9d4a0883ee7e5bc5cf5b990c400ddf573ef9937c;p=unfold.git diff --git a/portal/templates/base.html b/portal/templates/base.html index 5989508a..8fbc2bbf 100644 --- a/portal/templates/base.html +++ b/portal/templates/base.html @@ -1,37 +1,61 @@ {% 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' %} + - + + + + + + {{ 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" %} {% insert_str prelude "js/messages-runtime.js" %} {% insert_str prelude "js/class.js" %} {% insert_str prelude "js/plugin-helper.js" %} {% insert_str prelude "js/mustache.js" %} +{% insert_str prelude "js/hashtable.js" %} {% insert_str prelude "js/plugin.js" %} {% insert_str prelude "js/manifold.js" %} {% insert_str prelude "css/manifold.css" %} {% insert_str prelude "css/plugin.css" %} {% insert_str prelude "js/bootstrap.js" %} {% insert_str prelude "css/bootstrap.css" %} +{% insert_str prelude "js/bootstrap-datepicker.js" %} +{% insert_str prelude "css/datepicker.css" %} +{% insert_str prelude "js/bootstrap-slider.js" %} +{% insert_str prelude "css/slider.css" %} {% insert_str prelude "css/topmenu.css" %} {% insert_str prelude "js/logout.js" %} + @@ -41,49 +65,100 @@ 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(); + + 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; + {% if theme != "fed4fire" or "onelab" in theme %} + drawSlices(slices); + {% endif %} + } + {% if theme == "fed4fire" or "onelab" in theme%} + p = myslice.get_projects(); + if(p != null){ + //drawProjects(p); + drawProjectsTree(p,slices); + } + {% endif %} + }); - 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); - } function drawSlices(slices){ var items = []; $.each( slices, function(i, val) { - items.push( "
  • " + val + "
  • " ); + items.push( "
  • " + val + "
  • " ); }); $("div#home-slice-list").html($( "