Skip to content

Commit

Permalink
Added support for horizontal forms.
Browse files Browse the repository at this point in the history
  • Loading branch information
smithdc1 committed Nov 4, 2023
1 parent cee8741 commit 7f6f35c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crispy_bootstrap5/templates/bootstrap5/layout/switch.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{{ field }}
{% else %}
<{% if tag %}{{ tag }}{% else %}div{% endif %} id="div_{{ field.auto_id }}" class="mb-3 form-check form-switch{% if 'form-horizontal' in form_class %} row{% endif %}{% if wrapper_class %} {{ wrapper_class }}{% endif %}{% if field.css_classes %} {{ field.css_classes }}{% endif %}">
<div class="{% for offset in bootstrap_checkbox_offsets %}{{ offset|slice:"7:14" }}{{ offset|slice:"4:7" }}{{ offset|slice:"14:16" }} {% endfor %}{{ field_class }}">
{% if field.errors %}
{% crispy_field field 'class' 'form-check-input is-invalid' 'role' 'checkbox' %}
{% else %}
Expand All @@ -13,5 +14,6 @@
{{ field.label }}
</label>
{% include 'bootstrap5/layout/help_text_and_errors.html' %}
</div>
</{% if tag %}{{ tag }}{% else %}div{% endif %}>
{% endif %}

0 comments on commit 7f6f35c

Please # to comment.