{% load form_a11y %}{% comment %} Reusable form field wrapper — renders label + widget + help + errors with consistent typography and spacing. Required: field — a bound Django form field (e.g. form.title) Optional: label — override the label text (default: field.label) required — truthy → show a red * after the label (default: field.field.required) hint — override help text (default: field.help_text) optional_tag — truthy → show an "OPTIONAL" eyebrow on the right (default: false) suffix — extra HTML after the widget, before hint/errors (rarely used) Usage: {% include "components/form_field.html" with field=form.title %} {% include "components/form_field.html" with field=form.notes hint="Internal only." %} {% include "components/form_field.html" with field=form.title required=1 %} {% endcomment %}
{% if optional_tag %}Optional{% endif %}
{% render_field_a11y field %} {% if suffix %}{{ suffix }}{% endif %} {% if hint or field.help_text %}

{{ hint|default:field.help_text|safe }}

{% endif %} {% if field.errors %}{% endif %}