X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=portal%2Ftemplates%2Fbase.html;h=08b910d23a223a507e71cecd75e7d61f4f1147fd;hb=3a35ca5961754c1a0b8cbdd7aa717dcd837f3a43;hp=4760849629b1b4b766baeb9d8b038242233da580;hpb=d0bb04b0886c2a2395c14aa7b2b30f58227f00c7;p=unfold.git
diff --git a/portal/templates/base.html b/portal/templates/base.html
index 47608496..08b910d2 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,7 +77,7 @@ $(document).ready(function() {
slices.push("no slice");
}else{
slices = user.slices;
- {% if theme != "fed4fire" or "onelab" in theme %}
+ {% if theme != "fed4fire" or "onelab" in theme %}
drawSlices(slices);
{% endif %}
}
@@ -91,7 +92,7 @@ $(document).ready(function() {
function drawSlices(slices){
var items = [];
-
+ console.log(slices);
$.each( slices, function(i, val) {
items.push( "
" + val + "" );
});
@@ -112,11 +113,14 @@ $(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))) {
- slicename = s.replace(p + '.','')
- items_sl.push( "
" + slicename + "" );
+ slicename = s.replace(p + '.','')
+ items_sl.push( "
" + slicename + "" );
+ }else if(s.split('.').length < 4){
+ slices_no_project.push( "
" + s + "" );
}
});
el = "" + p + "";
@@ -127,6 +131,18 @@ $(document).ready(function() {
items.push(el);
items_sl = [];
});
+ if (projects.length == 0){
+ $.each( slices, function(y, s) {
+ slices_no_project.push( "
" + s + "" );
+ });
+ }
+ if (slices_no_project.length > 0) {
+ elm = 'other slices ';
+ 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();