X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=portal%2Ftemplates%2Fbase.html;h=841dca99c828bc976726e29c78ebee573611aa1d;hb=a52e4ba486797f7569a9d9ac451089e698100fd5;hp=fd1869ee9239d8c51702f5230de6941b584e228c;hpb=a61c68825e91ea92162c737ffa6a7c2f2fcde78d;p=unfold.git
diff --git a/portal/templates/base.html b/portal/templates/base.html
index fd1869ee..841dca99 100644
--- a/portal/templates/base.html
+++ b/portal/templates/base.html
@@ -55,6 +55,7 @@
{% insert_str prelude "css/topmenu.css" %}
{% insert_str prelude "js/logout.js" %}
+
@@ -66,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)){
@@ -76,12 +77,14 @@ $(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 %}
@@ -89,20 +92,20 @@ $(document).ready(function() {
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( "" ));
@@ -110,14 +113,17 @@ $(document).ready(function() {
function drawProjectsTree(projects,slices) {
var items = [];
var items_sl = [];
+ var slices_no_project = [];
$.each( projects, function(i, p) {
$.each( slices, function(y, s) {
- console.log(escapeRegExp(p));
if (s.match('^' + escapeRegExp(p))) {
- items_sl.push( "" + s.replace(p + '.','') + "" );
+ slicename = s.replace(p + '.','')
+ items_sl.push( " " + slicename + "" );
+ }else{
+ slices_no_project.push( " " + s + "" );
}
});
- el = "" + p + "";
+ el = "" + p + "";
if (items_sl.length > 0) {
el += "" + items_sl.join( "" ) + "
";
}
@@ -125,8 +131,23 @@ $(document).ready(function() {
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();