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