diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-09-12 19:27:31 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-10-24 12:06:08 +0200 |
commit | 46fde16870a11cd68a3027dd974b4c8b36643d54 (patch) | |
tree | c3d90559afaff5fbd454ce8baf57ee7fd887b6cd /archaeological_finds/templates | |
parent | ef120a060b2eee4d67df7a065c3dd4b67b93f7ba (diff) | |
download | Ishtar-46fde16870a11cd68a3027dd974b4c8b36643d54.tar.bz2 Ishtar-46fde16870a11cd68a3027dd974b4c8b36643d54.zip |
QA packaging
Diffstat (limited to 'archaeological_finds/templates')
-rw-r--r-- | archaeological_finds/templates/ishtar/forms/qa_find_treatment.html | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/archaeological_finds/templates/ishtar/forms/qa_find_treatment.html b/archaeological_finds/templates/ishtar/forms/qa_find_treatment.html new file mode 100644 index 000000000..07f633848 --- /dev/null +++ b/archaeological_finds/templates/ishtar/forms/qa_find_treatment.html @@ -0,0 +1,65 @@ +{% 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 "Finds" %}</h4> + <ul>{% for item in items %} + <li>{{item}}</li>{% endfor %} + </ul> + + <h4>{% trans "Packaging" %}</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 form.container as field %} + {% include "blocks/bs_field_snippet.html" %} + {% endwith %} + </div> + + <div class="form-row"> + <input type="checkbox" name="create_treatment" + id="create-choice"> + <label for="create-choice"> + {% trans "Associate a treatment to this operation" %} + </label> + </div> + <div id="new-treatment"> + {% for field in form %} + {% if field.name != 'container' and field.name != 'create_treatment' %} + {% if forloop.counter0|divisibleby:2 %} + <div class="form-row">{% endif %} + {% include "blocks/bs_field_snippet.html" %} + {% if not forloop.counter0|divisibleby:2 %} + </div>{% endif %} + {% endif %} + {% endfor %} + </div> +{% endblock %} + +{% block js %} +var update_form_display = function(){ + if ($("#create-choice:checked").length){ + $("#new-treatment").show(); + } else { + $("#new-treatment").hide(); + } +} + +$(document).ready(function(){ + $("#create-choice").click(update_form_display); + update_form_display(); +}); + +{% endblock %} + + |