{% extends "base.html" %} {% block title %}{% if pk is none %}New {{ spec.label }}{% else %}Edit {{ spec.label }} {{ pk }}{% endif %}{% endblock %} {% block content %} {% 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 same form without HTMX: a plain page, a plain POST, a redirect after. #}
{{ spec.group }} ยท {{ spec.label }}

{% if pk is none %}New record{% else %}Edit {{ pk }}{% endif %}

Cancel
{% if form_error %}
{{ form_error }}
{% elif errors %}
{{ errors | length }} field{{ "s" if errors | length != 1 }} need attention
{% endif %}
{% include "_fields.html" %}
{% endblock %}