X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=portal%2Ftemplates%2Fbase.html;h=347fe99481ae924d47230fb1d0371071b6520278;hb=38bd8b2e028d3ce52890e03c915330407c0f2e1c;hp=c83c2bdc8ba4eba03046f0b9e7f487ae22df025d;hpb=26709c1cd29b40ac2e617a075a085e18da35e87c;p=myslice.git
diff --git a/portal/templates/base.html b/portal/templates/base.html
index c83c2bdc..347fe994 100644
--- a/portal/templates/base.html
+++ b/portal/templates/base.html
@@ -54,6 +54,7 @@
{% insert_str prelude "css/slider.css" %}
{% insert_str prelude "css/topmenu.css" %}
{% insert_str prelude "js/logout.js" %}
+
@@ -76,33 +77,29 @@ $(document).ready(function() {
slices.push("no slice");
}else{
slices = user.slices;
- //drawSlices(slices);
}
- {% if theme == "fed4fire" %}
p = myslice.get_projects();
if(p != null){
//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" %}
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 +107,15 @@ $(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 + "" );
}
});
- el = "" + p + "";
+ el = "" + p + "";
if (items_sl.length > 0) {
el += "" + items_sl.join( "" ) + "
";
}
@@ -125,6 +123,19 @@ $(document).ready(function() {
items.push(el);
items_sl = [];
});
+
+ $.each( slices, function(y, s) {
+ if(s.split('.').length < 4){
+ 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();
@@ -133,8 +144,7 @@ $(document).ready(function() {
window.setTimeout(function() {
$('.projects-loading').hide();
- },10000);
- {% endif %}
+ },20000);
{% endif %}
jQuery('[title!=""]').qtip();
});