aboutsummaryrefslogtreecommitdiffstats
path: root/src/templates/base/booking/quick_deploy.html
diff options
context:
space:
mode:
Diffstat (limited to 'src/templates/base/booking/quick_deploy.html')
-rw-r--r--src/templates/base/booking/quick_deploy.html33
1 files changed, 27 insertions, 6 deletions
diff --git a/src/templates/base/booking/quick_deploy.html b/src/templates/base/booking/quick_deploy.html
index 5dc41e2..c51e234 100644
--- a/src/templates/base/booking/quick_deploy.html
+++ b/src/templates/base/booking/quick_deploy.html
@@ -3,6 +3,13 @@
{% load bootstrap4 %}
{% block content %}
+<style>
+/* hides images not in use. Not applied globally since doesn't make sense in all cases */
+select option:disabled {
+ display:none;
+}
+</style>
+
{% bootstrap_form_errors form type='non_fields' %}
<form id="quick_booking_form" action="/booking/quick/" method="POST" class="form class="Anuket-Text"">
{% csrf_token %}
@@ -18,7 +25,7 @@
</div>
</div>
<div class="row justify-content-center">
- <div class="col-12 col-lg-4 my-2">
+ <div class="col-12 col-lg-6 my-2">
<div class="col border rounded py-2 h-100">
{% bootstrap_field form.purpose %}
{% bootstrap_field form.project %}
@@ -31,19 +38,26 @@
</div>
</div>
{% block collab %}
- <div class="col-12 col-lg-4 my-2">
+ <div class="col-12 col-lg-6 my-2">
<div class="col border rounded py-2 h-100">
<label>Collaborators</label>
{{ form.users }}
</div>
</div>
{% endblock collab %}
- <div class="col-12 col-lg-4 my-2">
+ </div>
+ <div class="row justify-content-center">
+ <div class="col-12 col-lg-6 my-2">
<div class="col border rounded py-2 h-100">
{% bootstrap_field form.hostname %}
{% bootstrap_field form.image %}
</div>
</div>
+ <div class="col-12 col-lg-6 my-2">
+ <div class="col border rounded py-2 h-100">
+ {% bootstrap_field form.global_cloud_config %}
+ </div>
+ </div>
<div class="col-12 d-flex mt-2 justify-content-end">
<button id="quick_booking_confirm" onclick="submit_form();" type="button" class="btn btn-success">Confirm</button>
</div>
@@ -88,15 +102,22 @@
function imageFilter() {
var drop = document.getElementById("id_image");
var lab_pk = get_selected_value("lab");
- var host_pk = get_selected_value("resource");
+ var profile_pk = get_selected_value("resource");
for (const childNode of drop.childNodes) {
var image_object = sup_image_dict[childNode.value];
if (image_object) //weed out empty option
{
+ console.log("image object:");
+ console.log(image_object);
const img_at_lab = image_object.lab == lab_pk;
- const profiles = resource_profile_map[host_pk];
- const img_in_template = profiles && profiles.indexOf(image_object.host_profile) > -1
+ const profiles = resource_profile_map[profile_pk];
+ console.log("profiles are:");
+ console.log(profiles);
+ console.log("profile map is:");
+ console.log(resource_profile_map);
+ console.log("host profile is" + image_object.architecture);
+ const img_in_template = profiles && profiles.indexOf(image_object.architecture) > -1
childNode.disabled = !img_at_lab || !img_in_template;
}
}