From 7f6f35cfc3464c409715cff0ddfe4406634da221 Mon Sep 17 00:00:00 2001 From: David Smith Date: Sat, 4 Nov 2023 20:24:28 +0000 Subject: [PATCH] Added support for horizontal forms. --- crispy_bootstrap5/templates/bootstrap5/layout/switch.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crispy_bootstrap5/templates/bootstrap5/layout/switch.html b/crispy_bootstrap5/templates/bootstrap5/layout/switch.html index add30a6..68b0629 100644 --- a/crispy_bootstrap5/templates/bootstrap5/layout/switch.html +++ b/crispy_bootstrap5/templates/bootstrap5/layout/switch.html @@ -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 %}"> +
{% if field.errors %} {% crispy_field field 'class' 'form-check-input is-invalid' 'role' 'checkbox' %} {% else %} @@ -13,5 +14,6 @@ {{ field.label }} {% include 'bootstrap5/layout/help_text_and_errors.html' %} +
{% endif %}