Merge "Add Quick-Booking Workflow"
[laas.git] / src / templates / dashboard / landing.html
1 {% extends "base.html" %}
2 {% load staticfiles %}
3
4 {% block content %}
5     <div class="">
6         {% if not request.user.is_anonymous %}
7         {% if not request.user.userprofile.ssh_public_key %}
8         <h4 style="text-align: center; background: #AA0000; color: #FFFFFF; padding: 10px; border-radius: 3px; 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             <p style="text-align:center;">Welcome to the Pharos Dashboard! For more info on LaaS, <a href="https://wiki.opnfv.org/display/INF/Lab+as+a+Service+2.0">check here</a>. To get started, select one of the options below:</p>
13         {% else %}
14             <p style="text-align:center;">Welcome to the Pharos Dashboard! For more info on LaaS, <a href="https://wiki.opnfv.org/display/INF/Lab+as+a+Service+2.0">check here</a>. To get started, please log in with your <a href="/accounts/login">Linux Foundation Jira account</a></p>
15         {% endif %}
16     </div>
17 {% csrf_token %}
18
19 <style>
20     .wf_create{
21         display: inline-block;
22         text-align: center;
23     }
24     .wf_create_div{
25         text-align: center;
26     }
27     .hidden_form{
28         display: none;
29     }
30
31     .panel {
32         border: none;
33     }
34
35     .panels {
36         display: grid;
37         grid-template-columns: 33% 34% 33%;
38     }
39 </style>
40 {% if not request.user.is_anonymous %}
41 <div class='wf_create_div'>
42 <a class="wf_create btn btn-primary" style="color: #FFF;" href="/booking/quick/">Create a Quick Booking</a>
43 <button class="wf_create btn btn-primary" onclick="cwf(0)">Create a Booking</button>
44 <button class="wf_create btn btn-primary" onclick="cwf(1)">Create a Pod</button>
45 <button class="wf_create btn btn-primary" onclick="cwf(2)">Configure a Pod</button>
46 <button class="wf_create btn btn-primary" onclick="cwf(3)">Create a Snapshot</button>
47 {% if manager == True %}
48 <button class="wf_continue btn btn-primary" onclick="continue_wf()">Finish Unfinished Business</button>
49 {% endif %}
50 {% endif %}
51 </div>
52
53 <script type="text/javascript">
54     function cwf(type)
55     {
56         $.ajax({
57             type: "POST",
58             url: "/",
59             data: {"create":type},
60             beforeSend: function(request) {
61                 request.setRequestHeader("X-CSRFToken",
62                 $('input[name="csrfmiddlewaretoken"]').val()
63                 );
64             }
65
66         }).done(function (data) {
67             window.location.replace("/wf/");
68         }).fail(function(jqxHR, textstatus) {
69             alert("Something went wrong...");});
70     }
71     function continue_wf()
72     {
73         window.location.replace("/wf/");
74     }
75
76 </script>
77
78 <div class="hidden_form" id="form_div">
79     <form method="post" action="" class="form" id="wf_selection_form">
80         {% csrf_token %}
81
82         <input type="hidden" id="landing_action">
83
84         <button type="submit" class="btn btn btn-success">
85             Confirm Edit
86         </button>
87     </form>
88 </div>
89
90 {% block vport_comm %}
91 {% endblock %}
92 {% endblock content %}