aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorParker Berberian <pberberian@iol.unh.edu>2019-07-03 13:15:06 +0000
committerGerrit Code Review <gerrit@opnfv.org>2019-07-03 13:15:06 +0000
commit9e22f1782fd81a915d71d47aecc84955f9b996bc (patch)
tree4861a816c2c2176e868a078e04e350757a6c7e1a /src
parente3389d42758feef5dad48e0bbcd5a0a3f6af4206 (diff)
parent7cb4c3f79394a59e0276510261550ca6bb3a4fdf (diff)
Merge "Remove onleave + make form id's consistent"
Diffstat (limited to 'src')
-rw-r--r--src/templates/booking/steps/booking_meta.html12
-rw-r--r--src/templates/config_bundle/steps/config_software.html12
-rw-r--r--src/templates/config_bundle/steps/define_software.html9
-rw-r--r--src/templates/config_bundle/steps/pick_installer.html12
-rw-r--r--src/templates/config_bundle/steps/table_formset.html13
-rw-r--r--src/templates/resource/steps/define_hardware.html10
-rw-r--r--src/templates/resource/steps/host_info.html11
-rw-r--r--src/templates/resource/steps/meta_info.html12
-rw-r--r--src/templates/resource/steps/pod_definition.html2
-rw-r--r--src/templates/snapshot_workflow/steps/meta.html12
-rw-r--r--src/templates/snapshot_workflow/steps/select_host.html12
11 files changed, 10 insertions, 107 deletions
diff --git a/src/templates/booking/steps/booking_meta.html b/src/templates/booking/steps/booking_meta.html
index a7bb8b9..f12496e 100644
--- a/src/templates/booking/steps/booking_meta.html
+++ b/src/templates/booking/steps/booking_meta.html
@@ -6,7 +6,7 @@
{% block content %}
{% bootstrap_form_errors form type='non_fields' %}
-<form id="booking_meta_form" action="/wf/workflow/" method="POST" class="form">
+<form id="step_form" method="POST" class="form">
{% csrf_token %}
<div id="form_div" class="container-fluid">
<div class="row">
@@ -36,13 +36,3 @@
</div>
</form>
{% endblock content %}
-
-{% block onleave %}
-var ajaxForm = $("#booking_meta_form");
-var formData = ajaxForm.serialize();
-req = new XMLHttpRequest();
-req.open("POST", "/wf/workflow/", false);
-req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
-req.onerror = function() { alert("problem submitting form"); }
-req.send(formData);
-{% endblock %}
diff --git a/src/templates/config_bundle/steps/config_software.html b/src/templates/config_bundle/steps/config_software.html
index 68417bc..6fe0ac1 100644
--- a/src/templates/config_bundle/steps/config_software.html
+++ b/src/templates/config_bundle/steps/config_software.html
@@ -5,7 +5,7 @@
{% block content %}
-<form action="/wf/workflow/" method="POST" id="software_config_form" class="form">
+<form method="POST" id="step_form" class="form">
{% csrf_token %}
<p>Give it a name:</p>
{% bootstrap_field form.name %}
@@ -16,13 +16,3 @@
{% endblock content %}
-
-{% block onleave %}
-var ajaxForm = $("#software_config_form");
-var formData = ajaxForm.serialize();
-req = new XMLHttpRequest();
-req.open("POST", "/wf/workflow/", false);
-req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
-req.onerror = function() { alert("problem submitting form"); }
-req.send(formData);
-{% endblock %}
diff --git a/src/templates/config_bundle/steps/define_software.html b/src/templates/config_bundle/steps/define_software.html
index 87e5997..7c47569 100644
--- a/src/templates/config_bundle/steps/define_software.html
+++ b/src/templates/config_bundle/steps/define_software.html
@@ -44,12 +44,3 @@ for(var i=0; i<parents.length; i++){
checkbox.value = "True";
}
}
-
-var form = $("#table_formset");
-var formData = form.serialize();
-var req = new XMLHttpRequest();
-req.open("POST", "/wf/workflow/", false);
-req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
-req.onerror = function() { alert("problem with form submission"); }
-req.send(formData);
-{% endblock onleave %}
diff --git a/src/templates/config_bundle/steps/pick_installer.html b/src/templates/config_bundle/steps/pick_installer.html
index 31a06de..c3b505d 100644
--- a/src/templates/config_bundle/steps/pick_installer.html
+++ b/src/templates/config_bundle/steps/pick_installer.html
@@ -9,7 +9,7 @@
<h1>Please choose a config bundle first</h1>
{% else %}
-<form id="installer_form" action="/wf/workflow/" method="POST" id="installer_config_form" class="form">
+<form id="step_form" method="POST" class="form">
{% csrf_token %}
<p>Choose your installer:</p>
{% bootstrap_field form.installer %}
@@ -20,13 +20,3 @@
{% endif %}
{% endblock content %}
-
-{% block onleave %}
-var form = $("#installer_form");
-var formData = form.serialize();
-var req = new XMLHttpRequest();
-req.open("POST", "/wf/workflow/", false);
-req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
-req.onerror = function() { alert("problem with form submission"); }
-req.send(formData);
-{% endblock %}
diff --git a/src/templates/config_bundle/steps/table_formset.html b/src/templates/config_bundle/steps/table_formset.html
index e19f3df..d25621e 100644
--- a/src/templates/config_bundle/steps/table_formset.html
+++ b/src/templates/config_bundle/steps/table_formset.html
@@ -18,7 +18,7 @@
<h1 class="text-center">{{ error }}</h1>
{% else %}
<div class="p-2">
- <form method="post" action="" class="form" id="table_formset">
+ <form method="post" class="form" id="step_form"> <!-- formset, requires special consideration -->
{% csrf_token %}
<div class="row">
@@ -51,14 +51,3 @@
{% block tablejs %}
{% endblock tablejs %}
{% endblock extrajs %}
-
-
-{% block onleave %}
-var form = $("#table_formset");
-var formData = form.serialize();
-var req = new XMLHttpRequest();
-req.open("POST", "/wf/workflow/", false);
-req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
-req.onerror = function() { alert("problem with form submission"); }
-req.send(formData);
-{% endblock %}
diff --git a/src/templates/resource/steps/define_hardware.html b/src/templates/resource/steps/define_hardware.html
index 57078e9..33a7d8e 100644
--- a/src/templates/resource/steps/define_hardware.html
+++ b/src/templates/resource/steps/define_hardware.html
@@ -9,16 +9,8 @@ As you make your selections, labs and hosts that are not compatible
with your current configuration will become unavailable.</p>
<h4>NOTE: Only PTL's are able to create multi-node PODs. See <a href="https://google.com">here</a>
for more details</h4>
-<form id="define_hardware_form" action="/wf/workflow/" method="post">
+<form id="step_form" method="post">
{% csrf_token %}
{{form.filter_field|default:"<p>No Form</p>"}}
</form>
{% endblock content %}
-{% block onleave %}
-multi_filter_widget.finish();
-var formData = $("#define_hardware_form").serialize();
-req = new XMLHttpRequest();
-req.open('POST', '/wf/workflow/', false);
-req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
-req.send(formData);
-{% endblock %}
diff --git a/src/templates/resource/steps/host_info.html b/src/templates/resource/steps/host_info.html
index bbbafdc..3230d8f 100644
--- a/src/templates/resource/steps/host_info.html
+++ b/src/templates/resource/steps/host_info.html
@@ -10,7 +10,7 @@
{% else %}
-<form id="host_meta_form" method="post" action="/wf/workflow/">
+<form id="step_form" method="post">
{% csrf_token %}
<table>
<thead>
@@ -32,12 +32,3 @@
</form>
{% endif %}
{% endblock content %}
-
-{% block onleave %}
-var formData = $("#host_meta_form").serialize();
-var req = new XMLHttpRequest();
-req.open("POST", "/wf/workflow/", false);
-req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
-req.onerror = function() { alert("There was a problem submitting the form"); }
-req.send(formData);
-{% endblock %}
diff --git a/src/templates/resource/steps/meta_info.html b/src/templates/resource/steps/meta_info.html
index 62230dc..b6a17a9 100644
--- a/src/templates/resource/steps/meta_info.html
+++ b/src/templates/resource/steps/meta_info.html
@@ -5,20 +5,10 @@
{% block content %}
-<form id="resource_meta_form" method="post" action="/wf/workflow/">
+<form id="step_form" method="post">
{% csrf_token %}
<table class="px-4">
{% bootstrap_form form field_class="px-4" label_class="px-4 mt-2" %}
</table>
</form>
{% endblock content %}
-
-{% block onleave %}
-var ajaxForm = $("#resource_meta_form");
-var formData = ajaxForm.serialize();
-req = new XMLHttpRequest();
-req.open("POST", "/wf/workflow/", false);
-req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
-req.onerror = function() { alert("problem submitting form"); }
-req.send(formData);
-{% endblock %}
diff --git a/src/templates/resource/steps/pod_definition.html b/src/templates/resource/steps/pod_definition.html
index 4c9aa83..8d20b14 100644
--- a/src/templates/resource/steps/pod_definition.html
+++ b/src/templates/resource/steps/pod_definition.html
@@ -37,7 +37,7 @@
<button type="button" class="d-none" onclick="network_step.submitForm();">Submit</button>
</div>
</div>
- <form id="xml_form" method="post" action="/wf/workflow/">
+ <form id="step_form" method="post">
{% csrf_token %}
<input type="hidden" id="hidden_xml_input" name="xml" />
</form>
diff --git a/src/templates/snapshot_workflow/steps/meta.html b/src/templates/snapshot_workflow/steps/meta.html
index 7c3e98b..88136d2 100644
--- a/src/templates/snapshot_workflow/steps/meta.html
+++ b/src/templates/snapshot_workflow/steps/meta.html
@@ -6,7 +6,7 @@
{% block content %}
{% bootstrap_form_errors form type='non_fields' %}
<div class="p-4">
- <form id="meta_form" action="/wf/workflow/" method="POST" class="form">
+ <form id="step_form" method="POST" class="form">
{% csrf_token %}
<div class="form-group">
{% bootstrap_field form.name %}
@@ -15,13 +15,3 @@
</form>
</div>
{% endblock content %}
-
-{% block onleave %}
-var ajaxForm = $("#meta_form");
-var formData = ajaxForm.serialize();
-req = new XMLHttpRequest();
-req.open("POST", "/wf/workflow/", false);
-req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
-req.onerror = function() { alert("problem submitting form"); }
-req.send(formData);
-{% endblock %}
diff --git a/src/templates/snapshot_workflow/steps/select_host.html b/src/templates/snapshot_workflow/steps/select_host.html
index a0af67b..4243145 100644
--- a/src/templates/snapshot_workflow/steps/select_host.html
+++ b/src/templates/snapshot_workflow/steps/select_host.html
@@ -6,7 +6,7 @@
{% block content %}
{% bootstrap_form_errors form type='non_fields' %}
-<form id="host_select_form" action="/wf/workflow/" method="POST" class="form">
+<form id="step_form" method="POST" class="form">
{% csrf_token %}
<input type="hidden" id="hidden_json_input", name="host"/>
</form>
@@ -81,13 +81,3 @@ if(initial){
}
</script>
{% endblock content %}
-
-{% block onleave %}
-var ajaxForm = $("#host_select_form");
-var formData = ajaxForm.serialize();
-req = new XMLHttpRequest();
-req.open("POST", "/wf/workflow/", false);
-req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
-req.onerror = function() { alert("problem submitting form"); }
-req.send(formData);
-{% endblock %}