Skip to content

Commit

Permalink
Fix TemplateDoesNotExist when using MultiField (django-crispy-forms#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucastheis committed Oct 24, 2024
1 parent bb9021e commit f931d54
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 27 deletions.
30 changes: 3 additions & 27 deletions crispy_bootstrap5/templates/bootstrap5/layout/multifield.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,3 @@
{% load crispy_forms_field %}

{% if field.is_hidden %}
{{ field }}
{% else %}

{% if field.label %}
<label for="{{ field.id_for_label }}"{% if labelclass %} class="{{ labelclass }}"{% endif %}>
{% endif %}

{% if field|is_checkbox %}
{% crispy_field field %}
{% endif %}

{% if field.label %}
{{ field.label }}
{% endif %}

{% if not field|is_checkbox %}
{% crispy_field field %}
{% endif %}

{% if field.label %}
</label>
{% endif %}

{% endif %}
<div class="d-flex gap-2">
{{ fields_output }}
</div>
5 changes: 5 additions & 0 deletions crispy_bootstrap5/templates/bootstrap5/multifield.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% load crispy_forms_field %}

<div>
{% include 'bootstrap5/field.html' %}
</div>

0 comments on commit f931d54

Please sign in to comment.