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/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 ++++++ 27 files changed, 373 insertions(+) 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 (limited to 'templates/w3/layout') 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' %} +
+
-- cgit v1.2.3