Lab as a Service 2.0
[laas.git] / src / templates / booking / steps / resource_select.html
1 {% extends "workflow/viewport-element.html" %}
2 {% load staticfiles %}
3
4 {% load bootstrap3 %}
5
6 {% block content %}
7
8 <style>
9     #resource_form_div {
10         width: 100%;
11         padding: 5%;
12     }
13
14     .panel {
15         /*border: solid 1px black;*/
16         border: none;
17     }
18     .select_panels {
19         width: 100%;
20         display: grid;
21         grid-template-columns: 45% 10% 45%;
22
23     }
24
25     .panel_center {
26         text-align: center;
27         border: none;
28
29
30     }
31     .panel_center p{
32         font-size: 20pt;
33     }
34 </style>
35
36 <div id="resource_form_div">
37     <div class="select_panels">
38         <div class="panel_chooser panel">
39     <form id="resource_select_form" method="post" action="" class="form" id="resourceselectorform">
40         {% csrf_token %}
41         {{ form|default:"<p>no form loaded</p>" }}
42         {% buttons %}
43
44         {% endbuttons %}
45     </form>
46     </div>
47     <div class="panel_center panel"><p>OR</p></div>
48     <div class="panel_add panel">
49         <button class="btn {% if disabled %} disabled {% endif %}"
50         style="width: 100%; height: 100%;"
51         {% if not disabled %}onclick="parent.add_wf(1)"
52         {% endif %}>Create Resource</button>
53     </div>
54
55 </div>
56 </div>
57 <script>
58     {% if disabled %}
59     disable();
60     {% endif %}
61 </script>
62
63 {% endblock content %}
64 {% block onleave %}
65 var form = $("#resource_select_form");
66 var formData = form.serialize();
67 var req = new XMLHttpRequest();
68 req.open("POST", "/wf/workflow/", false);
69 req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
70 req.onerror = function() { alert("problem with form submission"); }
71 req.send(formData);
72 {% endblock %}
73