{% extends "base.html" %} {% from "_macros.html" import cell %} {% block title %}{{ admin.get_verbose_name() }} · {{ identity | short_identity }}{% endblock %} {% block content %}
← {{ admin.get_verbose_name_plural() }}

{{ admin.get_verbose_name() }} {{ identity | short_identity }}

{% if impersonate_url %}{{ t("impersonate.button") }}{% endif %} {% if can_edit %}{{ t("common.edit") }}{% endif %} {% if duplicate_url %}{{ t("detail.duplicate") }}{% endif %} {% if can_delete %}
{% endif %}
{% for column, value in fields %}
{{ column | field_label }}
{% if value is not none and column in json_columns %}
{{ value }}
{% elif column in upload_urls %}{{ t("common.download") }} {{ value }}{% else %}{{ cell(value, full=true) }}{% endif %}
{% endfor %} {% for link in links %}
{{ link.name | field_label }}
{% if link["items"] %}{% else %}—{% endif %}
{% endfor %}
{% macro inline_cell(f) %} {% if f.widget == 'checkbox' %} {% elif f.widget == 'textarea' or f.widget == 'json' %} {% elif f.widget == 'select' %} {% elif f.widget == 'number' %} {% elif f.widget == 'datetime' %} {% elif f.widget == 'date' %} {% elif f.widget == 'time' %} {% else %} {% endif %} {% if f.error %}{{ f.error }}{% endif %} {% endmacro %} {% for inline in inlines %}

{{ inline.label }}{% if inline.total %} ({{ inline.total }}){% endif %}

{% if inline.add_url %}{{ t("detail.inline_add") }}{% endif %}
{% if inline.editable %} {% if inline_error %}

{{ inline_error }}

{% endif %}
{% for col in inline.columns %}{% endfor %}{% if inline.can_delete %}{% endif %} {% for row in inline.rows %} {% for f in row.fields %}{% endfor %} {% if inline.can_delete %}{% endif %} {% endfor %} {% if inline.new_row %} {% for f in inline.new_row.fields %}{% endfor %} {% if inline.can_delete %}{% endif %} {% endif %}
{{ col }}{{ t("common.delete") }}
{{ inline_cell(f) }}
{{ inline_cell(f) }}
{% if inline.truncated %}

{{ t("detail.inline_editing_first", shown=inline.rows | length, total=inline.total) }}

{% endif %} {% elif inline.rows %}
{% for col in inline.columns %}{% endfor %} {% for row in inline.rows %} {% for col, value in row.cells %} {% endfor %} {% endfor %}
{{ col | field_label }}
{{ cell(value) }}{% if row.url %}{{ t("common.view") }}{% endif %}
{% if inline.truncated %}

{{ t("detail.inline_showing_first", shown=inline.rows | length, total=inline.total) }}

{% endif %} {% else %}

{{ t("detail.inline_empty") }}

{% endif %}
{% endfor %} {% if audit %}

{{ t("detail.audit") }}

{{ t("detail.created_at") }}
{{ cell(audit.created_at) }}
{% if audit.has_actors %}
{{ t("detail.created_by") }}
{% if audit.created_by %}{{ audit.created_by }}{% else %}—{% endif %}
{% endif %}
{{ t("detail.updated_at") }}
{{ cell(audit.updated_at) }}
{% if audit.has_actors %}
{{ t("detail.updated_by") }}
{% if audit.updated_by %}{{ audit.updated_by }}{% else %}—{% endif %}
{% endif %}
{% endif %} {% if admin.audit_model is not none %}

{{ t("detail.history") }}

{% if history %}
    {% for entry in history %}
  1. {% if entry.action == "create" %}{{ t("detail.history.create") }}{% elif entry.action == "update" %}{{ t("detail.history.update") }}{% elif entry.action == "delete" %}{{ t("detail.history.delete") }}{% elif entry.impersonation %}{{ t("detail.history.impersonate") }}{% elif entry.impersonation_failed %}{{ t("detail.history.impersonate_failed") }}{% elif entry.event %}{{ entry.event }}{% else %}{{ entry.action }}{% endif %} {{ cell(entry.at) }}{% if entry.actor %} · {{ entry.actor }}{% endif %} {% if entry.restore_url %}{{ t("detail.history.restore") }}{% endif %}
    {% if entry.changes %} {% for change in entry.changes %} {% endfor %}
    {{ t("detail.history.field") }}{{ t("detail.history.before") }}{{ t("detail.history.after") }}
    {{ change.field | field_label }} {% if change.before is none %}—{% else %}{{ change.before }}{% endif %} {% if change.after is none %}—{% else %}{{ change.after }}{% endif %}
    {% endif %}
  2. {% endfor %}
{% else %}

{{ t("detail.history_empty") }}

{% endif %} {% endif %}
{% endblock %}