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