X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=portal%2Ftemplates%2Fbase.html;h=ce31ce05e24079bd496acdcd09c56c79d39d0268;hb=7a41f0985a9af46e9678f5d2a647e584df149278;hp=5989508a39d52aba756e5b1b578803be00187b05;hpb=9d4a0883ee7e5bc5cf5b990c400ddf573ef9937c;p=unfold.git
diff --git a/portal/templates/base.html b/portal/templates/base.html
index 5989508a..ce31ce05 100644
--- a/portal/templates/base.html
+++ b/portal/templates/base.html
@@ -1,37 +1,61 @@
{% 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' %}
+
-
+
+
+
+
+
+
{{ 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" %}
{% insert_str prelude "js/messages-runtime.js" %}
{% insert_str prelude "js/class.js" %}
{% insert_str prelude "js/plugin-helper.js" %}
{% insert_str prelude "js/mustache.js" %}
+{% insert_str prelude "js/hashtable.js" %}
{% insert_str prelude "js/plugin.js" %}
{% insert_str prelude "js/manifold.js" %}
{% insert_str prelude "css/manifold.css" %}
{% insert_str prelude "css/plugin.css" %}
{% insert_str prelude "js/bootstrap.js" %}
{% insert_str prelude "css/bootstrap.css" %}
+{% insert_str prelude "js/bootstrap-datepicker.js" %}
+{% insert_str prelude "css/datepicker.css" %}
+{% insert_str prelude "js/bootstrap-slider.js" %}
+{% insert_str prelude "css/slider.css" %}
{% insert_str prelude "css/topmenu.css" %}
{% insert_str prelude "js/logout.js" %}
+
@@ -41,49 +65,111 @@ XXX TODO: session
This list of slices should go into SESSION !
*/
$(document).ready(function() {
- {% if username %}
- myslice.login();
+{% if username %}
+ myslice.login(function(){
+ user = myslice.get_user();
+
+ var slices = [];
+ if($.isEmptyObject(user)){
+ $("div#home-slice-list").html(
+ "You do not yet have a slice
");
+ $("ul#dropdown-slice-list").append("no slice");
+ 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 %}
+ });
- user = myslice.user();
-
- var slices = [];
- if($.isEmptyObject(user)){
- $.post("/rest/user/",{'filters':{'user_hrn':'$user_hrn'}}, function( data ) {
- if(data.length > 0){
- drawSlices(data[0].slices);
- }else{
- $("div#home-slice-list").html(
- "You do not yet have a slice
");
- $("ul#dropdown-slice-list").append("no slice");
- slices.push("no slice");
- }
- });
- }else{
- slices = user.slices;
- drawSlices(slices);
- }
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" or "onelab" in theme%}
+ function drawProjects(projects){
+ var items = [];
+
+ $.each( projects, function(i, 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();
});
-
+
+
+{% widget '_widget-message.html' %}
+
{% block container %}
{% block topmenu %}
{% widget "_widget-topmenu.html" %}
{% endblock topmenu %}
- {% include 'messages-transient.html' %}
{% block base_content %}
{% endblock %}
{% endblock container %}
+{% widget "_footer.html" %}
+
+
Loading...
+
+
+