summaryrefslogtreecommitdiff
path: root/ishtar_common/templates/blocks
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/templates/blocks')
-rw-r--r--ishtar_common/templates/blocks/bs_field_snippet.html2
-rw-r--r--ishtar_common/templates/blocks/bs_formset_snippet.html20
2 files changed, 20 insertions, 2 deletions
diff --git a/ishtar_common/templates/blocks/bs_field_snippet.html b/ishtar_common/templates/blocks/bs_field_snippet.html
index dcee87f7f..beecf624f 100644
--- a/ishtar_common/templates/blocks/bs_field_snippet.html
+++ b/ishtar_common/templates/blocks/bs_field_snippet.html
@@ -1,5 +1,5 @@
{% load i18n %}
- <div id="main_div-{{field.auto_id}}" class="form-group{% if not field.label %} no-label{% endif %} {% if field.field.widget.attrs.cols or force_large_col %}col-lg-12{% else %}col-lg-6{% endif %}{% if field.errors %} is-invalid{% endif %}{% if field.field.required %} required{% endif %}{% if force_large_col %} full-width{% endif %}"
+ <div id="main_div-{{field.auto_id}}" class="form-group{% if not field.label %} no-label{% endif %} {% if bs_col_width %}{{bs_col_width}}{% elif field.field.widget.attrs.bs_col_width %}{{field.field.widget.attrs.bs_col_width}}{% else %}{% if field.field.widget.attrs.cols or force_large_col %}col-lg-12{% else %}col-lg-6{% endif %}{% endif %}{% if field.errors %} is-invalid{% endif %}{% if field.field.required %} required{% endif %}{% if force_large_col %} full-width{% endif %}"
data-alt-name="{{field.field.alt_name}}">
{% if field.label %}{{ field.label_tag }}{% endif %}
{% if extra_field_label %}<label><em>{{extra_field_label}}</em></label>{% endif %}
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>