X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=portal%2Ftemplates%2Fbase.html;h=cbbc0ac4950a82417bb8a908700289d6238a4a99;hb=1d9a6983edf2136e2158980462a5170e430510fc;hp=cc60f7f166d267f15517d6cd47627e84aab66d89;hpb=ea22db0e99695ec26e1481558af65e0a541572da;p=unfold.git
diff --git a/portal/templates/base.html b/portal/templates/base.html
index cc60f7f1..cbbc0ac4 100644
--- a/portal/templates/base.html
+++ b/portal/templates/base.html
@@ -38,6 +38,10 @@
{% insert_str prelude "css/slider.css" %}
{% insert_str prelude "css/topmenu.css" %}
{% insert_str prelude "js/logout.js" %}
+{% insert_str prelude "js/jquery-ui.js" %}
+{% insert_str prelude "js/jquery-ui-combobox.js" %}
+
+
@@ -48,53 +52,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)){
- $.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);
- }
+ 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 %}
+ });
- /*
- 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" %}