Implement OPNFV workflow
[laas.git] / src / templates / config_bundle / steps / table_formset.html
1 {% extends "workflow/viewport-element.html" %}
2 {% load staticfiles %}
3
4 {% load bootstrap3 %}
5
6 {% block extrahead %}
7     <!-- DataTables CSS -->
8     <link href="{% static "bower_components/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.css" %}"
9           rel="stylesheet">
10
11     <!-- DataTables Responsive CSS -->
12     <link href="{% static "bower_components/datatables-responsive/css/dataTables.responsive.css" %}" rel="stylesheet">
13 {% endblock extrahead %}
14
15 {% block content %}
16 {% if error %}
17     <h1 style="text-align:center;">{{ error }}</h1>
18 {% else %}
19 <div style="padding: 5%;">
20     <form method="post" action="" class="form" id="table_formset">
21         {% csrf_token %}
22
23         <div class="row">
24             <div class="col-lg-12">
25                 <div class="dataTables_wrapper">
26                     <table class="table table-striped table-bordered table-hover" id="table" cellspacing="0" width="100%">
27
28                         {% block table %}
29                         {% endblock table %}
30
31                     </table>
32                 </div>
33             </div>
34         </div>
35     </form>
36 </div>
37
38 {% endif %}
39 {% endblock content %}
40
41 {% block extrajs %}
42     {{ block.super }}
43     <!-- DataTables JavaScript -->
44
45     <script src={% static "bower_components/datatables/media/js/jquery.dataTables.min.js" %}></script>
46     <script src={% static "bower_components/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.min.js" %}></script>
47
48     <script src={% static "js/dataTables-sort.js" %}></script>
49
50     {% block tablejs %}
51     {% endblock tablejs %}
52 {% endblock extrajs %}
53
54
55 {% block onleave %}
56 var form = $("#table_formset");
57 var formData = form.serialize();
58 var req = new XMLHttpRequest();
59 req.open("POST", "/wf/workflow/", false);
60 req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
61 req.onerror = function() { alert("problem with form submission"); }
62 req.send(formData);
63 {% endblock %}