a7871ba2faadcb98c4caacb79ab8fb19eff21b23
[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                 </div>
147                 <div class="col-md-4">
148                         <h3>
149                                 SUPPORT
150                         </h3>
151                         <div>
152                                 <a href="/portal/support"><img src="{{ STATIC_URL }}img/icon_support.png" alt="" /></a>
153                         </div>
154                         <div>
155                                 <button id="ticketbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-envelope"></span> Contact</button>
156                         </div>
157                 </div>
158                 
159                 <div class="col-md-4">
160                         <h3>
161                                 ACCOUNT
162                         </h3>
163                         <div>
164                                 <a href="/portal/account/"><img src="{{ STATIC_URL }}img/icon_user_color.png" alt="" /></a>
165                         </div>
166                         <div>
167                                 <button id="logoutbtn" type="button" class="btn btn-default" data-username="{{ username }}"><span class="glyphicon glyphicon-off"></span> Logout</button>
168                         </div>
169                         <div>
170                                 {% if person.last_name %}
171                                         {{person.first_name}} {{person.last_name}}<br />
172                                 {% endif %}
173                         <span class="label">Username:</span> <a href='/portal/account/' title="Click here to see and edit your account details.">{{person.email}}</a>
174                 </div>
175                 </div>
176         </div>
177         {%endif%}
178
179 </div>
180 {% else %}
181 <div class="container-fluid home">
182         <div class="">
183                 <div class="col-sm-2"></div>
184                 <div class="col-sm-4 slogan">
185                         <h2>
186                                 Your Easy Access to Computer Networking Testbeds:
187                         </h2>
188                         <h3>
189                                 A wide variety of world class testbeds available through your one account
190                         </h3>
191                 </div>
192                 <div class="col-sm-5 col-sm-offset-1">
193                         <div class="row">
194                                 {% widget '_widget-login-user.html' %}
195                         </div>
196                 </div>
197                 <div class="col-sm-1"></div>
198         </div>
199 </div>
200 {% endif %}
201
202
203 <script type="text/javascript">
204         $(document).ready(function() {
205                 $('a.home-tab').click(function() {
206                         $('ul.nav-tabs li').removeClass('active');
207                         $(this).parent().addClass('active');
208                         $('div.home-panel').hide();
209                         $('div#'+$(this).data('panel')).show();
210                 });
211                 $('button#validaterequestbtn').click(function() {
212                         window.location="/portal/institution#requests";
213                 });
214                 $('button#ticketbtn').click(function() {
215                         window.location="/portal/contact/";
216                 });
217                 $('button#signupbtn').click(function() {
218                         window.location="/portal/register/";
219                 });
220                 $('button#slicerequestbtn').click(function() {
221                         window.location="/portal/slice_request/";
222                 });
223 /*-------
224 List of slices has been moved in 
225 portal/templates/base.html
226 This should go into session
227 --------*/
228 });
229 </script>
230 {# widget "_widget-monitor.html" #}
231 {# widget "_widget-stats-top-slices.html" #}
232
233 {% endblock %}