X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=portal%2Ftemplates%2Fbase.html;h=ce31ce05e24079bd496acdcd09c56c79d39d0268;hb=7a41f0985a9af46e9678f5d2a647e584df149278;hp=6ccabce62614b700ba209f1c0d0a09b702ac06e1;hpb=c8396ad1b6cf17a60769496c3b51aa1e390575cc;p=unfold.git
diff --git a/portal/templates/base.html b/portal/templates/base.html
index 6ccabce6..ce31ce05 100644
--- a/portal/templates/base.html
+++ b/portal/templates/base.html
@@ -1,9 +1,19 @@
{% load portal_filters %}
{# This is required by insert_above #}{% insert_handler %}
-
+
+
{{theme}} portal - {{ section }}
-
+
+
+{% if theme == "fed4fire" %}
+
+{% elif theme == "smartfire" %}
+
+{% else %}
+
+{% endif %}
+
{# This is where insert_str will end up #}{% media_container prelude %}
{% include 'messages-transient-header.html' %}
@@ -11,13 +21,19 @@
-
+
+
+
+
+
+
{{ header_prelude }}
{% block head %} {% endblock head %}
{# let's add these ones no matter what #}
+{#NOTE: DO NOT ADD JQUERY-UI JS & CSS HERE. IT BREAKS THE RESOURCE BROWSING PAGE -- DETAILS WITH JORDAN AUGE#}
{% insert_str prelude "js/jquery.min.js" %}
{% insert_str prelude "js/angular/angular.min.js" %}
{% insert_str prelude "js/jquery.html5storage.min.js" %}
@@ -39,6 +55,7 @@
{% insert_str prelude "css/topmenu.css" %}
{% insert_str prelude "js/logout.js" %}
+
@@ -50,7 +67,7 @@ This list of slices should go into SESSION !
$(document).ready(function() {
{% if username %}
myslice.login(function(){
- user = myslice.user();
+ user = myslice.get_user();
var slices = [];
if($.isEmptyObject(user)){
@@ -60,36 +77,77 @@ $(document).ready(function() {
slices.push("no slice");
}else{
slices = user.slices;
+ {% if theme != "fed4fire" or "onelab" in theme %}
drawSlices(slices);
+ {% endif %}
}
- {% if theme == "fed4fire" %}
- p = myslice.projects();
+ {% if theme == "fed4fire" or "onelab" in theme%}
+ p = myslice.get_projects();
if(p != null){
- drawProjects(p);
+ //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" %}
+ {% 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( "" ));
}
+ 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 + "" );
+ }else if(s.split('.').length < 4){
+ slices_no_project.push( " " + s + "" );
+ }
+ });
+ el = "" + p + "";
+ if (items_sl.length > 0) {
+ el += "" + items_sl.join( "" ) + "
";
+ }
+ el += "";
+ 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();
+ }
+ }
+
+ window.setTimeout(function() {
+ $('.projects-loading').hide();
+ },20000);
{% endif %}
{% endif %}
jQuery('[title!=""]').qtip();