From 0f951dcf029d4af284467543a3afdf5bf6581a20 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Tue, 23 Apr 2024 11:16:38 +0100 Subject: switched to Django --- templates/w3/accordion-group.html | 17 +++++ templates/w3/accordion.html | 3 + templates/w3/betterform.html | 21 ++++++ templates/w3/display_form.html | 9 +++ templates/w3/errors.html | 8 +++ templates/w3/errors_formset.html | 8 +++ templates/w3/field.html | 81 ++++++++++++++++++++++ templates/w3/inputs.html | 13 ++++ templates/w3/layout/alert.html | 4 ++ templates/w3/layout/attrs.html | 1 + templates/w3/layout/baseinput.html | 9 +++ templates/w3/layout/button.html | 1 + templates/w3/layout/buttonholder.html | 4 ++ templates/w3/layout/checkboxselectmultiple.html | 29 ++++++++ .../w3/layout/checkboxselectmultiple_inline.html | 14 ++++ templates/w3/layout/column.html | 4 ++ templates/w3/layout/div.html | 4 ++ templates/w3/layout/field_errors.html | 5 ++ templates/w3/layout/field_errors_block.html | 5 ++ templates/w3/layout/field_file.html | 52 ++++++++++++++ templates/w3/layout/field_with_buttons.html | 17 +++++ templates/w3/layout/fieldset.html | 6 ++ templates/w3/layout/formactions.html | 9 +++ templates/w3/layout/help_text.html | 7 ++ templates/w3/layout/help_text_and_errors.html | 13 ++++ templates/w3/layout/inline_field.html | 29 ++++++++ templates/w3/layout/modal.html | 15 ++++ templates/w3/layout/multifield.html | 27 ++++++++ templates/w3/layout/prepended_appended_text.html | 51 ++++++++++++++ templates/w3/layout/radioselect.html | 29 ++++++++ templates/w3/layout/radioselect_inline.html | 14 ++++ templates/w3/layout/row.html | 3 + templates/w3/layout/tab-link.html | 1 + templates/w3/layout/tab.html | 6 ++ templates/w3/layout/uneditable_input.html | 14 ++++ templates/w3/table_inline_formset.html | 57 +++++++++++++++ templates/w3/uni_form.html | 11 +++ templates/w3/uni_formset.html | 8 +++ templates/w3/whole_uni_form.html | 14 ++++ templates/w3/whole_uni_formset.html | 30 ++++++++ 40 files changed, 653 insertions(+) create mode 100644 templates/w3/accordion-group.html create mode 100644 templates/w3/accordion.html create mode 100644 templates/w3/betterform.html create mode 100644 templates/w3/display_form.html create mode 100644 templates/w3/errors.html create mode 100644 templates/w3/errors_formset.html create mode 100644 templates/w3/field.html create mode 100644 templates/w3/inputs.html create mode 100644 templates/w3/layout/alert.html create mode 100644 templates/w3/layout/attrs.html create mode 100644 templates/w3/layout/baseinput.html create mode 100644 templates/w3/layout/button.html create mode 100644 templates/w3/layout/buttonholder.html create mode 100644 templates/w3/layout/checkboxselectmultiple.html create mode 100644 templates/w3/layout/checkboxselectmultiple_inline.html create mode 100644 templates/w3/layout/column.html create mode 100644 templates/w3/layout/div.html create mode 100644 templates/w3/layout/field_errors.html create mode 100644 templates/w3/layout/field_errors_block.html create mode 100644 templates/w3/layout/field_file.html create mode 100644 templates/w3/layout/field_with_buttons.html create mode 100644 templates/w3/layout/fieldset.html create mode 100644 templates/w3/layout/formactions.html create mode 100644 templates/w3/layout/help_text.html create mode 100644 templates/w3/layout/help_text_and_errors.html create mode 100644 templates/w3/layout/inline_field.html create mode 100644 templates/w3/layout/modal.html create mode 100644 templates/w3/layout/multifield.html create mode 100644 templates/w3/layout/prepended_appended_text.html create mode 100644 templates/w3/layout/radioselect.html create mode 100644 templates/w3/layout/radioselect_inline.html create mode 100644 templates/w3/layout/row.html create mode 100644 templates/w3/layout/tab-link.html create mode 100644 templates/w3/layout/tab.html create mode 100644 templates/w3/layout/uneditable_input.html create mode 100644 templates/w3/table_inline_formset.html create mode 100644 templates/w3/uni_form.html create mode 100644 templates/w3/uni_formset.html create mode 100644 templates/w3/whole_uni_form.html create mode 100644 templates/w3/whole_uni_formset.html (limited to 'templates/w3') diff --git a/templates/w3/accordion-group.html b/templates/w3/accordion-group.html new file mode 100644 index 0000000..3d4f5e8 --- /dev/null +++ b/templates/w3/accordion-group.html @@ -0,0 +1,17 @@ +
+ + +
+
+ {{ fields }} +
+
+
diff --git a/templates/w3/accordion.html b/templates/w3/accordion.html new file mode 100644 index 0000000..f3a9859 --- /dev/null +++ b/templates/w3/accordion.html @@ -0,0 +1,3 @@ +
+ {{ content }} +
diff --git a/templates/w3/betterform.html b/templates/w3/betterform.html new file mode 100644 index 0000000..4516291 --- /dev/null +++ b/templates/w3/betterform.html @@ -0,0 +1,21 @@ +{% for fieldset in form.fieldsets %} +
+ {% if fieldset.legend %} + {{ fieldset.legend }} + {% endif %} + + {% if fieldset.description %} +

{{ fieldset.description }}

+ {% endif %} + + {% for field in fieldset %} + {% if field.is_hidden %} + {{ field }} + {% else %} + {% include "w3/field.html" %} + {% endif %} + {% endfor %} + {% if not forloop.last or not fieldset_open %} +
+ {% endif %} +{% endfor %} diff --git a/templates/w3/display_form.html b/templates/w3/display_form.html new file mode 100644 index 0000000..9c891dd --- /dev/null +++ b/templates/w3/display_form.html @@ -0,0 +1,9 @@ +{% if form.form_html %} + {% if include_media %}{{ form.media }}{% endif %} + {% if form_show_errors %} + {% include "w3/errors.html" %} + {% endif %} + {{ form.form_html }} +{% else %} + {% include "w3/uni_form.html" %} +{% endif %} diff --git a/templates/w3/errors.html b/templates/w3/errors.html new file mode 100644 index 0000000..db09490 --- /dev/null +++ b/templates/w3/errors.html @@ -0,0 +1,8 @@ +{% if form.non_field_errors %} +
+ {% if form_error_title %}

{{ form_error_title }}

{% endif %} + +
+{% endif %} diff --git a/templates/w3/errors_formset.html b/templates/w3/errors_formset.html new file mode 100644 index 0000000..0382973 --- /dev/null +++ b/templates/w3/errors_formset.html @@ -0,0 +1,8 @@ +{% if formset.non_form_errors %} +
+ {% if formset_error_title %}

{{ formset_error_title }}

{% endif %} + +
+{% endif %} diff --git a/templates/w3/field.html b/templates/w3/field.html new file mode 100644 index 0000000..f73441f --- /dev/null +++ b/templates/w3/field.html @@ -0,0 +1,81 @@ +{% load crispy_forms_field %} + +{% if field.is_hidden %} + {{ field }} +{% else %} + {% if field|is_checkbox %} +
+ {% if label_class %} +
+ {% endif %} + {% endif %} + <{% if tag %}{{ tag }}{% else %}div{% endif %} id="div_{{ field.auto_id }}" class="{% if not field|is_checkbox %}w3-input{% if 'form-horizontal' in form_class %} row{% endif %}{% else %}{%if use_custom_control%}{% if tag != 'td' %}custom-control {%endif%} custom-checkbox{% else %}form-check{% endif %}{% endif %}{% if wrapper_class %} {{ wrapper_class }}{% endif %}{% if field.css_classes %} {{ field.css_classes }}{% endif %}"> + {% if field.label and not field|is_checkbox and form_show_labels %} + {# not field|is_radioselect in row below can be removed once Django 3.2 is no longer supported #} + + {% endif %} + + {% if field|is_checkboxselectmultiple %} + {% include 'w3/layout/checkboxselectmultiple.html' %} + {% endif %} + + {% if field|is_radioselect %} + {% include 'w3/layout/radioselect.html' %} + {% endif %} + + {% if not field|is_checkboxselectmultiple and not field|is_radioselect %} + {% if field|is_checkbox and form_show_labels %} + {%if use_custom_control%} + {% if field.errors %} + {% crispy_field field 'class' 'custom-control-input is-invalid' %} + {% else %} + {% crispy_field field 'class' 'custom-control-input' %} + {% endif %} + {% else %} + {% if field.errors %} + {% crispy_field field 'class' 'form-check-input is-invalid' %} + {% else %} + {% crispy_field field 'class' 'form-check-input' %} + {% endif %} + {% endif %} + + {% include 'w3/layout/help_text_and_errors.html' %} + {% elif field|is_file and use_custom_control %} + {% include 'w3/layout/field_file.html' %} + {% else %} + + {% if field|is_select and use_custom_control %} + {% if field.errors %} + {% crispy_field field 'class' 'custom-select is-invalid' %} + {% else %} + {% crispy_field field 'class' 'custom-select' %} + {% endif %} + {% elif field|is_file %} + {% if field.errors %} + {% crispy_field field 'class' 'form-control-file is-invalid' %} + {% else %} + {% crispy_field field 'class' 'form-control-file' %} + {% endif %} + {% else %} + {% if field.errors %} + {% crispy_field field 'class' 'form-control is-invalid' %} + {% else %} + {% crispy_field field 'class' 'form-control' %} + {% endif %} + {% endif %} + {% include 'w3/layout/help_text_and_errors.html' %} +
+ {% endif %} + {% endif %} + + {% if field|is_checkbox %} + {% if label_class %} +
+ {% endif %} + + {% endif %} +{% endif %} diff --git a/templates/w3/inputs.html b/templates/w3/inputs.html new file mode 100644 index 0000000..250031c --- /dev/null +++ b/templates/w3/inputs.html @@ -0,0 +1,13 @@ +{% if inputs %} +
+ {% if label_class %} +
+ {% endif %} + +
+ {% for input in inputs %} + {% include "w3/layout/baseinput.html" %} + {% endfor %} +
+
+{% endif %} diff --git a/templates/w3/layout/alert.html b/templates/w3/layout/alert.html new file mode 100644 index 0000000..ba20ae9 --- /dev/null +++ b/templates/w3/layout/alert.html @@ -0,0 +1,4 @@ + + {% if dismiss %}{% endif %} + {{ content }} + diff --git a/templates/w3/layout/attrs.html b/templates/w3/layout/attrs.html new file mode 100644 index 0000000..c52de9e --- /dev/null +++ b/templates/w3/layout/attrs.html @@ -0,0 +1 @@ +{% for name, value in widget.attrs.items %}{% if value is not False %} {{ name }}{% if value is not True %}="{{ value|stringformat:'s' }}"{% endif %}{% endif %}{% endfor %} diff --git a/templates/w3/layout/baseinput.html b/templates/w3/layout/baseinput.html new file mode 100644 index 0000000..ffde644 --- /dev/null +++ b/templates/w3/layout/baseinput.html @@ -0,0 +1,9 @@ + diff --git a/templates/w3/layout/button.html b/templates/w3/layout/button.html new file mode 100644 index 0000000..f41f9cf --- /dev/null +++ b/templates/w3/layout/button.html @@ -0,0 +1 @@ + diff --git a/templates/w3/layout/buttonholder.html b/templates/w3/layout/buttonholder.html new file mode 100644 index 0000000..bad9405 --- /dev/null +++ b/templates/w3/layout/buttonholder.html @@ -0,0 +1,4 @@ +
+ {{ fields_output }} +
diff --git a/templates/w3/layout/checkboxselectmultiple.html b/templates/w3/layout/checkboxselectmultiple.html new file mode 100644 index 0000000..c943fc4 --- /dev/null +++ b/templates/w3/layout/checkboxselectmultiple.html @@ -0,0 +1,29 @@ +{% load crispy_forms_filters %} +{% load l10n %} + +
+ + {% for group, options, index in field|optgroups %} + {% if group %}{{ group }}{% endif %} + {% for option in options %} +
+ + + {% if field.errors and forloop.last and not inline_class and forloop.parentloop.last %} + {% include 'w3/layout/field_errors_block.html' %} + {% endif %} +
+ {% endfor %} + {% endfor %} + {% if field.errors and inline_class %} +
+ {# the following input is only meant to allow boostrap to render the error message as it has to be after an invalid input. As the input has no name, no data will be sent. #} + + {% include 'w3/layout/field_errors_block.html' %} +
+ {% endif %} + + {% include 'w3/layout/help_text.html' %} +
diff --git a/templates/w3/layout/checkboxselectmultiple_inline.html b/templates/w3/layout/checkboxselectmultiple_inline.html new file mode 100644 index 0000000..10f0e9e --- /dev/null +++ b/templates/w3/layout/checkboxselectmultiple_inline.html @@ -0,0 +1,14 @@ +{% if field.is_hidden %} + {{ field }} +{% else %} +
+ + {% if field.label %} + + {% endif %} + + {% include 'w3/layout/checkboxselectmultiple.html' %} +
+{% endif %} diff --git a/templates/w3/layout/column.html b/templates/w3/layout/column.html new file mode 100644 index 0000000..e372c38 --- /dev/null +++ b/templates/w3/layout/column.html @@ -0,0 +1,4 @@ +
+ {{ fields }} +
diff --git a/templates/w3/layout/div.html b/templates/w3/layout/div.html new file mode 100644 index 0000000..1651ddc --- /dev/null +++ b/templates/w3/layout/div.html @@ -0,0 +1,4 @@ +
+ {{ fields }} +
diff --git a/templates/w3/layout/field_errors.html b/templates/w3/layout/field_errors.html new file mode 100644 index 0000000..f649872 --- /dev/null +++ b/templates/w3/layout/field_errors.html @@ -0,0 +1,5 @@ +{% if form_show_errors and field.errors %} + {% for error in field.errors %} + {{ error }} + {% endfor %} +{% endif %} diff --git a/templates/w3/layout/field_errors_block.html b/templates/w3/layout/field_errors_block.html new file mode 100644 index 0000000..e788b79 --- /dev/null +++ b/templates/w3/layout/field_errors_block.html @@ -0,0 +1,5 @@ +{% if form_show_errors and field.errors %} + {% for error in field.errors %} +

{{ error }}

+ {% endfor %} +{% endif %} diff --git a/templates/w3/layout/field_file.html b/templates/w3/layout/field_file.html new file mode 100644 index 0000000..f58268a --- /dev/null +++ b/templates/w3/layout/field_file.html @@ -0,0 +1,52 @@ +{% load crispy_forms_field %} + +
+{% for widget in field.subwidgets %} +{% if widget.data.is_initial %} +
+
+ {{ widget.data.initial_text }} +
+
+ + {{ field.value }} + + {% if not widget.data.required %} + + + + + + + {% endif %} +
+
+
+
+ {{ widget.data.input_text }} +
+{% endif %} +
+ + + +
+ {% if not widget.data.is_initial %} + {% include 'w3/layout/help_text_and_errors.html' %} + {% endif %} +{% if widget.data.is_initial %} +
+
+{% include 'w3/layout/help_text_and_errors.html' %} +
+{% endif %} +{% endfor %} +
diff --git a/templates/w3/layout/field_with_buttons.html b/templates/w3/layout/field_with_buttons.html new file mode 100644 index 0000000..234b310 --- /dev/null +++ b/templates/w3/layout/field_with_buttons.html @@ -0,0 +1,17 @@ +{% load crispy_forms_field %} + + + {% if field.label and form_show_labels %} + + {% endif %} + +
+
+ {% crispy_field field 'class' 'form-control' %} + {{ buttons }} +
+ {% include 'w3/layout/help_text_and_errors.html' %} +
+ diff --git a/templates/w3/layout/fieldset.html b/templates/w3/layout/fieldset.html new file mode 100644 index 0000000..85ae30b --- /dev/null +++ b/templates/w3/layout/fieldset.html @@ -0,0 +1,6 @@ +
+ {% if legend %}{{ legend }}{% endif %} + {{ fields }} +
diff --git a/templates/w3/layout/formactions.html b/templates/w3/layout/formactions.html new file mode 100644 index 0000000..04fed0b --- /dev/null +++ b/templates/w3/layout/formactions.html @@ -0,0 +1,9 @@ + + {% if label_class %} +
+ {% endif %} + +
+ {{ fields_output }} +
+ diff --git a/templates/w3/layout/help_text.html b/templates/w3/layout/help_text.html new file mode 100644 index 0000000..3b5695c --- /dev/null +++ b/templates/w3/layout/help_text.html @@ -0,0 +1,7 @@ +{% if field.help_text %} + {% if help_text_inline %} + {{ field.help_text|safe }} + {% else %} + {{ field.help_text|safe }} + {% endif %} +{% endif %} diff --git a/templates/w3/layout/help_text_and_errors.html b/templates/w3/layout/help_text_and_errors.html new file mode 100644 index 0000000..7313246 --- /dev/null +++ b/templates/w3/layout/help_text_and_errors.html @@ -0,0 +1,13 @@ +{% if help_text_inline and not error_text_inline %} + {% include 'w3/layout/help_text.html' %} +{% endif %} + +{% if error_text_inline %} + {% include 'w3/layout/field_errors.html' %} +{% else %} + {% include 'w3/layout/field_errors_block.html' %} +{% endif %} + +{% if not help_text_inline %} + {% include 'w3/layout/help_text.html' %} +{% endif %} diff --git a/templates/w3/layout/inline_field.html b/templates/w3/layout/inline_field.html new file mode 100644 index 0000000..aff23bb --- /dev/null +++ b/templates/w3/layout/inline_field.html @@ -0,0 +1,29 @@ +{% load crispy_forms_field %} + +{% if field.is_hidden %} + {{ field }} +{% else %} + {% if field|is_checkbox %} +
+ +
+ {% else %} +
+ + {% if field.errors %} + {% crispy_field field 'placeholder' field.label 'class' 'form-control is-invalid' %} + {% else %} + {% crispy_field field 'placeholder' field.label 'class' 'form-control' %} + {% endif %} +
+ {% endif %} +{% endif %} diff --git a/templates/w3/layout/modal.html b/templates/w3/layout/modal.html new file mode 100644 index 0000000..ab18198 --- /dev/null +++ b/templates/w3/layout/modal.html @@ -0,0 +1,15 @@ + diff --git a/templates/w3/layout/multifield.html b/templates/w3/layout/multifield.html new file mode 100644 index 0000000..0a2c050 --- /dev/null +++ b/templates/w3/layout/multifield.html @@ -0,0 +1,27 @@ +{% load crispy_forms_field %} + +{% if field.is_hidden %} + {{ field }} +{% else %} + + {% if field.label %} + + {% endif %} + +{% endif %} diff --git a/templates/w3/layout/prepended_appended_text.html b/templates/w3/layout/prepended_appended_text.html new file mode 100644 index 0000000..1cccf79 --- /dev/null +++ b/templates/w3/layout/prepended_appended_text.html @@ -0,0 +1,51 @@ +{% load crispy_forms_field %} + +{% if field.is_hidden %} + {{ field }} +{% else %} +
+ + {% if field.label and form_show_labels %} + + {% endif %} + +
+
+ {% if crispy_prepended_text %} +
+ {{ crispy_prepended_text }} +
+ {% endif %} + {% if field|is_select and use_custom_control %} + {% if field.errors %} + {% crispy_field field 'class' 'custom-select is-invalid' %} + {% else %} + {% crispy_field field 'class' 'custom-select' %} + {% endif %} + {% else %} + {% if field.errors %} + {% crispy_field field 'class' 'form-control is-invalid' %} + {% else %} + {% crispy_field field 'class' 'form-control' %} + {% endif %} + {% endif %} + {% if crispy_appended_text %} +
+ {{ crispy_appended_text }} +
+ {% endif %} + {% if error_text_inline %} + {% include 'w3/layout/field_errors.html' %} + {% else %} + {% include 'w3/layout/field_errors_block.html' %} + {% endif %} +
+ {% if not help_text_inline %} + {% include 'w3/layout/help_text.html' %} + {% endif %} +
+ +
+{% endif %} diff --git a/templates/w3/layout/radioselect.html b/templates/w3/layout/radioselect.html new file mode 100644 index 0000000..d9c9e5a --- /dev/null +++ b/templates/w3/layout/radioselect.html @@ -0,0 +1,29 @@ +{% load crispy_forms_filters %} +{% load l10n %} + +
+ + {% for group, options, index in field|optgroups %} + {% if group %}{{ group }}{% endif %} + {% for option in options %} +
+ + + {% if field.errors and forloop.last and not inline_class and forloop.parentloop.last %} + {% include 'w3/layout/field_errors_block.html' %} + {% endif %} +
+ {% endfor %} + {% endfor %} + {% if field.errors and inline_class %} +
+ {# the following input is only meant to allow boostrap to render the error message as it has to be after an invalid input. As the input has no name, no data will be sent. #} + + {% include 'w3/layout/field_errors_block.html' %} +
+ {% endif %} + + {% include 'w3/layout/help_text.html' %} +
diff --git a/templates/w3/layout/radioselect_inline.html b/templates/w3/layout/radioselect_inline.html new file mode 100644 index 0000000..22ba321 --- /dev/null +++ b/templates/w3/layout/radioselect_inline.html @@ -0,0 +1,14 @@ +{% if field.is_hidden %} + {{ field }} +{% else %} +
+ + {% if field.label %} + + {% endif %} + + {% include 'w3/layout/radioselect.html' %} +
+{% endif %} diff --git a/templates/w3/layout/row.html b/templates/w3/layout/row.html new file mode 100644 index 0000000..6922605 --- /dev/null +++ b/templates/w3/layout/row.html @@ -0,0 +1,3 @@ +
+ {{ fields }} +
diff --git a/templates/w3/layout/tab-link.html b/templates/w3/layout/tab-link.html new file mode 100644 index 0000000..8f68f7c --- /dev/null +++ b/templates/w3/layout/tab-link.html @@ -0,0 +1 @@ + diff --git a/templates/w3/layout/tab.html b/templates/w3/layout/tab.html new file mode 100644 index 0000000..59a03bd --- /dev/null +++ b/templates/w3/layout/tab.html @@ -0,0 +1,6 @@ + + {{ links }} + +
+ {{ content }} +
diff --git a/templates/w3/layout/uneditable_input.html b/templates/w3/layout/uneditable_input.html new file mode 100644 index 0000000..0af45e4 --- /dev/null +++ b/templates/w3/layout/uneditable_input.html @@ -0,0 +1,14 @@ +{% load crispy_forms_field %} +
+ +
+ {% if field|is_select and use_custom_control %} + {% crispy_field field 'class' 'custom-select' 'disabled' 'disabled' %} + {% elif field|is_file %} + {% crispy_field field 'class' 'form-control-file' 'disabled' 'disabled' %} + {% else %} + {% crispy_field field 'class' 'form-control' 'disabled' 'disabled' %} + {% endif %} + {% include 'w3/layout/help_text.html' %} +
+
diff --git a/templates/w3/table_inline_formset.html b/templates/w3/table_inline_formset.html new file mode 100644 index 0000000..a4b951d --- /dev/null +++ b/templates/w3/table_inline_formset.html @@ -0,0 +1,57 @@ +{% load crispy_forms_tags %} +{% load crispy_forms_utils %} +{% load crispy_forms_field %} + +{% specialspaceless %} +{% if formset_tag %} +
+{% endif %} + {% if formset_method|lower == 'post' and not disable_csrf %} + {% csrf_token %} + {% endif %} + +
+ {{ formset.management_form|crispy }} +
+ + + + {% if formset.readonly and not formset.queryset.exists %} + {% else %} + + {% for field in formset.forms.0 %} + {% if field.label and not field.is_hidden %} + + {{ field.label }}{% if field.field.required and not field|is_checkbox %}*{% endif %} + + {% endif %} + {% endfor %} + + {% endif %} + + + + + {% for field in formset.empty_form %} + {% include 'w3/field.html' with tag="td" form_show_labels=False %} + {% endfor %} + + + {% for form in formset %} + {% if form_show_errors and not form.is_extra %} + {% include "w3/errors.html" %} + {% endif %} + + + {% for field in form %} + {% include 'w3/field.html' with tag="td" form_show_labels=False %} + {% endfor %} + + {% endfor %} + + + + {% include "w3/inputs.html" %} + +{% if formset_tag %}{% endif %} +{% endspecialspaceless %} diff --git a/templates/w3/uni_form.html b/templates/w3/uni_form.html new file mode 100644 index 0000000..6b63a3f --- /dev/null +++ b/templates/w3/uni_form.html @@ -0,0 +1,11 @@ +{% load crispy_forms_utils %} + +{% specialspaceless %} + {% if include_media %}{{ form.media }}{% endif %} + {% if form_show_errors %} + {% include "w3/errors.html" %} + {% endif %} + {% for field in form %} + {% include field_template %} + {% endfor %} +{% endspecialspaceless %} diff --git a/templates/w3/uni_formset.html b/templates/w3/uni_formset.html new file mode 100644 index 0000000..5c6cd36 --- /dev/null +++ b/templates/w3/uni_formset.html @@ -0,0 +1,8 @@ +{% with formset.management_form as form %} + {% include 'w3/uni_form.html' %} +{% endwith %} +{% for form in formset %} +
+ {% include 'w3/uni_form.html' %} +
+{% endfor %} diff --git a/templates/w3/whole_uni_form.html b/templates/w3/whole_uni_form.html new file mode 100644 index 0000000..df71b0b --- /dev/null +++ b/templates/w3/whole_uni_form.html @@ -0,0 +1,14 @@ +{% load crispy_forms_utils %} + +{% specialspaceless %} +{% if form_tag %}
{% endif %} + {% if form_method|lower == 'post' and not disable_csrf %} + {% csrf_token %} + {% endif %} + + {% include "w3/display_form.html" %} + + {% include "w3/inputs.html" %} + +{% if form_tag %}
{% endif %} +{% endspecialspaceless %} diff --git a/templates/w3/whole_uni_formset.html b/templates/w3/whole_uni_formset.html new file mode 100644 index 0000000..ba40759 --- /dev/null +++ b/templates/w3/whole_uni_formset.html @@ -0,0 +1,30 @@ +{% load crispy_forms_tags %} +{% load crispy_forms_utils %} + +{% specialspaceless %} +{% if formset_tag %} +
+{% endif %} + {% if formset_method|lower == 'post' and not disable_csrf %} + {% csrf_token %} + {% endif %} + +
+ {{ formset.management_form|crispy }} +
+ + {% include "w3/errors_formset.html" %} + + {% for form in formset %} + {% include "w3/display_form.html" %} + {% endfor %} + + {% if inputs %} +
+ {% for input in inputs %} + {% include "w3/layout/baseinput.html" %} + {% endfor %} +
+ {% endif %} +{% if formset_tag %}
{% endif %} +{% endspecialspaceless %} -- cgit v1.2.3