{% load i18n %} {% partialdef label_row %}{{ field.label }}{% if field.is_mandatory and not field.field.disabled %} {% endif %}{% endpartialdef %} {% partialdef label %}{% if field.label %}{% endif %}{% endpartialdef %} {% partialdef control %}{% if field.widget_type == "checkbox" and field.subwidgets.0.data.text %}{% else %}{{ field }}{% endif %}{% endpartialdef %} {% partialdef toggle %}{% endpartialdef %} {% partialdef tooltip_content %}{% endpartialdef %} {% partialdef error_help_row %}{% if field.errors and edisplay == "inline" or field.errors and edisplay == "auto" and field.help_text %}
{{ field.errors|join:" " }}{% if field.help_text %}{{ field.help_text }}{% endif %}
{% elif field.help_text %}
{{ field.help_text }}
{% endif %}{% endpartialdef %} {% if field.is_hidden %}{{ field }}{% else %}{% with edisplay=field.form.error_display|default:"auto" %}{% if field.use_fieldset %}
{% if field.label %}{% partial label_row %}{% endif %} {% if field.errors and edisplay == "tooltip" or field.errors and edisplay == "auto" and not field.help_text %}
{{ field }}{% partial tooltip_content %}
{% else %}{{ field }}{% endif %} {% partial error_help_row %}
{% elif field.widget_type == "toggle" %}
{% if field.errors and edisplay == "tooltip" or field.errors and edisplay == "auto" and not field.help_text %}
{% partial toggle %}{% partial tooltip_content %}
{% else %}{% partial toggle %}{% endif %} {% partial error_help_row %}
{% elif field.widget_type == "checkbox" and not field.subwidgets.0.data.text %}
{% if field.errors and edisplay == "tooltip" or field.errors and edisplay == "auto" and not field.help_text %}
{% partial label %}{{ field }}{% partial tooltip_content %}
{% else %}{% partial label %}{{ field }}{% endif %} {% partial error_help_row %}
{% else %}
{% partial label %} {% if field.errors and edisplay == "tooltip" or field.errors and edisplay == "auto" and not field.help_text %}
{% partial control %}{% partial tooltip_content %}
{% else %}{% partial control %}{% endif %} {% partial error_help_row %}
{% endif %}{% endwith %}{% endif %}