{% set field_error = field_errors.get(field.name) if field_errors is defined and field_errors else None %}
{% set value = values.get(field.name, '') %}
{% set is_auto = auto_fields and field.name in auto_fields %}
{% if field.type == 'string' %}
{% elif field.type == 'integer' %}
{% elif field.type == 'float' %}
{% elif field.type == 'boolean' %}
{% elif field.type == 'date' %}
{# The browser's own date control: a text box with a regex told the reader
the format only after they had got it wrong. #}
{% elif field.type == 'datetime' %}
{# datetime had no branch at all and fell through to a plain text box, so a
spec's datetime field was typed by hand. datetime-local wants
YYYY-MM-DDTHH:MM while a stored value reads "2025-01-15 09:00:00+00:00":
take the date and the hour and minute, which is what the control holds. #}
{% elif field.type == 'uri' %}
{% elif field.type == 'ontology_term' %}
{% elif field.nested %}
{# A field holding entities, a list or a single one, has one rendering
(ADR 006). An edit form shows it as its table under Related
Entities; this button is the fallback when no table was built. #}
{% if is_edit %}
{% else %}
Create first, then add {{ field.name }}
{% endif %}
{% elif field.type == 'list' %}
{% else %}
{% endif %}
{% if field_error %}