{% insert_str prelude "css/slider.css" %}
{% insert_str prelude "css/topmenu.css" %}
{% insert_str prelude "js/logout.js" %}
+<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/myslice.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">
slices.push("no slice");
}else{
slices = user.slices;
- {% if theme != "fed4fire" %}
- drawSlices(slices);
- {% endif %}
}
- {% if theme == "fed4fire" %}
p = myslice.get_projects();
if(p != null){
//drawProjects(p);
drawProjectsTree(p,slices);
}
- {% endif %}
});
function drawSlices(slices){
var items = [];
-
+ console.log(slices);
$.each( slices, function(i, val) {
- items.push( "<li><a href=\"/resources/"+val+"\">" + val + "</a></li>" );
+ items.push( "<li><a href=\"/resources/"+val+"\" title='Add resources to slice "+val+"'><img src='/static/img/icon_slices_small.png' style='width: 12px;'>" + val + "</a></li>" );
});
$("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>" );
+ items.push( "<li><a href=\"/portal/project/"+val+"\" title='Manage project "+val+"'>" + val + "</a></li>" );
});
$("div#home-project-list").html($( "<ul/>", { 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))) {
- items_sl.push( "<li><a href=\"/resources/" + s + "\">" + s.replace(p + '.','') + "</a></li>" );
+ slicename = s.replace(p + '.','')
+ items_sl.push( "<li><a href=\"/resources/" + s + "\" title='Add resources to slice "+slicename+"'><img src='/static/img/icon_slices_small.png' style='width: 12px;'> " + slicename + "</a></li>" );
}
});
- el = "<li><a href=\"/portal/project/" + p + "\">" + p + "</a>";
+ el = "<li><a href=\"/portal/project/" + p + "\" title='Manage project "+p+"' >" + p + "</a>";
if (items_sl.length > 0) {
el += "<ul>" + items_sl.join( "" ) + "</ul>";
}
items.push(el);
items_sl = [];
});
+
+ $.each( slices, function(y, s) {
+ if(s.split('.').length < 4){
+ slices_no_project.push( "<li><a href=\"/resources/" + s + "\" title='Add resources to slice "+s+"'><img src='/static/img/icon_slices_small.png' style='width: 12px;'> " + s + "</a></li>" );
+ }
+ });
+ if (slices_no_project.length > 0) {
+ elm = '<li>other slices <span class="glyphicon glyphicon-info-sign" title="these are <b>legacy slices</b> from now on, slices must be created within a project"> </span>';
+ elm += "<ul>" + slices_no_project.join( "" ) + "</ul>";
+ elm += "</li>";
+ items.push(elm);
+ }
+
$("div#home-project-tree").html($( "<ul/>", { html: items.join( "" ) }));
if (projects.length > 0) {
$('.dashboard-create-slice').show();
window.setTimeout(function() {
$('.projects-loading').hide();
- },10000);
- {% endif %}
+ },20000);
{% endif %}
jQuery('[title!=""]').qtip();
});