1 {% load portal_filters %}
2 {# This is required by insert_above #}{% insert_handler %}<!DOCTYPE html>
5 <title>{{theme}} portal - {{ section }}</title>
6 <meta name="viewport" content="width=device-width, initial-scale=1.0">
8 <!--Selecting favicon based on theme. Add more for other portals -->
9 {% if theme == "fed4fire" %}
10 <link rel="shortcut icon" href="/static/img/fed4fire_favicon.ico">
11 {% elif theme == "smartfire" %}
12 <link rel="shortcut icon" href="/static/img/smartfire_favicon.ico">
14 <link rel="shortcut icon" href="/static/img/favicon.ico">
17 {# This is where insert_str will end up #}{% media_container prelude %}
18 {% include 'messages-transient-header.html' %}
19 <script type="text/javascript"> {# raw js code - use {% insert prelude_js %} ... {% endinsert %} #} {% container prelude_js %}</script>
20 <!--<script src="{{ STATIC_URL }}js/jquery-ui.js"></script>-->
21 <script src="{{ STATIC_URL }}js/jquery.dataTables.min.js"></script>
22 <script src="{{ STATIC_URL }}js/jquery.qtip.min.js"></script>
23 <script src="{{ STATIC_URL }}js/bootstrap.datatables.js"></script>
24 <script src="{{ STATIC_URL }}js/common.functions.js"></script>
25 <script src="{{ STATIC_URL }}js/myslice.js"></script>
26 <script src="{{ STATIC_URL }}js/myslice-ui.js"></script>
28 <script type="text/javascript" src="{{STATIC_URL}}/js/spin-presets.js"></script>
29 <script type="text/javascript" src="{{STATIC_URL}}/js/spin.min.js"></script>
30 <script type="text/javascript" src="{{STATIC_URL}}/js/jquery.spin.js"></script>
32 <style type="text/css">{# In case we need to add raw css code #}{% container prelude_css %}</style>
34 {% block head %} {% endblock head %}
35 {# let's add these ones no matter what #}
36 {#NOTE: DO NOT ADD JQUERY-UI JS & CSS HERE. IT BREAKS THE RESOURCE BROWSING PAGE -- DETAILS WITH JORDAN AUGE#}
37 {% insert_str prelude "js/jquery.min.js" %}
38 {% insert_str prelude "js/angular/angular.min.js" %}
39 {% insert_str prelude "js/jquery.html5storage.min.js" %}
40 {% insert_str prelude "js/messages-runtime.js" %}
41 {% insert_str prelude "js/class.js" %}
42 {% insert_str prelude "js/plugin-helper.js" %}
43 {% insert_str prelude "js/mustache.js" %}
44 {% insert_str prelude "js/hashtable.js" %}
45 {% insert_str prelude "js/plugin.js" %}
46 {% insert_str prelude "js/manifold.js" %}
47 {% insert_str prelude "css/manifold.css" %}
48 {% insert_str prelude "css/plugin.css" %}
49 {% insert_str prelude "js/bootstrap.js" %}
50 {% insert_str prelude "css/bootstrap.css" %}
51 {% insert_str prelude "js/bootstrap-datepicker.js" %}
52 {% insert_str prelude "css/datepicker.css" %}
53 {% insert_str prelude "js/bootstrap-slider.js" %}
54 {% insert_str prelude "css/slider.css" %}
55 {% insert_str prelude "css/topmenu.css" %}
56 {% insert_str prelude "js/logout.js" %}
57 <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/myslice.css">
58 <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/{{ theme }}.css">
59 <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/jquery.qtip.min.css">
62 <script type="text/javascript">
65 This list of slices should go into SESSION !
67 $(document).ready(function() {
69 myslice.login(function(){
70 user = myslice.get_user();
73 if($.isEmptyObject(user)){
74 $("div#home-slice-list").html(
75 "<div>You do not yet have a slice</div>");
76 $("ul#dropdown-slice-list").append("<li>no slice</li>");
77 slices.push("no slice");
81 p = myslice.get_projects();
84 drawProjectsTree(p,slices);
88 function drawSlices(slices){
91 $.each( slices, function(i, val) {
92 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>" );
94 $("div#home-slice-list").html($( "<ul/>", { html: items.join( "" ) }));
95 $("ul#dropdown-slice-list").append(items.join( "" ));
98 function drawProjects(projects){
101 $.each( projects, function(i, val) {
102 items.push( "<li><a href=\"/portal/project/"+val+"\" title='Manage project "+val+"'>" + val + "</a></li>" );
104 $("div#home-project-list").html($( "<ul/>", { html: items.join( "" ) }));
105 $("ul#dropdown-project-list").append(items.join( "" ));
107 function drawProjectsTree(projects,slices) {
110 var slices_no_project = [];
111 $.each( projects, function(i, p) {
112 $.each( slices, function(y, s) {
113 if (s.match('^' + escapeRegExp(p))) {
114 slicename = s.replace(p + '.','')
115 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>" );
116 }else if(s.split('.').length < 4){
117 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>" );
120 el = "<li><a href=\"/portal/project/" + p + "\" title='Manage project "+p+"' >" + p + "</a>";
121 if (items_sl.length > 0) {
122 el += "<ul>" + items_sl.join( "" ) + "</ul>";
128 if (projects.length == 0){
129 $.each( slices, function(y, s) {
130 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>" );
133 if (slices_no_project.length > 0) {
134 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>';
135 elm += "<ul>" + slices_no_project.join( "" ) + "</ul>";
140 $("div#home-project-tree").html($( "<ul/>", { html: items.join( "" ) }));
141 if (projects.length > 0) {
142 $('.dashboard-create-slice').show();
146 window.setTimeout(function() {
147 $('.projects-loading').hide();
150 jQuery('[title!=""]').qtip();
154 <body ng-app="ManifoldApp">
156 {% widget '_widget-message.html' %}
158 {% block container %}
160 {% widget "_widget-topmenu.html" %}
161 {% endblock topmenu %}
162 {% block base_content %}
164 {% endblock container %}
165 {% widget "_footer.html" %}
166 <div class="loading">
167 <div><img src="{{ STATIC_URL }}/img/loading.gif" /> Loading...</div>
169 <div class="message"></div>