{% 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" %}
+<link rel='stylesheet' type='text/css' href='https://code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css'/>
+<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/jquery.ui.combobox.css">
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/{{ theme }}.css">
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/jquery.qtip.min.css">
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(
- "<div>You do not yet have a slice</div>");
- $("ul#dropdown-slice-list").append("<li>no slice</li>");
- slices.push("no slice");
- }
- });
- }else{
- slices = user.slices;
- drawSlices(slices);
- }
+ var slices = [];
+ if($.isEmptyObject(user)){
+ $("div#home-slice-list").html(
+ "<div>You do not yet have a slice</div>");
+ $("ul#dropdown-slice-list").append("<li>no slice</li>");
+ 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( "<li><a href=\"/resources/"+val+"\">" + val + "</a></li>" );
- /*
- // 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($( "<ul/>", { 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( "<li><a href=\"/portal/project/"+val+"\">" + val + "</a></li>" );
+ });
+ $("div#home-project-list").html($( "<ul/>", { html: items.join( "" ) }));
+ $("ul#dropdown-project-list").append(items.join( "" ));
+ }
{% endif %}
+{% endif %}
jQuery('[title!=""]').qtip();
});
</script>
</head>
<body ng-app="ManifoldApp">
+<div class="row">
+{% widget '_widget-message.html' %}
+</div>
{% block container %}
{% block topmenu %}
{% widget "_widget-topmenu.html" %}