Merge "Fixes a typo"
[pharos-tools.git] / dashboard / src / templates / dashboard / landing.html
1 {% extends "base.html" %}
2 {% load staticfiles %}
3
4 {% block content %}
5 <div class="" style="text-align: center;">
6     {% if not request.user.is_anonymous %}
7     {% if not request.user.userprofile.ssh_public_key %}
8     <div class="alert alert-danger" role="alert">
9         Warning: you need to upload an ssh key under <a href="/accounts/settings">account settings</a> if you wish to
10         log into the servers you book
11     </div>
12     {% endif %}
13     {% else %}
14     {% endif %}
15 </div>
16 {% csrf_token %}
17
18 <style>
19     .wf_create {
20         display: inline-block;
21         text-align: center;
22     }
23
24     .wf_create_div {
25         text-align: center;
26     }
27
28     .hidden_form {
29         display: none;
30     }
31
32     .panel {
33         border: none;
34     }
35
36     .panels {
37         display: grid;
38         grid-template-columns: 33% 34% 33%;
39     }
40
41     .landing_container {
42         display: grid;
43         grid-template-columns: 1fr 30px 1fr;
44     }
45
46     .grid_panel {
47         padding: 30px;
48     }
49
50     .btn-primary {
51         margin: 10px;
52     }
53
54     h2 {
55         border-bottom: 1px solid #cccccc;
56     }
57
58     h1 {}
59 </style>
60 <div class="container-fluid">
61     <div class="row">
62         <!-- About us -->
63         <div class="col-12 col-lg-6 mb-4">
64             <h2>About Us:</h2>
65             <p>The Lab as a Service (LaaS) project aims to help in the development and testing of LFN projects such as
66                 OPNFV
67                 by hosting hardware and providing access to the community. Currently, the only participating lab is the
68                 University of New Hampshire Interoperability Lab (UNH-IOL).</p>
69             <p>To get started, you can request access to a server at the right. PTL's have the ability to design and
70                 book a
71                 whole block of servers with customized layer2 networks (e.g. a Pharos Pod). Read more here: <a
72                     href="https://wiki.opnfv.org/display/INF/Lab+as+a+Service+2.0">LaaS Wiki</a></p>
73         </div>
74         <!-- Get started -->
75         <div class="col-12 col-lg-6 mb-4">
76             <h2>Get Started:</h2>
77             {% if request.user.is_anonymous %}
78             <h4 style="text-align:center;">To get started, please log in with your <a href="/accounts/login">Linux
79                     Foundation Jira account</a></h4>
80             {% else %}
81             <p>To get started, book a server below:</p>
82             <a class="wf_create btn btn-primary"
83                 style="display: flex; flex-direction: column; justify-content: center; margin: 20px; height: 100pt; vertical-align: middle; text-align: center; color: #FFF;"
84                 href="/booking/quick/">
85                 <p style="font-size: xx-large">Book a Server</p>
86             </a>
87             <p>PTLs can use our advanced options to book multi-node pods. If you are a PTL, you may use the options
88                 below:
89             </p>
90             <div class='container'>
91                 <div class="row">
92                     <div class="col-12 col-xl-4">
93                         <button class="wf_create btn btn-primary w-100" onclick="cwf(0)">Book a Pod</button>
94                     </div>
95                     <div class="col-12 col-xl-4">
96                         <button class="wf_create btn btn-primary w-100" onclick="cwf(1)">Design a Pod</button>
97                     </div>
98                     <div class="col-12 col-xl-4">
99                         <button class="wf_create btn btn-primary w-100" onclick="cwf(2)">Configure a Pod</button>
100                     </div>
101                 </div>
102                 {% endif %}
103             </div>
104         </div>
105         <!-- Returning users -->
106         {% if not request.user.is_anonymous %}
107         <div class="col-12 col-lg-6 offset-lg-6 mb-4 mt-lg-4">
108             <h2 class="ht-4">Returning Users:</h2>
109             <p>If you're a returning user, some of the following options may be of interest:</p>
110             <div class="container">
111                 <div class="row">
112                     <div class="col-12 col-xl-4">
113                         <button class="wf_create btn btn-primary w-100" onclick="cwf(3)">Snapshot a Host</button>
114                     </div>
115                     <div class="col-12 col-xl-4">
116                         <a class="wf_create btn btn-primary w-100" href="{% url 'account:my-bookings' %}">My
117                             Bookings</a>
118                     </div>
119                     {% if manager == True %}
120                     <div class="col-12 col-xl-4">
121                         <button class="wf_continue btn btn-primary w-100" onclick="continue_wf()">Resume
122                             Workflow</button>
123                     </div>
124                     {% endif %}
125                 </div>
126             </div>
127         </div>
128         {% endif %}
129     </div>
130 </div>
131
132 <script type="text/javascript">
133     function cwf(type) {
134         $.ajax({
135             type: "POST",
136             url: "/",
137             data: {
138                 "create": type
139             },
140             beforeSend: function (request) {
141                 request.setRequestHeader("X-CSRFToken",
142                     $('input[name="csrfmiddlewaretoken"]').val()
143                 );
144             }
145
146         }).done(function (data) {
147             window.location.replace("/wf/");
148         }).fail(function (jqxHR, textstatus) {
149             alert("Something went wrong...");
150         });
151     }
152
153     function continue_wf() {
154         window.location.replace("/wf/");
155     }
156 </script>
157
158 <div class="hidden_form" id="form_div">
159     <form method="post" action="" class="form" id="wf_selection_form">
160         {% csrf_token %}
161
162         <input type="hidden" id="landing_action">
163
164         <button type="submit" class="btn btn btn-success">
165             Confirm Edit
166         </button>
167     </form>
168 </div>
169
170 {% block vport_comm %}
171 {% endblock %}
172 {% endblock content %}