f4f: merging with current onelab protal templates
[myslice.git] / portal / templates / fed4fire / fed4fire_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         <div class="row">
52         {%if 'no_creds'  in user_cred %}
53         <p class="command"><a href="#" style="color:red" data-toggle="modal" data-target="#myModal">NO CREDENTIALS</a> are delegated to the portal!</p>
54         {%endif%}
55         {%if 'creds_expired'  in user_cred %}
56         <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>
57     {%endif%}
58                 {%if 'is_pi'  in pi %}
59                 <div class="col-md-3">
60                         <h3>
61                                 EXPERIMENT
62                         </h3>
63                         <div>
64                                 <a href="#"><img src="{{ STATIC_URL }}img/icon_slices.png" alt="" /></a>
65                         </div>
66                         <div>
67                                 <button id="slicerequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Create Slice</button>
68                         </div>
69                         <div>
70                                 <p><strong>Your slices </strong>
71                                         <span title="A slice is a set of testbed resources on which you can conduct an experiment. 
72                                         Either ask your colleagues to give you access to an existing slice or request a new slice by clicking 'Request Slice'. 
73                                         However, on the OneLab portal, you will only see slices that you have created through OneLab. If you have created slices elsewhere, 
74                                         such as on the PlanetLab Europe portal, those slices will not appear here."
75                                         class="glyphicon glyphicon-info-sign">
76                                 </span>
77
78                                 </p>
79                         </div>
80                         <div>   
81                                 <div id="home-slice-list"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
82                         </div>
83                         <h3 title="Some tools do their own slice creation and management.">Experiment now</h3>
84                         <a class="btn btn-primary" style="width: 150px;" 
85                     href='http://jfed.iminds.be/releases/r1389/webstart/experimenter/jfed-experimenter.jnlp'
86                                         title="Click here to start your experiment with jFed" 
87                                         onclick="return  launchApplication('http://jfed.iminds.be/releases/r1389/webstart/experimenter/jfed-experimenter.jnlp');">
88                     <span class="glyphicon glyphicon-cloud"></span> jFed</a>
89                 </div>
90                 <div class="col-md-3">
91                         <h3>MANAGEMENT</h3>
92                         <div>
93                                 <a href="/portal/institution"><img src="{{ STATIC_URL }}img/icon_authority_color.png" alt="" /></a>
94                         </div>
95                         <div>
96                                 <button id="validaterequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-ok"></span> Validate Requests</button>
97                         </div>
98                 </div>
99                 <div class="col-md-3">
100                         <h3>
101                                 SUPPORT
102                         </h3>
103                         <div>
104                                 <a href="/portal/support"><img src="{{ STATIC_URL }}img/icon_support.png" alt="" /></a>
105                         </div>
106                         <div>
107                                 <button id="ticketbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-envelope"></span> Contact</button>
108                         </div>
109                         <p></p>
110                         <div>
111                         <button id="statbtn" type="button" style="width: 150px;" class="btn btn-default"><span class="glyphicon glyphicon-stats"></span>Testbeds' status</button>
112                         </div>
113                 </div>
114                 
115                 <div class="col-md-3">
116                         <h3>
117                                 ACCOUNT
118                         </h3>
119                         <div>
120                                 <a href="/portal/account/"><img src="{{ STATIC_URL }}img/icon_user_color.png" alt="" /></a>
121                         </div>
122                         <div>
123                                 <button id="logoutbtn" type="button" class="btn btn-default" data-username="{{ username }}"><span class="glyphicon glyphicon-off"></span> Logout</button>
124                         </div>
125                         <div>
126                                 {% if person.last_name %}
127                                         {{person.first_name}} {{person.last_name}}<br />
128                                 {% endif %}
129                         <span class="label">Username:</span> <a href='/portal/account/' title="Click here to see and edit your account details.">{{person.email}}</a>
130                 </div>
131                 </div>
132         </div>
133         {%else%}
134         <div class="row">
135                 <div class="col-md-4">
136                         <h3>
137                                 EXPERIMENT
138                         </h3>
139                         <div>
140                                 <a href="#"><img src="{{ STATIC_URL }}img/icon_slices.png" alt="" /></a>
141                         </div>
142                         <div>
143                                 <button id="slicerequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Request Slice</button>
144                         </div>
145                         <div>
146                                 <p><strong>Your slices </strong>
147                                 <span title="A slice is a set of testbed resources on which you can conduct an experiment. 
148                                         Either ask your colleagues to give you access to an existing slice or request a new slice by clicking 'Request Slice'. 
149                                         However, on the OneLab portal, you will only see slices that you have created through OneLab. If you have created slices elsewhere, 
150                                         such as on the PlanetLab Europe portal, those slices will not appear here."
151                                         class="glyphicon glyphicon-info-sign">
152                                 </span>
153                                 </p>
154                         </div>
155                         <div>   
156                                 <div id="home-slice-list"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
157                         </div>
158                         {% if pending_slices %}
159                         <p><strong>Pending slices</strong>
160                         <span title="Slices that you have requested and are pending for validation by the contact person of your organization."
161                                 class="glyphicon glyphicon-info-sign">
162                         <ul>
163                         {% for slices in pending_slices %}
164                         <li>{{slices}}</li>
165                         {% endfor %}
166                         </ul>
167                         </span>
168                         </p>
169                         {%endif%}
170                         <h3 title="Some tools do their own slice creation and management.">Experiment now</h3>
171                         <a class="btn btn-primary" style="width: 150px;" 
172                     href='http://jfed.iminds.be/releases/r1389/webstart/experimenter/jfed-experimenter.jnlp'
173                                         title="Click here to start your experiment with jFed" 
174                                         onclick="return  launchApplication('http://jfed.iminds.be/releases/r1389/webstart/experimenter/jfed-experimenter.jnlp');">
175                     <span class="glyphicon glyphicon-cloud"></span> jFed</a>    
176                 </div>
177                 <div class="col-md-4">
178                         <h3>
179                                 SUPPORT
180                         </h3>
181                         <div>
182                                 <a href="/portal/support"><img src="{{ STATIC_URL }}img/icon_support.png" alt="" /></a>
183                         </div>
184                         <div>
185                                 <button id="ticketbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-envelope"></span> Contact</button>
186                         </div>
187                         <p></p>
188                         <div>
189                         <button id="statbtn" type="button" style="width: 150px;" class="btn btn-default"><span class="glyphicon glyphicon-stats"></span>Testbeds' status</button>
190                         </div>
191                 </div>
192                 
193                 <div class="col-md-4">
194                         <h3>
195                                 ACCOUNT
196                         </h3>
197                         <div>
198                                 <a href="/portal/account/"><img src="{{ STATIC_URL }}img/icon_user_color.png" alt="" /></a>
199                         </div>
200                         <div>
201                                 <button id="logoutbtn" type="button" class="btn btn-default" data-username="{{ username }}"><span class="glyphicon glyphicon-off"></span> Logout</button>
202                         </div>
203                         <div>
204                                 {% if person.last_name %}
205                                         {{person.first_name}} {{person.last_name}}<br />
206                                 {% endif %}
207                         <span class="label">Username:</span> <a href='/portal/account/' title="Click here to see and edit your account details.">{{person.email}}</a>
208                 </div>
209                 </div>
210         </div>
211         {%endif%}
212
213 </div>
214 {% else %}
215 <div class="container-fluid home">
216         <div class="">
217                 <div class="col-sm-2"></div>
218                 <div class="col-sm-4 slogan">
219                         <h2>
220                                 Fed4FIRE Portal
221                         </h2>
222                         <h3>
223                                 Your easy access to Future Internet Research and Experimentation testbeds belonging to the Fed4FIRE federation.
224                         </h3>
225                         <h3>
226                                  <a href='http://doc.fed4fire.eu'>Want to learn more?</a>
227                         </h3>
228                 </div>
229                 <div class="col-sm-4 col-sm-offset-1" style="width:400px; top:16px; float:left;">
230                         <div class="row">
231                                 {% widget '_widget-login-user.html' %}
232                         </div>
233                 </div>
234                 <div class="col-sm-1"></div>
235         </div>
236 </div>
237 {% endif %}
238
239
240 <script type="text/javascript">
241         $(document).ready(function() {
242                 $('a.home-tab').click(function() {
243                         $('ul.nav-tabs li').removeClass('active');
244                         $(this).parent().addClass('active');
245                         $('div.home-panel').hide();
246                         $('div#'+$(this).data('panel')).show();
247                 });
248                 $('button#validaterequestbtn').click(function() {
249                         window.location="/portal/institution#requests";
250                 });
251                 $('button#ticketbtn').click(function() {
252                         window.location="/portal/contact/";
253                 });
254                 $('button#statbtn').click(function() {
255                 window.location="https://flsmonitor.fed4fire.eu";
256                 });
257                 $('button#signupbtn').click(function() {
258                         window.location="/portal/register/";
259                 });
260                 $('button#slicerequestbtn').click(function() {
261                         window.location="/portal/slice_request/";
262                 });
263
264         /*
265             Launch queries to get the resources and leases in Manifold Cache
266         */
267             
268         $.post("/rest/resource/", function( data ) {
269         });
270         $.post("/rest/lease/", function( data ) {
271         });
272         
273         /*-------
274         List of slices has been moved in 
275         portal/templates/base.html
276         This is now in localStorage 
277         --------*/
278         // myslice.user is in LocalStorage
279         if(myslice.user.slices.length>0){
280             $.each( myslice.user.slices, function(i, val) {
281                 /*
282                 Launch a Query for each slice to get resources and leases in Manifold Cache
283                 */
284                 $.post("/rest/slice/", { 'filters': { 'slice_hrn' : val } }, function(data) {
285                 });
286             });
287         }
288 });
289 </script>
290
291 <!--for jfed tool-->
292 <script type="text/javascript" src="{{STATIC_URL}}js/fed4fire_dtjava_orig.js"></script>
293 <script>
294         function launchApplication(jnlpfile) {
295         dtjava.launch(
296                 { url : jnlpfile },
297             {
298                 javafx : '2.2+',
299                 toolkit: 'swing'
300                 },
301                 {}
302         );
303         return false;
304      }
305 </script>
306 {# widget "_widget-monitor.html" #}
307 {# widget "_widget-stats-top-slices.html" #}
308
309 {% endblock %}