Lab as a Service 2.0
[laas.git] / src / templates / base.html
1 {% extends "layout.html" %}
2 {% load bootstrap3 %}
3 {% load staticfiles %}
4 {% block extrahead %}
5
6
7     <!-- Custom CSS -->
8     <link href="{% static "bower_components/startbootstrap-sb-admin-2-blackrockdigital/dist/css/sb-admin-2.min.css" %}"
9           rel="stylesheet">
10     <link href="{% static "css/theme.css" %}" rel="stylesheet">
11
12 <script type="text/javascript">
13     function cwf(type)
14     {
15         $.ajax({
16             type: "POST",
17             url: "/",
18             data: {"create":type},
19             beforeSend: function(request) {
20                 request.setRequestHeader("X-CSRFToken",
21                 $('input[name="csrfmiddlewaretoken"]').val()
22                 );
23             }
24         }).done(function (data) {
25             window.location.replace("/wf/");
26         }).fail(function(jqxHR, textstatus) {
27             alert("Something went wrong...");});
28     }
29        function continue_wf()
30     {
31         window.location.replace("/wf/");
32     }
33
34     function toggle_create_drop()
35     {
36         drop_div = document.getElementById("create_drop");
37
38         if (drop_div.style.display === "none")
39         {
40             drop_div.style.display = "inherit";
41         }
42         else
43         {
44             drop_div.style.display = "none";
45         }
46     }
47 </script>
48 <style>
49     .create_drop {
50         display: none;
51         width: 100%;
52     }
53
54     .create_drop button {
55         width: 100%;
56     }
57
58     .drop_btn {
59         border-radius: 0px;
60         background-color: CCCCCC
61     }
62
63     .drop_btn:hover {
64         color: #555;
65         border-top: 1px solid #E7E7E7;
66         border-bottom: 1px solid #E7E7E7;
67     }
68 </style>
69
70 {% endblock %}
71 {% block basecontent %}
72     <div id="wrapper">
73         <!-- Navigation -->
74         <nav class="navbar navbar-default navbar-static-top" role="navigation"
75              style="margin-bottom: 0">
76             <div class="navbar-header">
77                 <button type="button" class="navbar-toggle" data-toggle="collapse"
78                         data-target=".navbar-collapse">
79                     <span class="sr-only">Toggle navigation</span>
80                     <span class="icon-bar"></span>
81                     <span class="icon-bar"></span>
82                     <span class="icon-bar"></span>
83                 </button>
84                 <a href="https://www.opnfv.org/" class="navbar-left"><img
85                         src="{% static "img/opnfv-logo.png" %}"></a>
86                 <a class="navbar-brand" href={% url 'dashboard:index' %}>Pharos Dashboard</a>
87             </div>
88             <!-- /.navbar-header -->
89
90             <ul class="nav navbar-top-links navbar-right">
91                 <li class="dropdown">
92                     <a class="dropdown-toggle" data-toggle="dropdown" href="#">
93                         <i class="fa fa-user fa-fw"></i> <i class="fa fa-caret-down"></i>
94                     </a>
95                     <ul class="dropdown-menu dropdown-user">
96                         {% if user.is_authenticated %}
97                             <li><a href="{% url 'account:settings' %}"><i
98                                     class="fa fa-gear fa-fw"></i>
99                                 Settings</a>
100                             </li>
101                             <li class="divider"></li>
102                             <li><a href="{% url 'account:logout' %}?next={{ request.path }}"><i
103                                     class="fa fa-sign-out fa-fw"></i>
104                                 Logout</a>
105                             </li>
106                         {% else %}
107                             <li><a href="{% url 'account:login' %}"><i
108                                     class="fa fa-sign-in fa-fw"></i>
109                                 Login with Jira</a>
110                             <li>
111                         {% endif %}
112                     </ul>
113                     <!-- /.dropdown-user -->
114                 </li>
115                 <!-- /.dropdown -->
116             </ul>
117             <!-- /.navbar-top-links -->
118
119             <div class="navbar-default sidebar" role="navigation">
120                 <div class="sidebar-nav navbar-collapse">
121                     <ul class="nav" id="side-menu">
122                         <li>
123                             <a href="/"><i class="fa fa-fw"></i>Home</a>
124                         </li>
125                         <li style="width: 100%;">
126                             <a href="javascript:toggle_create_drop();"><i class="fa fa-fw"></i>Create<i
127                                     class="fa fa-fw fa-caret-down"></i>
128                                 </a>
129                                 {% csrf_token %}
130                                 <div id="create_drop" class="create_drop" style="display:none">
131                                     <button class="btn drop_btn" onclick="cwf(0)">Create a Booking</button>
132                                     <button class="btn drop_btn" onclick="cwf(1)">Create a Pod</button>
133                                     <button class="btn drop_btn" onclick="cwf(2)">Configure a Pod</button>
134                                     <button class="btn drop_btn" onclick="cwf(3)">Create a Snapshot</button>
135                                 </div>
136                         </li>
137                         <li>
138                             <a href="{% url 'resource:hosts' %}"><i
139                                     class="fa fa-fw"></i>Hosts
140                                 </a>
141                         </li>
142                         {% if user.is_authenticated %}
143                         <li>
144                             <a href="{% url 'account:users' %}"><i
145                                     class="fa fa-fw"></i>User List
146                             </a>
147                         </li>
148                         {% endif %}
149                         <li>
150                             <a href="{% url 'booking:list' %}"><i
151                                     class="fa fa-fw"></i>Booking List
152                             </a>
153                         </li>
154                         <li>
155                             <a href="{% url 'booking:stats' %}"><i
156                                     class="fa fa-fw"></i>Booking Statistics</a>
157                         </li>
158                         <li>
159                             <a href="{% url 'api-root' %}"><i
160                                     class="fa fa-fw"></i>API
161                             </a>
162                         </li>
163                         <li>
164                             <a href="{% url 'account:my-account' %}"><i
165                                     class="fa fa-fw"></i>Account
166                             </a>
167                         </li>
168                         <li>
169                             <a href="{% url 'dashboard:all_labs' %}"><i
170                                     class="fa fa-fw"></i>Lab Info
171                             </a>
172                         </li>
173                         <li>
174                             <a href="{% url 'notifier:messages' %}"><i
175                                     class="fa fa-fw"></i>Inbox
176                             </a>
177                         </li>
178                     </ul>
179                 </div>
180                 <!-- /.sidebar-collapse -->
181             </div>
182             <!-- /.navbar-static-side -->
183         </nav>
184
185         <!-- Page Content -->
186         <div id="page-wrapper">
187             {% if title %}
188             <div class="row">
189                 <div class="col-lg-12">
190                     <h1 class="page-header">{{ title }}</h1>
191                 </div>
192                 <!-- /.col-lg-12 -->
193             </div>
194             {% endif %}
195             <div id="bsm">{% bootstrap_messages %}</div>
196
197             {% block content %}
198
199             {% endblock content %}
200         </div>
201         <!-- /#page-wrapper -->
202     </div>
203     <!-- /#wrapper -->
204 {% endblock basecontent %}