{% extends "admin/base.html" %} {% from "admin/components/csrf-field.html" import csrf_field %} {% from "admin/components/field.html" import render_field_value with context %} {% from "admin/components/inline.html" import render_inline_section with context %} {% from "admin/components/icons.html" import icon %} {% block title %}{{ _(model_admin.get_verbose_name()) }}{% endblock %} {% block content %} {# Layout comes from ui("page"), shared with the form, so viewing and editing the same record do not jump width or alignment. Edit, Delete and the record actions sit below the record, not above it -- the record is what a viewer came to read -- and stay reachable on a long one thanks to the pinned bar. #}
{% for name in detail_fields %} {% set field = model_admin.get_field(name) %}
{# A field's help_text deliberately does not appear here: it explains how to fill a field in, which is a question the form answers and this page does not ask. See ui/field.html. #}
{{ _(field.label) }}
{{ render_field_value(field, field.get_value(object), model_admin.get_empty_value()) }}
{% endfor %}
{% for inline in inlines %}{{ render_inline_section(inline) }}{% endfor %} {# Only rendered when the configured audit logger can read back (core.audit.AuditReader) -- a write-only logger records silently. #} {% if history %}

{{ _("History") }}

    {% for entry in history %}
  • {{ entry.who }} {{ entry.what }} {{ entry.when }}
  • {% endfor %}
{% endif %}
{# No Delete here -- it lives on the edit form, so destroying a record is something you opt into by entering edit mode rather than a click away from merely looking at one. #}
{% if permissions.can_update %} {{ icon("edit", "w-4 h-4") }} {{ _("Edit") }} {% endif %} {% for action in actions %} {# w-full sm:w-auto tracks "actions-primary"'s flex-col -> sm:flex-row switch by hand: stretch gives Edit its full width as a direct child, but an action's button is a grandchild -- the stretch stops at the
-- and would otherwise sit stunted beside a full-width Edit. #} {{ csrf_field(csrf_token) }}
{% endfor %}
{% endblock %}