X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=portal%2Ftemplates%2Fbase.html;h=841dca99c828bc976726e29c78ebee573611aa1d;hb=a52e4ba486797f7569a9d9ac451089e698100fd5;hp=9c6eb1b2cbd11adf1c27be54a308342e6da8c981;hpb=97ec2a5ee64f66b19f3a40e10af824f2108eeb64;p=unfold.git
diff --git a/portal/templates/base.html b/portal/templates/base.html
index 9c6eb1b2..841dca99 100644
--- a/portal/templates/base.html
+++ b/portal/templates/base.html
@@ -1,6 +1,7 @@
{% load portal_filters %}
{# This is required by insert_above #}{% insert_handler %}
-
+
+
{{theme}} portal - {{ section }}
@@ -20,9 +21,14 @@
-
+
+
+
+
+
+
{{ header_prelude }}
{% block head %} {% endblock head %}
@@ -49,6 +55,7 @@
{% insert_str prelude "css/topmenu.css" %}
{% insert_str prelude "js/logout.js" %}
+
@@ -60,7 +67,7 @@ This list of slices should go into SESSION !
$(document).ready(function() {
{% if username %}
myslice.login(function(){
- user = myslice.user();
+ user = myslice.get_user();
var slices = [];
if($.isEmptyObject(user)){
@@ -70,36 +77,77 @@ $(document).ready(function() {
slices.push("no slice");
}else{
slices = user.slices;
+ {% if theme != "fed4fire" or "onelab" in theme %}
drawSlices(slices);
+ {% endif %}
}
- {% if theme == "fed4fire" %}
- p = myslice.projects();
+ {% if theme == "fed4fire" or "onelab" in theme%}
+ p = myslice.get_projects();
if(p != null){
- drawProjects(p);
+ //drawProjects(p);
+ drawProjectsTree(p,slices);
}
{% endif %}
});
function drawSlices(slices){
var items = [];
-
+ console.log(slices);
$.each( slices, function(i, val) {
- items.push( "" + val + "" );
+ items.push( "" + val + "" );
});
$("div#home-slice-list").html($( "", { html: items.join( "" ) }));
$("ul#dropdown-slice-list").append(items.join( "" ));
}
- {% if theme == "fed4fire" %}
+ {% if theme == "fed4fire" or "onelab" in theme%}
function drawProjects(projects){
var items = [];
$.each( projects, function(i, val) {
- items.push( "" + val + "" );
+ items.push( "" + val + "" );
});
$("div#home-project-list").html($( "", { html: items.join( "" ) }));
$("ul#dropdown-project-list").append(items.join( "" ));
}
+ function drawProjectsTree(projects,slices) {
+ var items = [];
+ var items_sl = [];
+ var slices_no_project = [];
+ $.each( projects, function(i, p) {
+ $.each( slices, function(y, s) {
+ if (s.match('^' + escapeRegExp(p))) {
+ slicename = s.replace(p + '.','')
+ items_sl.push( " " + slicename + "" );
+ }else{
+ slices_no_project.push( " " + s + "" );
+ }
+ });
+ el = "" + p + "";
+ if (items_sl.length > 0) {
+ el += "" + items_sl.join( "" ) + "
";
+ }
+ el += "";
+ items.push(el);
+ items_sl = [];
+ });
+
+ elm = 'other slices ';
+ if (slices_no_project.length > 0) {
+ elm += "" + slices_no_project.join( "" ) + "
";
+ }
+ elm += "";
+ items.push(elm);
+
+ $("div#home-project-tree").html($( "", { html: items.join( "" ) }));
+ if (projects.length > 0) {
+ $('.dashboard-create-slice').show();
+ }
+ }
+
+ window.setTimeout(function() {
+ $('.projects-loading').hide();
+ },20000);
{% endif %}
{% endif %}
jQuery('[title!=""]').qtip();