diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-07-07 09:39:29 +0200 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-07-08 09:58:47 +0200 |
| commit | c01be9de3ea65ab7a5360444e5cc27caebc1c061 (patch) | |
| tree | a324f582ed88df9fa6230809600a665baacde36c /ishtar_common/templates/blocks/bs_formset_snippet.html | |
| parent | fd232fdba395c96564934052233dd23604082693 (diff) | |
| download | Ishtar-c01be9de3ea65ab7a5360444e5cc27caebc1c061.tar.bz2 Ishtar-c01be9de3ea65ab7a5360444e5cc27caebc1c061.zip | |
Preventive file - inline forms
Diffstat (limited to 'ishtar_common/templates/blocks/bs_formset_snippet.html')
| -rw-r--r-- | ishtar_common/templates/blocks/bs_formset_snippet.html | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/ishtar_common/templates/blocks/bs_formset_snippet.html b/ishtar_common/templates/blocks/bs_formset_snippet.html index 0d089ee1b..3a7e537d3 100644 --- a/ishtar_common/templates/blocks/bs_formset_snippet.html +++ b/ishtar_common/templates/blocks/bs_formset_snippet.html @@ -1,6 +1,9 @@ {% load i18n from_dict %} -<div class="form-row"> +<div id="formset-container-{{formset.prefix}}"> + {{ formset.non_form_errors.as_ul }} + {{ formset.management_form }} {% for form in formset %} + <div class="form-row form-{{formset.prefix}}"> {% if form.non_field_errors and not no_error %} <div class="alert alert-danger" role="alert"> {{form.non_field_errors}} @@ -16,11 +19,26 @@ {% csrf_token %} {% for field in form.visible_fields %} + {% with bs_col_width='col-3' %} {% include "blocks/bs_field_snippet.html" %} + {% endwith %} {% endfor %} {% if form.extra_render %} {{form.extra_render|safe}} {% endif %} + </div> {% endfor %} + {% if formset.dynamic_add %} + <div class="form-row pb-2" id="div-add-form-{{formset.prefix}}"> + <div class="col"> + <button class="btn btn-secondary" id="add-form-{{formset.prefix}}" type="button">{% trans "Add" %}</button> + </div> + </div> + <script> + $(document).ready(function(){ + inline_register_add_button("{{formset.prefix}}"); + }); + </script> + {% endif %} </div> |
