diff options
Diffstat (limited to 'src/templates/booking')
-rw-r--r-- | src/templates/booking/quick_deploy.html | 33 | ||||
-rw-r--r-- | src/templates/booking/steps/booking_meta.html | 12 |
2 files changed, 13 insertions, 32 deletions
diff --git a/src/templates/booking/quick_deploy.html b/src/templates/booking/quick_deploy.html index f1ba491..6776980 100644 --- a/src/templates/booking/quick_deploy.html +++ b/src/templates/booking/quick_deploy.html @@ -7,13 +7,13 @@ <form id="quick_booking_form" action="/booking/quick/" method="POST" class="form"> {% csrf_token %} <div class="container-fluid"> - <div class="row"> - <div class="col-12 px-1 my-2"> - <div class="col py-2 rounded border"> - <p>Please select a host type you wish to book. Only available types are shown.</p> - {% bootstrap_field form.filter_field show_label=False %} - </div> + <div class="row mx-0 px-0"> + <div class="col-12 mx-0 px-0 mt-2"> + <p class="my-0">Please select a host type you wish to book. Only available types are shown.</p> + {% bootstrap_field form.filter_field show_label=False %} </div> + </div> + <div class="row"> <div class="col-12 col-lg-3 px-1 my-2"> <div class="col border rounded py-2 h-100"> {% bootstrap_field form.purpose %} @@ -55,10 +55,7 @@ <script type="text/javascript"> function submit_form() { - //formats data for form submission - multi_filter_widget.finish(); - // Submit the form manually since confirm button is type="button" now - // due to the form submitting before the data was even created by finish() + run_form_callbacks(); document.getElementById("quick_booking_form").submit(); } @@ -83,11 +80,8 @@ var sup_installer_dict = {{installer_filter | safe}}; var sup_scenario_dict = {{scenario_filter | safe}}; - function imageHider() { + function imageFilter() { var drop = document.getElementById("id_image"); - - hide_dropdown("id_image"); - var lab_pk = get_selected_value("lab"); var host_pk = get_selected_value("host"); @@ -95,21 +89,18 @@ var image_object = sup_image_dict[childNode.value]; if (image_object) //weed out empty option { - if (image_object.host_profile == host_pk && image_object.lab == lab_pk) { - childNode.style.display = "inherit"; - childNode.disabled = false; - } + childNode.disabled = !(image_object.host_profile == host_pk && image_object.lab == lab_pk); } } } - imageHider(); + imageFilter(); $('#id_installer').children().hide(); $('#id_scenario').children().hide(); Array.from(document.getElementsByClassName("grid-item-select-btn")).forEach(function (element) { - element.addEventListener('click', imageHider); + element.addEventListener('click', imageFilter); }); function installerHider() { @@ -148,4 +139,4 @@ } } </script> -{% endblock %}
\ No newline at end of file +{% endblock %} 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 %} |