{% set hue = groups.index(spec.group) % 6 if spec.group in groups else 0 %} {% set action = page_url ~ "/new" if pk is none else page_url ~ "/" ~ pk ~ "/edit" %} {# The whole dialog is swapped for whatever the save returns: the record on success, this form again with per-field errors on rejection. #}
{% if form_error %}
{{ form_error }}
{% elif errors %}
{{ errors | length }} field{{ "s" if errors | length != 1 }} need attention
{% endif %}
{% include "_fields.html" %}