{% comment %} FORM FIELD MOLECULE — LABEL + WIDGET + HELP TEXT + ERRORS. Django renders the widget itself; the element-level base styles registered in the Tailwind preset take care of its appearance, so this molecule only handles layout, labelling and errors. USAGE: {% include "django_fundamentals/molecules/form_field.html" with field=form.email %} PARAMETERS: field -- a bound Django form field (required) {% endcomment %}
{% if field.field.widget.input_type == "checkbox" %} {# CHECKBOXES READ AS "[x] Label", NOT A LABEL STACKED ABOVE A LONE BOX. #}
{{ field }} {% if field.label %} {% endif %}
{% else %} {% if field.label %} {% endif %} {{ field }} {% endif %} {% if field.help_text %}

{{ field.help_text|safe }}

{% endif %} {% comment %} RENDERED AS