X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=portal%2Ftemplates%2Fbase.html;h=27c17ea735b96144ffda12f0c8876787b93bf720;hb=08cf8f5ad12df97137284f2d474582bc5851cb45;hp=237cfa6b750b7fac335e98fc1fefa3d13553aacd;hpb=9501d64a10ee239095263fd7cad6f5e82ba7032a;p=myslice.git
diff --git a/portal/templates/base.html b/portal/templates/base.html
index 237cfa6b..27c17ea7 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" %}
@@ -48,27 +64,29 @@ 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.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;
+ //drawSlices(slices);
+ }
+ {% if theme == "fed4fire" %}
+ p = myslice.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 = [];
@@ -78,19 +96,66 @@ $(document).ready(function() {
$("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 + "" );
+ });
+ $("div#home-project-list").html($( "", { html: items.join( "" ) }));
+ $("ul#dropdown-project-list").append(items.join( "" ));
+ }
+ function drawProjectsTree(projects,slices) {
+ var items = [];
+ var items_sl = [];
+ $.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 + '.','') + "" );
+ }
+ });
+ el = "" + p + "";
+ if (items_sl.length > 0) {
+ el += "" + items_sl.join( "" ) + "
";
+ }
+ el += "";
+ items.push(el);
+ items_sl = [];
+ });
+ $("div#home-project-tree").html($( "", { html: items.join( "" ) }));
+ if (projects.length > 0) {
+ $('.dashboard-create-slice').show();
+ }
+ }
+
+ window.setTimeout(function() {
+ $('.projects-loading').hide();
+ },10000);
{% 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...
+
+
+