Make host entries prettier on Define Hardware step
[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         <h4 style="display: inline; text-align: center; border: 3px solid red; padding: 10px; border-radius: 10000px; height: 40px;">
9             Warning: you need to upload an ssh key under <a href="/accounts/settings">account settings</a> if you wish to log into the servers you book
10         </h4>
11         {% endif %}
12         {% else %}
13         {% endif %}
14     </div>
15 {% csrf_token %}
16
17 <style>
18     .wf_create{
19         display: inline-block;
20         text-align: center;
21     }
22     .wf_create_div{
23         text-align: center;
24     }
25     .hidden_form{
26         display: none;
27     }
28
29     .panel {
30         border: none;
31     }
32
33     .panels {
34         display: grid;
35         grid-template-columns: 33% 34% 33%;
36     }
37
38     .landing_container {
39         display: grid;
40         grid-template-columns: 1fr 30px 1fr;
41     }
42     .grid_panel {
43         padding: 30px;
44     }
45     .btn-primary {
46         margin: 10px;
47     }
48     h2 {
49         border-bottom: 1px solid #cccccc;
50     }
51     h1 {
52     }
53 </style>
54 <div class="landing_container">
55     <div class="info_panel grid_panel">
56         <h2>About Us:</h2>
57         <p>The Lab as a Service (LaaS) project aims to help in the development and testing of LFN projects such as OPNFV by hosting hardware and providing access to the community. Currently, the only participating lab is the University of New Hampshire Interoperability Lab (UNH-IOL).</p>
58         <p>To get started, you can request access to a server at the right. PTL's have the ability to design and book a whole block of servers with customized layer2 networks (e.g. a Pharos Pod). Read more here: <a href="https://wiki.opnfv.org/display/INF/Lab+as+a+Service+2.0">LaaS Wiki</a></p>
59
60         {% if not request.user.is_anonymous %}
61         <h2 style="margin-top: 50px;">Returning Users:</h2>
62         <p>If you're a returning user, some of the following options may be of interest:</p>
63         <button class="wf_create btn btn-primary" onclick="cwf(3)">Snapshot a Host</button>
64         <a class="wf_create btn btn-primary" href="{% url 'account:my-bookings' %}">My Bookings</a>
65         {% if manager == True %}
66         <button class="wf_continue btn btn-primary" onclick="continue_wf()">Continue Unfinished Workflow</button>
67         {% endif %}
68         {% endif %}
69     </div>
70     <div class="">
71     </div>
72     <div class="actions_panel grid_panel">
73         <h2>Get Started:</h2>
74         {% if request.user.is_anonymous %}
75             <h4 style="text-align:center;">To get started, please log in with your <a href="/accounts/login">Linux Foundation Jira account</a></h4>
76         {% else %}
77         <p>To get started, book a server below:</p>
78         <a class="wf_create btn btn-primary" style="display: flex; flex-direction: column; justify-content: center; margin: 20px; height: 100pt; vertical-align: middle; text-align: center; color: #FFF;" href="/booking/quick/"><p style="font-size: xx-large">Book a Server</p></a>
79         <p>PTLs can use our advanced options to book multi-node pods. If you are a PTL, you may use the options below:</p>
80         <div class='wf_create_div'>
81
82                 <button class="wf_create btn btn-primary" onclick="cwf(0)">Book a Pod</button>
83                 <button class="wf_create btn btn-primary" onclick="cwf(1)">Design a Pod</button>
84                 <button class="wf_create btn btn-primary" onclick="cwf(2)">Configure a Pod</button>
85         {% endif %}
86         </div>
87     </div>
88 </div>
89
90
91
92
93
94 <script type="text/javascript">
95     function cwf(type)
96     {
97         $.ajax({
98             type: "POST",
99             url: "/",
100             data: {"create":type},
101             beforeSend: function(request) {
102                 request.setRequestHeader("X-CSRFToken",
103                 $('input[name="csrfmiddlewaretoken"]').val()
104                 );
105             }
106
107         }).done(function (data) {
108             window.location.replace("/wf/");
109         }).fail(function(jqxHR, textstatus) {
110             alert("Something went wrong...");});
111     }
112     function continue_wf()
113     {
114         window.location.replace("/wf/");
115     }
116
117 </script>
118
119 <div class="hidden_form" id="form_div">
120     <form method="post" action="" class="form" id="wf_selection_form">
121         {% csrf_token %}
122
123         <input type="hidden" id="landing_action">
124
125         <button type="submit" class="btn btn btn-success">
126             Confirm Edit
127         </button>
128     </form>
129 </div>
130
131 {% block vport_comm %}
132 {% endblock %}
133 {% endblock content %}