{% load l10n i18n crispy_forms_filters %} {# This is a special buttons-group crispy-forms field for boolean values in a CharField, used in preferences #} {# Saved values are the strings "True" and "False", but displayed is a buttons group. #} {% if field.is_hidden %} {{ field }} {% else %}
{% if field.label %} {% endif %}
{% if form_show_errors and field.errors %} {% for error in field.errors %} {# d-block is needed, as this div is no sibling of input, hence is not shown #}
{{ error }}
{% endfor %} {% endif %} {% 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 'bootstrap5/layout/field_errors_block.html' %}
{% endif %} {% include 'bootstrap5/layout/help_text.html' %}
{% endif %}