X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=portal%2Ftemplates%2Fbase.html;h=82fa444f6efcb2b2517e920e8fe32a873c804e74;hb=335a5be14ae49e9f9ed35710be9e516f9ea8b789;hp=0bf9ab4e0fd37b21f49c35330a97603158a422fc;hpb=f14b01877d399b176e18a44f1d265358ad27de89;p=myslice.git
diff --git a/portal/templates/base.html b/portal/templates/base.html
index 0bf9ab4e..82fa444f 100644
--- a/portal/templates/base.html
+++ b/portal/templates/base.html
@@ -3,7 +3,16 @@
{{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' %}
@@ -14,10 +23,16 @@
+
+
+
+
+
{{ 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,53 +63,58 @@ 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();
- 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);
+ }
+ {% endif %}
+ });
- var slices = [];
- if($.isEmptyObject(user)){
- $.post("/rest/myslice: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);
- }
-
- /*
- Launch queries to get the resources and leases in Manifold Cache
- */
-
function drawSlices(slices){
var items = [];
$.each( slices, function(i, val) {
items.push( "" + val + " " );
- /*
- // Launch a Query for each slice to get resources and leases in Manifold Cache
- // Now only done in Homeview to speed up the other pages
- $.post("/rest/slice/", { 'filters': { 'slice_hrn' : val } }, function(data) {
- });
- */
});
$("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( "" ));
+ }
{% endif %}
+{% endif %}
jQuery('[title!=""]').qtip();
});
+
+{% widget '_widget-message.html' %}
+
{% block container %}
{% block topmenu %}
{% widget "_widget-topmenu.html" %}