myslice prefixed queries to speed up the portal
[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          {%if 'creds_expired'  in user_cred %}
55     <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>
56     {%endif%}
57
58         <div class="row">
59                 {%if 'is_pi'  in pi %}
60                 <div class="col-md-3">
61                         <h3>
62                                 EXPERIMENT
63                         </h3>
64                         <div>
65                                 <a href="#"><img src="{{ STATIC_URL }}img/icon_slices.png" alt="" /></a>
66                         </div>
67                         <div>
68                                 <button id="slicerequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Create Slice</button>
69                         </div>
70                         <div>
71                                 <p><strong>Your slices </strong>
72                                         <span title="A slice is a set of testbed resources on which you can conduct an experiment. 
73                                         Either ask your colleagues to give you access to an existing slice or request a new slice by clicking 'Request Slice'. 
74                                         However, on the OneLab portal, you will only see slices that you have created through OneLab. If you have created slices elsewhere, 
75                                         such as on the PlanetLab Europe portal, those slices will not appear here."
76                                         class="glyphicon glyphicon-info-sign">
77                                 </span>
78
79                                 </p>
80                         </div>
81                         <div>   
82                                 <div id="home-slice-list"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
83                         </div>
84                 </div>
85                 <div class="col-md-3">
86                         <h3>MANAGEMENT</h3>
87                         <div>
88                                 <a href="/portal/institution"><img src="{{ STATIC_URL }}img/icon_authority_color.png" alt="" /></a>
89                         </div>
90                         <div>
91                                 <button id="validaterequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-ok"></span> Validate Requests</button>
92                         </div>
93                 </div>
94                 <div class="col-md-3">
95                         <h3>
96                                 SUPPORT
97                         </h3>
98                         <div>
99                                 <a href="/portal/support"><img src="{{ STATIC_URL }}img/icon_support.png" alt="" /></a>
100                         </div>
101                         <div>
102                                 <button id="ticketbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-envelope"></span> Contact</button>
103                         </div>
104                 </div>
105                 
106                 <div class="col-md-3">
107                         <h3>
108                                 ACCOUNT
109                         </h3>
110                         <div>
111                                 <a href="/portal/account/"><img src="{{ STATIC_URL }}img/icon_user_color.png" alt="" /></a>
112                         </div>
113                         <div>
114                                 <button id="logoutbtn" type="button" class="btn btn-default" data-username="{{ username }}"><span class="glyphicon glyphicon-off"></span> Logout</button>
115                         </div>
116                         <div>
117                                 {% if person.last_name %}
118                                         {{person.first_name}} {{person.last_name}}<br />
119                                 {% endif %}
120                         <span class="label">Username:</span> <a href='/portal/account/' title="Click here to see and edit your account details.">{{person.email}}</a>
121                 </div>
122                 </div>
123         </div>
124         {%else%}
125         <div class="row">
126                 <div class="col-md-4">
127                         <h3>
128                                 EXPERIMENT
129                         </h3>
130                         <div>
131                                 <a href="#"><img src="{{ STATIC_URL }}img/icon_slices.png" alt="" /></a>
132                         </div>
133                         <div>
134                                 <button id="slicerequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Request Slice</button>
135                         </div>
136                         <div>
137                                 <p><strong>Your slices </strong>
138                                 <span title="A slice is a set of testbed resources on which you can conduct an experiment. 
139                                         Either ask your colleagues to give you access to an existing slice or request a new slice by clicking 'Request Slice'. 
140                                         However, on the OneLab portal, you will only see slices that you have created through OneLab. If you have created slices elsewhere, 
141                                         such as on the PlanetLab Europe portal, those slices will not appear here."
142                                         class="glyphicon glyphicon-info-sign">
143                                 </span>
144                                 </p>
145                         </div>
146                         <div>   
147                                 <div id="home-slice-list"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
148                         </div>
149                         {% if pending_slices %}
150                         <p><strong>Pending slices</strong>
151                         <span title="Slices that you have requested and are pending for validation by the contact person of your organization."
152                                 class="glyphicon glyphicon-info-sign">
153                         <ul>
154                         {% for slices in pending_slices %}
155                         <li>{{slices}}</li>
156                         {% endfor %}
157                         </ul>
158                         </span>
159                         </p>
160                         {%endif%}       
161                 </div>
162                 <div class="col-md-4">
163                         <h3>
164                                 SUPPORT
165                         </h3>
166                         <div>
167                                 <a href="/portal/support"><img src="{{ STATIC_URL }}img/icon_support.png" alt="" /></a>
168                         </div>
169                         <div>
170                                 <button id="ticketbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-envelope"></span> Contact</button>
171                         </div>
172                 </div>
173                 
174                 <div class="col-md-4">
175                         <h3>
176                                 ACCOUNT
177                         </h3>
178                         <div>
179                                 <a href="/portal/account/"><img src="{{ STATIC_URL }}img/icon_user_color.png" alt="" /></a>
180                         </div>
181                         <div>
182                                 <button id="logoutbtn" type="button" class="btn btn-default" data-username="{{ username }}"><span class="glyphicon glyphicon-off"></span> Logout</button>
183                         </div>
184                         <div>
185                                 {% if person.last_name %}
186                                         {{person.first_name}} {{person.last_name}}<br />
187                                 {% endif %}
188                         <span class="label">Username:</span> <a href='/portal/account/' title="Click here to see and edit your account details.">{{person.email}}</a>
189                 </div>
190                 </div>
191         </div>
192         {%endif%}
193
194 </div>
195 {% else %}
196 <div class="container-fluid home">
197         <div class="">
198                 <div class="col-sm-2"></div>
199                 <div class="col-sm-4 slogan">
200                         <h2>
201                                 Your Easy Access to Computer Networking Testbeds:
202                         </h2>
203                         <h3>
204                                 A wide variety of world class testbeds available through your one account
205                         </h3>
206                 </div>
207                 <div class="col-sm-5 col-sm-offset-1">
208                         <div class="row">
209                                 {% widget '_widget-login-user.html' %}
210                         </div>
211                 </div>
212                 <div class="col-sm-1"></div>
213         </div>
214 </div>
215 {% endif %}
216
217
218 <script type="text/javascript">
219         $(document).ready(function() {
220                 $('a.home-tab').click(function() {
221                         $('ul.nav-tabs li').removeClass('active');
222                         $(this).parent().addClass('active');
223                         $('div.home-panel').hide();
224                         $('div#'+$(this).data('panel')).show();
225                 });
226                 $('button#validaterequestbtn').click(function() {
227                         window.location="/portal/institution#requests";
228                 });
229                 $('button#ticketbtn').click(function() {
230                         window.location="/portal/contact/";
231                 });
232                 $('button#signupbtn').click(function() {
233                         window.location="/portal/register/";
234                 });
235                 $('button#slicerequestbtn').click(function() {
236                         window.location="/portal/slice_request/";
237                 });
238
239         myslice.loadSlices();
240         
241 });
242 </script>
243 {# widget "_widget-monitor.html" #}
244 {# widget "_widget-stats-top-slices.html" #}
245
246 {% endblock %}