OneLab Dashboard: using session if user is PI
[myslice.git] / portal / templates / onelab / onelab_home-view.html
index f50c700..d98d1b1 100644 (file)
@@ -6,9 +6,17 @@
 {% widget '_widget-news.html' %}
 </div> -->
 {% if username %}
+{% widget "_widget-no_credentials.html" %}
 <div class="container dashboard">
+       {%if 'no_creds'  in user_cred %}
+        <p class="command"><a href="#" style="color:red" data-toggle="modal" data-target="#myModal">NO CREDENTIALS</a> are delegated to the portal!</p>
+    {%endif%}
+       {%if 'creds_expired'  in user_cred %}
+        <p class="command"><a href="#" style="color:red" data-toggle="modal" data-target="#myModal">EXPIRED CREDENTIALS</a> Please delegate again your credentials to the portal!</p>
+    {%endif%}
+
        <div class="row">
-               {%if 'is_pi'  in pi %}
+        {% if request.session.user.pi %}
                <div class="col-md-3">
                        <h3>
                                EXPERIMENT
                                <a href="#"><img src="{{ STATIC_URL }}img/icon_slices.png" alt="" /></a>
                        </div>
                        <div>
-                               <button id="slicerequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Request Slice</button>
+                               <button id="slicerequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Create Slice</button>
                        </div>
                        <div>
                                <p><strong>Your slices </strong>
                                        <span title="A slice is a set of testbed resources on which you can conduct an experiment. 
                                        Either ask your colleagues to give you access to an existing slice or request a new slice by clicking 'Request Slice'. 
-                                       However, On the OneLab portal, you will only see slices that you have created through OneLab. If you have created slices elsewhere, 
+                                       However, on the OneLab portal, you will only see slices that you have created through OneLab. If you have created slices elsewhere, 
                                        such as on the PlanetLab Europe portal, those slices will not appear here."
                                        class="glyphicon glyphicon-info-sign">
                                </span>
@@ -89,7 +97,7 @@
                                <p><strong>Your slices </strong>
                                <span title="A slice is a set of testbed resources on which you can conduct an experiment. 
                                        Either ask your colleagues to give you access to an existing slice or request a new slice by clicking 'Request Slice'. 
-                                       However, On the OneLab portal, you will only see slices that you have created through OneLab. If you have created slices elsewhere, 
+                                       However, on the OneLab portal, you will only see slices that you have created through OneLab. If you have created slices elsewhere, 
                                        such as on the PlanetLab Europe portal, those slices will not appear here."
                                        class="glyphicon glyphicon-info-sign">
                                </span>
                        <div>   
                                <div id="home-slice-list"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
                        </div>
+                       {% if pending_slices %}
+                       <p><strong>Pending slices</strong>
+                       <span title="Slices that you have requested and are pending for validation by the contact person of your organization."
+                               class="glyphicon glyphicon-info-sign">
+                       <ul>
+                       {% for slices in pending_slices %}
+                       <li>{{slices}}</li>
+                       {% endfor %}
+                       </ul>
+                       </span>
+                       </p>
+                       {%endif%}       
                </div>
                <div class="col-md-4">
                        <h3>
                $('button#slicerequestbtn').click(function() {
                        window.location="/portal/slice_request/";
                });
-/*-------
-List of slices has been moved in 
-portal/templates/base.html
-This should go into session
---------*/
+
+        myslice.loadSlices();
+        
 });
 </script>
+{% widget "_widget-monitor.html" %}
+{# widget "_widget-stats-top-slices.html" #}
+
 {% endblock %}