Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into onelab
[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 <div class="container dashboard">
10         <div class="row">
11                 {%if 'is_pi'  in pi %}
12                 <div class="col-md-3">
13                         <h3>
14                                 EXPERIMENT
15                         </h3>
16                         <div>
17                                 <a href="#"><img src="{{ STATIC_URL }}img/icon_slices.png" alt="" /></a>
18                         </div>
19                         <div>
20                                 <button id="slicerequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Request Slice</button>
21                         </div>
22                         <div>
23                                 <p><strong>Your slices </strong>
24                                         <span title="A slice is a set of testbed resources on which you can conduct an experiment. 
25                                         Either ask your colleagues to give you access to an existing slice or request a new slice by clicking 'Request Slice'." 
26                                         class="glyphicon glyphicon-info-sign">
27                                         </span>
28                                 </p>
29                         </div>
30                         <div>   
31                                 <div id="home-slice-list"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
32                         </div>
33                 </div>
34                 <div class="col-md-3">
35                         <h3>MANAGEMENT</h3>
36                         <div>
37                                 <a href="/portal/institution"><img src="{{ STATIC_URL }}img/icon_authority_color.png" alt="" /></a>
38                         </div>
39                         <div>
40                                 <button id="validaterequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-ok"></span> Validate Requests</button>
41                         </div>
42                 </div>
43                 <div class="col-md-3">
44                         <h3>
45                                 SUPPORT
46                         </h3>
47                         <div>
48                                 <a href="/portal/support"><img src="{{ STATIC_URL }}img/icon_support.png" alt="" /></a>
49                         </div>
50                         <div>
51                                 <button id="ticketbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-envelope"></span> Contact</button>
52                         </div>
53                 </div>
54                 
55                 <div class="col-md-3">
56                         <h3>
57                                 ACCOUNT
58                         </h3>
59                         <div>
60                                 <a href="/portal/account/"><img src="{{ STATIC_URL }}img/icon_user_color.png" alt="" /></a>
61                         </div>
62                         <div>
63                                 <button id="logoutbtn" type="button" class="btn btn-default" data-username="{{ username }}"><span class="glyphicon glyphicon-off"></span> Logout</button>
64                         </div>
65                         <div>
66                                 {% if person.last_name %}
67                                         {{person.first_name}} {{person.last_name}}<br />
68                                 {% endif %}
69                         <span class="label">Username:</span> <a href='/portal/account/' title="Click here to see and edit your account details.">{{person.email}}</a>
70                 </div>
71                 </div>
72         </div>
73         {%else%}
74         <div class="row">
75                 <div class="col-md-4">
76                         <h3>
77                                 EXPERIMENT
78                         </h3>
79                         <div>
80                                 <a href="#"><img src="{{ STATIC_URL }}img/icon_slices.png" alt="" /></a>
81                         </div>
82                         <div>
83                                 <button id="slicerequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Request Slice</button>
84                         </div>
85                         <div>
86                                 <p><strong>Your slices </strong>
87                                 <span title="A slice is a set of testbed resources on which you can conduct an experiment. 
88                                         Either ask your colleagues to give you access to an existing slice or request a new slice by clicking 'Request Slice'." 
89                                         class="glyphicon glyphicon-info-sign">
90                                 </span>
91                                 </p>
92                         </div>
93                         <div>   
94                                 <div id="home-slice-list"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
95                         </div>
96                 </div>
97                 <div class="col-md-4">
98                         <h3>
99                                 SUPPORT
100                         </h3>
101                         <div>
102                                 <a href="/portal/support"><img src="{{ STATIC_URL }}img/icon_support.png" alt="" /></a>
103                         </div>
104                         <div>
105                                 <button id="ticketbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-envelope"></span> Contact</button>
106                         </div>
107                 </div>
108                 
109                 <div class="col-md-4">
110                         <h3>
111                                 ACCOUNT
112                         </h3>
113                         <div>
114                                 <a href="/portal/account/"><img src="{{ STATIC_URL }}img/icon_user_color.png" alt="" /></a>
115                         </div>
116                         <div>
117                                 <button id="logoutbtn" type="button" class="btn btn-default" data-username="{{ username }}"><span class="glyphicon glyphicon-off"></span> Logout</button>
118                         </div>
119                         <div>
120                                 {% if person.last_name %}
121                                         {{person.first_name}} {{person.last_name}}<br />
122                                 {% endif %}
123                         <span class="label">Username:</span> <a href='/portal/account/' title="Click here to see and edit your account details.">{{person.email}}</a>
124                 </div>
125                 </div>
126         </div>
127         {%endif%}
128
129 </div>
130 {% else %}
131 <div class="container-fluid home">
132         <div class="">
133                 <div class="col-sm-2"></div>
134                 <div class="col-sm-4 slogan">
135                         <h2>
136                                 Your Easy Access to Computer Networking Testbeds:
137                         </h2>
138                         <h3>
139                                 A wide variety of world class testbeds available through your one account
140                         </h3>
141                 </div>
142                 <div class="col-sm-5 col-sm-offset-1">
143                         <div class="row">
144                                 {% widget '_widget-login-user.html' %}
145                         </div>
146                 </div>
147                 <div class="col-sm-1"></div>
148         </div>
149 </div>
150 {% endif %}
151
152
153 <script type="text/javascript">
154         $(document).ready(function() {
155                 $('a.home-tab').click(function() {
156                         $('ul.nav-tabs li').removeClass('active');
157                         $(this).parent().addClass('active');
158                         $('div.home-panel').hide();
159                         $('div#'+$(this).data('panel')).show();
160                 });
161                 $('button#validaterequestbtn').click(function() {
162                         window.location="/portal/institution#requests";
163                 });
164                 $('button#ticketbtn').click(function() {
165                         window.location="/portal/contact/";
166                 });
167                 $('button#signupbtn').click(function() {
168                         window.location="/portal/register/";
169                 });
170                 $('button#slicerequestbtn').click(function() {
171                         window.location="/portal/slice_request/";
172                 });
173 /*-------
174 List of slices has been moved in 
175 portal/templates/base.html
176 This should go into session
177 --------*/
178 });
179 </script>
180 {% endblock %}