From 08cf8f5ad12df97137284f2d474582bc5851cb45 Mon Sep 17 00:00:00 2001 From: Ciro Scognamiglio <ciro.scognamiglio@cslash.net> Date: Thu, 16 Apr 2015 16:58:10 +0200 Subject: [PATCH] create slice shown only when user is in at least one project --- portal/static/css/fed4fire.css | 3 +++ portal/templates/base.html | 11 +++++++++-- portal/templates/fed4fire/fed4fire_home-view.html | 5 +++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/portal/static/css/fed4fire.css b/portal/static/css/fed4fire.css index 735e78e2..99e57d40 100644 --- a/portal/static/css/fed4fire.css +++ b/portal/static/css/fed4fire.css @@ -717,6 +717,9 @@ div.dashboard span.glyphicon { width:45px; height:25px; } +div.dashboard-create-slice { + display:none; +} div.experiment-tools { } div.experiment-tools h4 { diff --git a/portal/templates/base.html b/portal/templates/base.html index fd1869ee..27c17ea7 100644 --- a/portal/templates/base.html +++ b/portal/templates/base.html @@ -76,12 +76,12 @@ $(document).ready(function() { slices.push("no slice"); }else{ slices = user.slices; - drawSlices(slices); + //drawSlices(slices); } {% if theme == "fed4fire" %} p = myslice.projects(); if(p != null){ - drawProjects(p); + //drawProjects(p); drawProjectsTree(p,slices); } {% endif %} @@ -126,7 +126,14 @@ $(document).ready(function() { items_sl = []; }); $("div#home-project-tree").html($( "<ul/>", { html: items.join( "" ) })); + if (projects.length > 0) { + $('.dashboard-create-slice').show(); + } } + + window.setTimeout(function() { + $('.projects-loading').hide(); + },10000); {% endif %} {% endif %} jQuery('[title!=""]').qtip(); diff --git a/portal/templates/fed4fire/fed4fire_home-view.html b/portal/templates/fed4fire/fed4fire_home-view.html index 5d05b480..f4e6b4ff 100644 --- a/portal/templates/fed4fire/fed4fire_home-view.html +++ b/portal/templates/fed4fire/fed4fire_home-view.html @@ -31,7 +31,8 @@ <div> <span class="glyphicon glyphicon-cog"></span> <a href="/portal/project_request/">Create/Join project</a> - <br /> + </div> + <div class="dashboard-create-slice"> <span class="glyphicon glyphicon-plus"></span> <a href="/portal/slice_request/">Create slice</a> </div> <div class="projects-tree"> @@ -42,7 +43,7 @@ those slices will not appear here. <br /><br /> A <b>project</b> is a sub-authority under the responsability of your institution gathering users, who will be able to create slices for their experiments." class="glyphicon glyphicon-info-sign"> </span> - <div id="home-project-tree"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading projects" /></div> + <div id="home-project-tree"><img class="projects-loading" src="{{ STATIC_URL }}img/loading.gif" alt="Loading projects" /></div> </div> <div class="experiment-tools"> -- 2.47.0