{% extends "quite_admin/base.html" %} {% from "quite_admin/_ui.html" import csrf_input with context %} {% block content %} {% from "quite_admin/_fields.html" import render_field with context %} {% from "quite_admin/_controls.html" import field_attributes with context %} ← {{ resource.label }}

{{ resource.label }}

{{ t('Create record') if creating else resource.record_label(record) }}

{% if can_delete %}{{ t('Delete record') }}{% endif %}
{{ csrf_input() }} {% if revision_token %}{% endif %} {% if errors %}{% endif %} {% if stale %}

{{ t('Reload record') }}

{% endif %} {% set writable_fields = fields|selectattr('name', 'in', writable)|list %} {% set readonly_fields = fields|rejectattr('name', 'in', writable)|list %} {% for heading, group_fields in [ ('Record fields', writable_fields|rejectattr('kind', 'equalto', 'json')|list), ('Structured data', writable_fields|selectattr('kind', 'equalto', 'json')|list), ('Read-only fields' if editable else 'Record fields', readonly_fields) ] %} {% if group_fields %}

{{ t(heading) }}

{% for field in group_fields %}{{ render_field(field) }}{% endfor %}
{% endif %} {% endfor %} {% if relation_editors %}

{{ t('Relationships') }}

{% for editor in relation_editors %}{% set relation = editor.relation %}
{% if editor.editable %} {% set relation_descriptions %}{% if editor.multiple %}relation-help-{{ relation.name }} {% endif %}{% if editor.truncated %}relation-limit-{{ relation.name }} {% endif %}{% if errors.get('__relation__' ~ relation.name) %}relation-error-{{ relation.name }}{% endif %}{% endset %}

{{ t('Enable JavaScript to search all related records.') }}

{% else %}
{% for key, label in editor.choices if key in editor.selected %}{{ label }}{% if not loop.last %}, {% endif %}{% else %}—{% endfor %}
{% endif %} {% if editor.truncated %}

{{ t('More than 1000 linked records. Editing is disabled to preserve the complete selection.') }}

{% endif %} {% if errors.get('__relation__' ~ relation.name) %}

{{ t(errors['__relation__' ~ relation.name]) }}

{% endif %}
{% endfor %}
{% endif %}
{% if record_actions %}

{{ t('Actions') }}

{% for action in record_actions %}
{{ csrf_input() }}
{% endfor %}
{% endif %} {% endblock %}