{#- Each widget lives in widgets/, so a project can override one by dropping a file with the same name into its own template folder. -#} {%- set field_id = "field-" ~ row.path|replace(".", "-") -%} {#- Ties the input to its name, and to its error or help, for screen readers. -#} {%- set field_attrs -%} aria-labelledby="{{ field_id }}-label" {%- if row.error or row.field.help_text %} aria-describedby="{{ field_id }}-note"{% endif %} {%- if row.error %} aria-invalid="true"{% endif %} {%- endset -%}
{{ row.label }} {% if row.readonly %} {{ _('read only') }} {% elif row.required %} {{ _('required') }} {% endif %} {% if row.readonly %} {% include "adminsite/widgets/readonly.html" %} {% else %} {% include ["adminsite/widgets/" ~ row.widget ~ ".html", "adminsite/widgets/input.html"] %} {% endif %} {% if row.error %}

{{ row.error }}

{% elif row.field.help_text %}

{{ row.field.help_text }}

{% endif %}