File tree Expand file tree Collapse file tree 5 files changed +40
-5
lines changed
src/unfold/templates/unfold_crispy Expand file tree Collapse file tree 5 files changed +40
-5
lines changed Original file line number Diff line number Diff line change
1
+ {% if formset.non_form_errors %}
2
+ {% include "unfold/helpers/messages/error.html" with errors=formset.non_form_errors %}
3
+ {% endif %}
Original file line number Diff line number Diff line change 3
3
{% if field.is_hidden %}
4
4
{{ field }}
5
5
{% else %}
6
- < {% if tag %}{{ tag }}{% else %}div{% endif %} id="div_{{ field.auto_id }}" class="group {% if tag == "td" %}align-top border-t border-base-200 font-normal gap-4 min-w-0 overflow-hidden px-3 py-3 text-left dark:border-base-800 dark:before:text-font-important-dark{% endif%} {% if field.errors %}errors{% endif %} {% if field_class %} {{ field_class }}{% endif %} {% if field|is_checkbox and tag == "td" %}flex flex-row gap-2 h-[38px] items-center{% else %}{% if 'form-horizontal' in form_class %} row{% endif %}{% endif %}{% if wrapper_class %} {{ wrapper_class }}{% endif %}{% if field.css_classes %} {{ field.css_classes }}{% endif %}">
6
+ < {% if tag %}{{ tag }}{% else %}div{% endif %} id="div_{{ field.auto_id }}" class="group {% if tag == "td" %}align-top border-t border-base-200 font-normal gap-4 min-w-0 overflow-hidden px-3 py-3 text-left dark:border-base-800 dark:before:text-font-important-dark{% endif%} {% if field.errors %}errors{% endif %} {% if field_class %} {{ field_class }}{% endif %} {% if field|is_checkbox and tag == "td" %}flex flex-row gap-2 items-center{% else %}{% if 'form-horizontal' in form_class %} row{% endif %}{% endif %}{% if wrapper_class %} {{ wrapper_class }}{% endif %}{% if field.css_classes %} {{ field.css_classes }}{% endif %}">
7
7
{% if field.label and not field|is_checkbox and form_show_labels %}
8
8
< label {% if field.id_for_label %}for ="{{ field.id_for_label }} "{% endif %} class ="block font-semibold mb-2 text-font-important-light text-sm dark:text-font-important-dark {% if label_class %} {{ label_class }}{% endif %} ">
9
9
{{ field.label }}{% if field.field.required %} < span class ="asteriskField "> *</ span > {% endif %}
Original file line number Diff line number Diff line change 1
1
{% if inputs %}
2
- < div class ="border border-base-200 rounded-default flex flex-col gap-2 justify-end p-3 lg:flex-row dark:border-base-800 {{ field_class }} ">
2
+ < div class ="flex flex-col gap-2 justify-end lg:flex-row {{ field_class }} ">
3
3
{% for input in inputs %}
4
4
{% include "unfold_crispy/layout/baseinput.html" %}
5
5
{% endfor %}
Original file line number Diff line number Diff line change 9
9
{% csrf_token %}
10
10
{% endif %}
11
11
12
- < div class ="overflow-x-auto border border-base-200 rounded-default shadow-xs dark:border-base-800 " {% if form_id %} id ="{{ form_id }} "{% endif %} >
12
+ {% include "unfold_crispy/errors_formset.html" %}
13
+
14
+ < div class ="overflow-x-auto border border-base-200 mb-8 rounded-default shadow-xs dark:border-base-800 " {% if form_id %} id ="{{ form_id }} "{% endif %} >
13
15
{{ formset.management_form|crispy }}
14
16
15
17
< table class ="w-full ">
66
68
</ tbody >
67
69
{% endif %}
68
70
</ table >
69
-
70
- {% include "unfold_crispy/inputs.html" %}
71
71
</ div >
72
72
73
+ {% include "unfold_crispy/inputs.html" %}
74
+
73
75
{% if formset_tag %}
74
76
</ form >
75
77
{% endif %}
Original file line number Diff line number Diff line change
1
+ {% load crispy_forms_tags %}
2
+ {% load crispy_forms_utils %}
3
+
4
+ {% specialspaceless %}
5
+ {% if formset_tag %}
6
+ < form {{ flat_attrs }} method ="{{ form_method }} " {% if formset.is_multipart %} enctype ="multipart/form-data "{% endif %} >
7
+ {% endif %}
8
+ {% if formset_method|lower == 'post' and not disable_csrf %}
9
+ {% csrf_token %}
10
+ {% endif %}
11
+
12
+ < div >
13
+ {{ formset.management_form|crispy }}
14
+ </ div >
15
+
16
+ {% include "unfold_crispy/errors_formset.html" %}
17
+
18
+ {% for form in formset %}
19
+ {% include "unfold_crispy/display_form.html" %}
20
+ {% endfor %}
21
+
22
+ {% if inputs %}
23
+ < div class ="form-actions ">
24
+ {% for input in inputs %}
25
+ {% include "unfold_crispy/layout/baseinput.html" %}
26
+ {% endfor %}
27
+ </ div >
28
+ {% endif %}
29
+ {% if formset_tag %}</ form > {% endif %}
30
+ {% endspecialspaceless %}
You can’t perform that action at this time.
0 commit comments