X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=portal%2Ftemplates%2Fbase.html;h=841dca99c828bc976726e29c78ebee573611aa1d;hb=a52e4ba486797f7569a9d9ac451089e698100fd5;hp=5a1248cdedb548894123e3942abf63b358c1eecd;hpb=10c6c85baaaea942a013ac082527b0b13da86bbe;p=unfold.git
diff --git a/portal/templates/base.html b/portal/templates/base.html
index 5a1248cd..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" %}
+
@@ -76,11 +77,11 @@ $(document).ready(function() {
slices.push("no slice");
}else{
slices = user.slices;
- {% if theme != "fed4fire" %}
+ {% if theme != "fed4fire" or "onelab" in theme %}
drawSlices(slices);
{% endif %}
}
- {% if theme == "fed4fire" %}
+ {% if theme == "fed4fire" or "onelab" in theme%}
p = myslice.get_projects();
if(p != null){
//drawProjects(p);
@@ -91,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( "" ));
@@ -112,13 +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) {
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( "" ) + "
";
}
@@ -126,6 +131,14 @@ $(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();