diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-06-07 16:52:02 +0200 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-06-12 10:46:13 +0200 |
| commit | 875462381bc57b13a8ca6b68a52ad1ca065ef95e (patch) | |
| tree | 68d54bb40b2006fc2a3d5ae938108e9b950eca59 /ishtar_common/templates | |
| parent | fdd0231543be132b846e3bf12127cd01860f55bf (diff) | |
| download | Ishtar-875462381bc57b13a8ca6b68a52ad1ca065ef95e.tar.bz2 Ishtar-875462381bc57b13a8ca6b68a52ad1ca065ef95e.zip | |
Document form: add related fields (refs #4107)
Diffstat (limited to 'ishtar_common/templates')
| -rw-r--r-- | ishtar_common/templates/blocks/bs_form_snippet.html | 15 | ||||
| -rw-r--r-- | ishtar_common/templates/ishtar/forms/document.html | 38 |
2 files changed, 52 insertions, 1 deletions
diff --git a/ishtar_common/templates/blocks/bs_form_snippet.html b/ishtar_common/templates/blocks/bs_form_snippet.html index 47779cdc1..74dbadf5c 100644 --- a/ishtar_common/templates/blocks/bs_form_snippet.html +++ b/ishtar_common/templates/blocks/bs_form_snippet.html @@ -63,13 +63,26 @@ {% if field.name in form.HEADERS %} {% if forloop.counter0 %} </div>{% endif %} -<h3>{{field.name|from_dict:form.HEADERS|call:'render'}}</h3> + +{% if form.current_header %} + {{form.current_header|call:'render_end'}} +{% endif %} + +{% with "headers,"|add:field.name as call_arg %} +{{form|call:call_arg|call:"render"}} +{% endwith %} + <div class="form-row{% if odd %} odd{% endif %}"> {% elif not search and not forloop.counter0 or search and forloop.counter0 == 1 %} <div class="form-row{% if odd %} odd{% endif %}"> {% endif %} {% include "blocks/bs_field_snippet.html" %} {% if forloop.last %} + +{% if form.current_header %} + {{form.current_header|call:'render_end'}} +{% endif %} + {% if search and forloop.counter0 >= 1 %} </div> <div class="modal-footer"> diff --git a/ishtar_common/templates/ishtar/forms/document.html b/ishtar_common/templates/ishtar/forms/document.html new file mode 100644 index 000000000..38bb3cacf --- /dev/null +++ b/ishtar_common/templates/ishtar/forms/document.html @@ -0,0 +1,38 @@ +{% extends "base.html" %} +{% load i18n inline_formset table_form %} +{% block extra_head %} +{{form.media}} +{% endblock %} + +{% block pre_container %} +<form enctype="multipart/form-data" action="." method="post"{% if confirm %} + onsubmit='return confirm("{{confirm}}");'{% endif %}>{% csrf_token %} +{% endblock %} +{% block content %} +<h2>{{page_name}}</h2> +<div class='form'> + {% for error in form.non_field_errors %} + <p>{{ error }}</p> + {% endfor %} + {% bs_form form %} +</div> +{% endblock %} + +{% block footer %} +<div id="footer"> + {% if form.SEARCH_AND_SELECT %} + <p class="confirm-message">{% trans "Search and select an item in the table" %}</p> + {% endif %} + <div id='validation-bar' class="row text-center"> + <div class="col-sm"> + <button type="submit" id="submit_form" name='validate' + value="validate" class="btn btn-success"> + {% if submit_label %}{{submit_label}}{% else%}{% trans "Validate" %}{% endif %} + </button> + </div> + </div> + {% include 'ishtar/blocks/footer.html' %} +</div> +</form> +{% endblock %} + |
