379547cc32cc83e42cfc68330e561d3a4853d7c3
[unfold.git] / portal / templates / smartfire / smartfire_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 {% widget "_widget-no_credentials.html" %}
10 <div class="container dashboard">
11         {%if 'no_creds'  in user_cred %}
12         <p class="command"><a href="#" style="color:red" data-toggle="modal" data-target="#myModal">NO CREDENTIALS</a> are delegated to the portal!</p>
13     {%endif%}
14         {%if 'creds_expired'  in user_cred %}
15         <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>
16     {%endif%}
17
18         <div class="row">
19                 {% if pi %}
20                 <div class="col-md-3">
21                         <h3>
22                                 EXPERIMENT
23                         </h3>
24                         <div>
25                                 <a href="#"><img src="{{ STATIC_URL }}img/icon_slices.png" alt="" /></a>
26                         </div>
27                         <div>
28                                 <button id="slicerequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Create Slice</button>
29                         </div>
30                         <div>
31                                 <p><strong>Your slices </strong>
32                                         <span title="A slice is a set of testbed resources on which you can conduct an experiment. 
33                                         Either ask your colleagues to give you access to an existing slice or request a new slice by clicking 'Request Slice'. 
34                                         However, on the OneLab portal, you will only see slices that you have created through OneLab. If you have created slices elsewhere, 
35                                         such as on the PlanetLab Europe portal, those slices will not appear here."
36                                         class="glyphicon glyphicon-info-sign">
37                                 </span>
38
39                                 </p>
40                         </div>
41                         <div>   
42                                 <div id="home-slice-list"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
43                         </div>
44                 </div>
45                 <div class="col-md-3">
46                         <h3>MANAGEMENT</h3>
47                         <div>
48                                 <a href="/portal/institution"><img src="{{ STATIC_URL }}img/icon_authority_color.png" alt="" /></a>
49                         </div>
50                         <div>
51                                 <button id="validaterequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-ok"></span> Validate Requests</button>
52                         </div>
53                 </div>
54                 <div class="col-md-3">
55                         <h3>
56                                 SUPPORT
57                         </h3>
58                         <div>
59                                 <a href="/portal/support"><img src="{{ STATIC_URL }}img/icon_support.png" alt="" /></a>
60                         </div>
61                         <div>
62                                 <button id="ticketbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-envelope"></span> Contact</button>
63                         </div>
64                 </div>
65                 
66                 <div class="col-md-3">
67                         <h3>
68                                 ACCOUNT
69                         </h3>
70                         <div>
71                                 <a href="/portal/account/"><img src="{{ STATIC_URL }}img/icon_user_color.png" alt="" /></a>
72                         </div>
73                         <div>
74                                 <button id="logoutbtn" type="button" class="btn btn-default" data-username="{{ username }}"><span class="glyphicon glyphicon-off"></span> Logout</button>
75                         </div>
76                         <div>
77                                 {% if person.last_name %}
78                                         {{person.first_name}} {{person.last_name}}<br />
79                                 {% endif %}
80                         <span class="label">Username:</span> <a href='/portal/account/' title="Click here to see and edit your account details.">{{person.email}}</a>
81                 </div>
82                 </div>
83         </div>
84         {%else%}
85         <div class="row">
86                 <div class="col-md-4">
87                         <h3>
88                                 EXPERIMENT
89                         </h3>
90                         <div>
91                                 <a href="#"><img src="{{ STATIC_URL }}img/icon_slices.png" alt="" /></a>
92                         </div>
93                         <div>
94                                 <button id="slicerequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Request Slice</button>
95                         </div>
96                         <div>
97                                 <p><strong>Your slices </strong>
98                                 <span title="A slice is a set of testbed resources on which you can conduct an experiment. 
99                                         Either ask your colleagues to give you access to an existing slice or request a new slice by clicking 'Request Slice'. 
100                                         However, on the OneLab portal, you will only see slices that you have created through OneLab. If you have created slices elsewhere, 
101                                         such as on the PlanetLab Europe portal, those slices will not appear here."
102                                         class="glyphicon glyphicon-info-sign">
103                                 </span>
104                                 </p>
105                         </div>
106                         <div>   
107                                 <div id="home-slice-list"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
108                         </div>
109                         {% if pending_slices %}
110                         <p><strong>Pending slices</strong>
111                         <span title="Slices that you have requested and are pending for validation by the contact person of your organization."
112                                 class="glyphicon glyphicon-info-sign">
113                         <ul>
114                         {% for slices in pending_slices %}
115                         <li>{{slices}}</li>
116                         {% endfor %}
117                         </ul>
118                         </span>
119                         </p>
120                         {%endif%}       
121                 </div>
122                 <div class="col-md-4">
123                         <h3>
124                                 SUPPORT
125                         </h3>
126                         <div>
127                                 <a href="/portal/support"><img src="{{ STATIC_URL }}img/icon_support.png" alt="" /></a>
128                         </div>
129                         <div>
130                                 <button id="ticketbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-envelope"></span> Contact</button>
131                         </div>
132                 </div>
133                 
134                 <div class="col-md-4">
135                         <h3>
136                                 ACCOUNT
137                         </h3>
138                         <div>
139                                 <a href="/portal/account/"><img src="{{ STATIC_URL }}img/icon_user_color.png" alt="" /></a>
140                         </div>
141                         <div>
142                                 <button id="logoutbtn" type="button" class="btn btn-default" data-username="{{ username }}"><span class="glyphicon glyphicon-off"></span> Logout</button>
143                         </div>
144                         <div>
145                                 {% if person.last_name %}
146                                         {{person.first_name}} {{person.last_name}}<br />
147                                 {% endif %}
148                         <span class="label">Username:</span> <a href='/portal/account/' title="Click here to see and edit your account details.">{{person.email}}</a>
149                 </div>
150                 </div>
151         </div>
152         {%endif%}
153
154 </div>
155 {% else %}
156 <div class="container-fluid home">
157         <div class="">
158                 <div class="col-sm-2"></div>
159                 <div class="col-sm-4 slogan">
160                         <h2>
161                                 Your Easy Access to Computer Networking Testbeds:
162                         </h2>
163                         <h3>
164                                 A wide variety of world class testbeds available through your one account
165                         </h3>
166                 </div>
167                 <div class="col-sm-5 col-sm-offset-1">
168                         <div class="row">
169                                 {% widget '_widget-login-user.html' %}
170                         </div>
171                 </div>
172                 <div class="col-sm-1"></div>
173         </div>
174 </div>
175 {% endif %}
176
177
178 <script type="text/javascript">
179         $(document).ready(function() {
180                 $('a.home-tab').click(function() {
181                         $('ul.nav-tabs li').removeClass('active');
182                         $(this).parent().addClass('active');
183                         $('div.home-panel').hide();
184                         $('div#'+$(this).data('panel')).show();
185                 });
186                 $('button#validaterequestbtn').click(function() {
187                         window.location="/portal/institution#requests";
188                 });
189                 $('button#ticketbtn').click(function() {
190                         window.location="/portal/contact/";
191                 });
192                 $('button#signupbtn').click(function() {
193                         window.location="/portal/register/";
194                 });
195                 $('button#slicerequestbtn').click(function() {
196                         window.location="/portal/slice_request/";
197                 });
198
199         myslice.loadSlices();
200         
201 });
202 </script>
203
204 {% endblock %}