Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into onelab
[myslice.git] / portal / templates / base.html
index ceebc5d..347fe99 100644 (file)
@@ -77,17 +77,12 @@ $(document).ready(function() {
             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 %}
     });
 
     function drawSlices(slices){
@@ -100,7 +95,6 @@ $(document).ready(function() {
         $("ul#dropdown-slice-list").append(items.join( "" ));
     }
     
-    {% if theme == "fed4fire" or "onelab" in theme%}
     function drawProjects(projects){
         var items = [];
                
@@ -119,8 +113,6 @@ $(document).ready(function() {
                 if (s.match('^' + escapeRegExp(p))) {
                     slicename = s.replace(p + '.','')
                     items_sl.push( "<li><a href=\"/resources/" + s + "\" title='Add resources to slice "+slicename+"'><img src='/static/img/icon_slices_small.png' style='width: 12px;'>  " + slicename + "</a></li>" );
-                }else if(s.split('.').length < 4){
-                     slices_no_project.push( "<li><a href=\"/resources/" + s + "\" title='Add resources to slice "+s+"'><img src='/static/img/icon_slices_small.png' style='width: 12px;'>  " + s + "</a></li>" );
                 }
             });
             el = "<li><a href=\"/portal/project/" + p + "\" title='Manage project "+p+"' >" + p + "</a>";
@@ -131,11 +123,12 @@ $(document).ready(function() {
             items.push(el);
             items_sl = [];
         });
-        if (projects.length == 0){
-            $.each( slices, function(y, s) {
+
+        $.each( slices, function(y, s) {
+            if(s.split('.').length < 4){
                 slices_no_project.push( "<li><a href=\"/resources/" + s + "\" title='Add resources to slice "+s+"'><img src='/static/img/icon_slices_small.png' style='width: 12px;'>  " + s + "</a></li>" );
-            });
-        }
+            }
+        });
         if (slices_no_project.length > 0) {
             elm = '<li>other slices <span class="glyphicon glyphicon-info-sign" title="these are <b>legacy slices</b> from now on, slices must be created within a project">&nbsp;</span>';
             elm += "<ul>" + slices_no_project.join( "" ) + "</ul>";
@@ -152,7 +145,6 @@ $(document).ready(function() {
     window.setTimeout(function() {
         $('.projects-loading').hide();
     },20000);
-    {% endif %}
 {% endif %}
        jQuery('[title!=""]').qtip();
 });