list pending slices in dashboard
[myslice.git] / portal / templates / onelab / onelab_home-view.html
1 {% extends "layout_base.html" %}
2 {% load portal_filters %}
3
4 {% block content %}
5 <!-- <div class="row">
6 {% widget '_widget-news.html' %}
7 </div> -->
8 {% if username %}
9 <!-- Modal- No credentials -->
10 <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
11             <div class="modal-dialog">
12                 <div class="modal-content">
13                     <div class="modal-header">
14                         <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
15                             <h4 class="modal-title" id="myModalLabel">No credentials are delegated to the portal</h4>
16                     </div>
17                     <div class="modal-body" style="text-align:justify;">
18                                         <p>You are getting this message for any of the following reasons:</p>
19                                         <ul>
20                                                 <li>If your account is still pending for validation</li>
21                                                 <li>If you press the "Clear Credentials" button</li>
22                                                 <li>If you "Generate a new key pair"</li>
23                                                 <li>If a new slice is added to your account</li>
24                                         </ul>
25                                         <p>Unless your account has not yet been validated, it is sufficient to refresh the page or go back to the home page. 
26                                                 The portal will then regenerate your credentials. In some cases it may take more time than usual. If nothing works, 
27                                                 then please logout and login back into to the portal.
28                                         </p>
29                                         <h3>Manual delegation of credentials</h3>
30                                                 <p>
31                                                         You have selected upon sign-up to upload your public key. As you have uploaded your own public key, 
32                                                         the portal can no longer generate your credentials automatically. In order to have your credentials 
33                                                         delegated to the portal, please follow these instructions:
34                                                 </p>
35                                                 <ul>
36                                                         <li>Your account must first be validated by the manager of your organization.</li>
37                                                         <li>In order for the portal to contact testbeds on your behalf, so as to list and reserve resources, you will need to
38                                                                 <a href="/portal/manual_delegation" target="_blank">delegate your credentials to the portal.</a></li>
39                                                 </ul>
40                                         </p>
41                                         <h3>Contact support</h3>
42                                         <p>If you don't have the above mentioned cases and still have this message, please  <a href="/contact/" target="_blank">contact us</a>.</p>
43                     </div>
44                     <div class="modal-footer">
45                         <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
46                     </div>
47                 </div>
48             </div>
49 </div>
50 <div class="container dashboard">
51            {%if 'no_creds'  in user_cred %}
52       <p class="command"><a href="#" style="color:red" data-toggle="modal" data-target="#myModal">NO CREDENTIALS</a> are delegated to the portal!</p>
53   {%endif%}
54
55         <div class="row">
56                 {%if 'is_pi'  in pi %}
57                 <div class="col-md-3">
58                         <h3>
59                                 EXPERIMENT
60                         </h3>
61                         <div>
62                                 <a href="#"><img src="{{ STATIC_URL }}img/icon_slices.png" alt="" /></a>
63                         </div>
64                         <div>
65                                 <button id="slicerequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Create Slice</button>
66                         </div>
67                         <div>
68                                 <p><strong>Your slices </strong>
69                                         <span title="A slice is a set of testbed resources on which you can conduct an experiment. 
70                                         Either ask your colleagues to give you access to an existing slice or request a new slice by clicking 'Request Slice'. 
71                                         However, on the OneLab portal, you will only see slices that you have created through OneLab. If you have created slices elsewhere, 
72                                         such as on the PlanetLab Europe portal, those slices will not appear here."
73                                         class="glyphicon glyphicon-info-sign">
74                                 </span>
75
76                                 </p>
77                         </div>
78                         <div>   
79                                 <div id="home-slice-list"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
80                         </div>
81                 </div>
82                 <div class="col-md-3">
83                         <h3>MANAGEMENT</h3>
84                         <div>
85                                 <a href="/portal/institution"><img src="{{ STATIC_URL }}img/icon_authority_color.png" alt="" /></a>
86                         </div>
87                         <div>
88                                 <button id="validaterequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-ok"></span> Validate Requests</button>
89                         </div>
90                 </div>
91                 <div class="col-md-3">
92                         <h3>
93                                 SUPPORT
94                         </h3>
95                         <div>
96                                 <a href="/portal/support"><img src="{{ STATIC_URL }}img/icon_support.png" alt="" /></a>
97                         </div>
98                         <div>
99                                 <button id="ticketbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-envelope"></span> Contact</button>
100                         </div>
101                 </div>
102                 
103                 <div class="col-md-3">
104                         <h3>
105                                 ACCOUNT
106                         </h3>
107                         <div>
108                                 <a href="/portal/account/"><img src="{{ STATIC_URL }}img/icon_user_color.png" alt="" /></a>
109                         </div>
110                         <div>
111                                 <button id="logoutbtn" type="button" class="btn btn-default" data-username="{{ username }}"><span class="glyphicon glyphicon-off"></span> Logout</button>
112                         </div>
113                         <div>
114                                 {% if person.last_name %}
115                                         {{person.first_name}} {{person.last_name}}<br />
116                                 {% endif %}
117                         <span class="label">Username:</span> <a href='/portal/account/' title="Click here to see and edit your account details.">{{person.email}}</a>
118                 </div>
119                 </div>
120         </div>
121         {%else%}
122         <div class="row">
123                 <div class="col-md-4">
124                         <h3>
125                                 EXPERIMENT
126                         </h3>
127                         <div>
128                                 <a href="#"><img src="{{ STATIC_URL }}img/icon_slices.png" alt="" /></a>
129                         </div>
130                         <div>
131                                 <button id="slicerequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Request Slice</button>
132                         </div>
133                         <div>
134                                 <p><strong>Your slices </strong>
135                                 <span title="A slice is a set of testbed resources on which you can conduct an experiment. 
136                                         Either ask your colleagues to give you access to an existing slice or request a new slice by clicking 'Request Slice'. 
137                                         However, on the OneLab portal, you will only see slices that you have created through OneLab. If you have created slices elsewhere, 
138                                         such as on the PlanetLab Europe portal, those slices will not appear here."
139                                         class="glyphicon glyphicon-info-sign">
140                                 </span>
141                                 </p>
142                         </div>
143                         <div>   
144                                 <div id="home-slice-list"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
145                         </div>
146                         {% if pending_slices %}
147                         <p><strong>Pending slices</strong>
148                         <span title="Slices that you have requested and are pending for validation by the contact person of your organization."
149                                 class="glyphicon glyphicon-info-sign">
150                         <ul>
151                         {% for slices in pending_slices %}
152                         <li>{{slices}}</li>
153                         {% endfor %}
154                         </ul>
155                         </span>
156                         </p>
157                         {%endif%}       
158                 </div>
159                 <div class="col-md-4">
160                         <h3>
161                                 SUPPORT
162                         </h3>
163                         <div>
164                                 <a href="/portal/support"><img src="{{ STATIC_URL }}img/icon_support.png" alt="" /></a>
165                         </div>
166                         <div>
167                                 <button id="ticketbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-envelope"></span> Contact</button>
168                         </div>
169                 </div>
170                 
171                 <div class="col-md-4">
172                         <h3>
173                                 ACCOUNT
174                         </h3>
175                         <div>
176                                 <a href="/portal/account/"><img src="{{ STATIC_URL }}img/icon_user_color.png" alt="" /></a>
177                         </div>
178                         <div>
179                                 <button id="logoutbtn" type="button" class="btn btn-default" data-username="{{ username }}"><span class="glyphicon glyphicon-off"></span> Logout</button>
180                         </div>
181                         <div>
182                                 {% if person.last_name %}
183                                         {{person.first_name}} {{person.last_name}}<br />
184                                 {% endif %}
185                         <span class="label">Username:</span> <a href='/portal/account/' title="Click here to see and edit your account details.">{{person.email}}</a>
186                 </div>
187                 </div>
188         </div>
189         {%endif%}
190
191 </div>
192 {% else %}
193 <div class="container-fluid home">
194         <div class="">
195                 <div class="col-sm-2"></div>
196                 <div class="col-sm-4 slogan">
197                         <h2>
198                                 Your Easy Access to Computer Networking Testbeds:
199                         </h2>
200                         <h3>
201                                 A wide variety of world class testbeds available through your one account
202                         </h3>
203                 </div>
204                 <div class="col-sm-5 col-sm-offset-1">
205                         <div class="row">
206                                 {% widget '_widget-login-user.html' %}
207                         </div>
208                 </div>
209                 <div class="col-sm-1"></div>
210         </div>
211 </div>
212 {% endif %}
213
214
215 <script type="text/javascript">
216         $(document).ready(function() {
217                 $('a.home-tab').click(function() {
218                         $('ul.nav-tabs li').removeClass('active');
219                         $(this).parent().addClass('active');
220                         $('div.home-panel').hide();
221                         $('div#'+$(this).data('panel')).show();
222                 });
223                 $('button#validaterequestbtn').click(function() {
224                         window.location="/portal/institution#requests";
225                 });
226                 $('button#ticketbtn').click(function() {
227                         window.location="/portal/contact/";
228                 });
229                 $('button#signupbtn').click(function() {
230                         window.location="/portal/register/";
231                 });
232                 $('button#slicerequestbtn').click(function() {
233                         window.location="/portal/slice_request/";
234                 });
235 /*-------
236 List of slices has been moved in 
237 portal/templates/base.html
238 This should go into session
239 --------*/
240 });
241 </script>
242 {# widget "_widget-monitor.html" #}
243 {# widget "_widget-stats-top-slices.html" #}
244
245 {% endblock %}