diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2024-09-03 18:40:27 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2024-09-05 16:09:40 +0200 |
commit | 69dd532066585cad66e202e650f2c174808dc11f (patch) | |
tree | db6ac956ef1044af25d6a9b49ba1f08a2eb0c41e /archaeological_warehouse/templates/ishtar/forms/qa_container_move.html | |
parent | 1720a9a24b4d53cd4d5981f1b847bd3642fa6fae (diff) | |
download | Ishtar-69dd532066585cad66e202e650f2c174808dc11f.tar.bz2 Ishtar-69dd532066585cad66e202e650f2c174808dc11f.zip |
✨ QA container form: move form
Diffstat (limited to 'archaeological_warehouse/templates/ishtar/forms/qa_container_move.html')
-rw-r--r-- | archaeological_warehouse/templates/ishtar/forms/qa_container_move.html | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/archaeological_warehouse/templates/ishtar/forms/qa_container_move.html b/archaeological_warehouse/templates/ishtar/forms/qa_container_move.html new file mode 100644 index 000000000..69396b7ba --- /dev/null +++ b/archaeological_warehouse/templates/ishtar/forms/qa_container_move.html @@ -0,0 +1,66 @@ +{% extends "ishtar/forms/qa_base.html" %} +{% load i18n inline_formset table_form %} + +{% block main_form %} + {% if form.non_field_errors %} + <div class="alert alert-danger" role="alert"> + {{form.non_field_errors}} + </div> + {% endif %} + + <h4>{% trans "Containers" %}</h4> + <ul>{% for item in items %} + <li>{{item}}</li>{% endfor %} + </ul> + + <h4>{% trans "Move" context "action" %}</h4> + {% for hidden in form.hidden_fields %} + {{hidden}} + {% if hidden.errors %}<div class="invalid-feedback"> + {{ hidden.errors }} + </div>{% endif %} + {% endfor %} + <div class="form-row"> + {% with force_large_col=True %} + {% with form.qalocation as field %} + {% include "blocks/bs_field_snippet.html" %} + {% endwith %} + {% with form.qaparent as field %} + {% include "blocks/bs_field_snippet.html" %} + {% endwith %} + {% endwith %} + </div> + + <div class="form-row"> + {{ form.create_treatment }} <label for="{{form.create_treatment.auto_id}}"> + {% trans "Associate a treatment" %} + </label> + </div> + <div id="new-treatment"> + <div class="form-row"> + {% with force_large_col=false %}{% for field in form %} + {% if field.name != 'qalocation' and field.name != 'qaparent' and field.name != 'create_treatment' %} + {% include "blocks/bs_field_snippet.html" %} + {% endif %} + {% endfor %}{% endwith %} + </div> + </div> +{% endblock %} + +{% block js %} +var update_form_display = function(){ + if ($("#{{form.create_treatment.auto_id}}:checked").length){ + $("#new-treatment").show(); + } else { + $("#new-treatment").hide(); + } +}; + +$(document).ready(function(){ + $("#{{form.create_treatment.auto_id}}").click(update_form_display); + update_form_display(); +}); + +{% endblock %} + + |