{% extends "adminsite/base.html" %} {% import "adminsite/_icons.html" as icons %} {% block page_title %}{{ heading }} ยท {{ title }}{% endblock %} {% block breadcrumb %} {% endblock %} {% block header_class %}border-b border-base-300 lg:pt-2 lg:pb-5{% endblock %} {% block header %}

{{ _('Edit {name}', name=heading) if record is not none else heading }}

{% endblock %} {% block header_actions %} {#- On a phone the buttons at the foot of the form are enough, and the title gets the whole line. -#} {% endblock %} {% block content %} {#- Every problem in one place at the top, each a link to its field, so a mistake at the bottom of a long form is never missed. -#} {%- set problems = [] -%} {%- for row in rows if row.error -%} {%- set ignored = problems.append((row.path, row.label, row.error)) -%} {%- endfor -%} {%- for table in inlines -%} {%- for item in table.rows -%} {%- set number = loop.index -%} {%- for cell in item.cells if cell.error -%} {%- set ignored = problems.append((cell.path, _("{thing}, row {number}, {field}", thing=table.label, number=number, field=cell.label|lower), cell.error)) -%} {%- endfor -%} {%- endfor -%} {%- endfor -%}
{{ csrf_input | safe if csrf_input }} {% if form_error or problems %} {% endif %} {% if rows %}

{{ view.label }}

{% for row in rows %} {% include "adminsite/_field.html" %} {% endfor %}
{% endif %} {% include "adminsite/_inlines.html" %}
{{ _('Cancel') }} {% if can_delete and record is not none %} {% endif %}
{% if can_delete and record is not none %} {% endif %} {% endblock %}