{% extends "base.html" %} {% from "macros.html" import icon %} {% block title %}{{ title }}{% endblock %} {% block content %}
{# Field groups #} {% for group in field_groups %}
{% if group.label %}

{{ group.label }}

{% endif %}
{% for pair in group.fields %} {% set field = pair.f %} {% set model_field = pair.m %} {# SECURITY: Skip password fields - never show passwords #} {% if model_field and model_field.is_password %} {# Don't display password fields in detail view #} {% else %}
{{ field.label }}
{% if model_field and model_field.name %} {% set value = item[model_field.name] if item else none %} {% if value is none or value == '' %} {# Check for boolean fields by name pattern #} {% elif model_field.name in ['is_admin', 'is_active', 'verified', 'totp_enabled'] %} {% if value == 1 or value == '1' or value == true %} {{ icon('check', 14) }} {{ t('Yes') }} {% else %} {{ icon('x', 14) }} {{ t('No') }} {% endif %} {% elif model_field and model_field.wysiwyg %}
{{ value | safe }}
{% elif model_field and model_field.is_text %}
{{ value }}
{% elif model_field and model_field.is_date %} {{ value }} {% elif model_field and model_field.is_datetime %} {{ value.strftime('%Y-%m-%d %H:%M:%S') if value else '—' }} {% elif model_field and (model_field.is_file or model_field.is_image) %} {% if value %} {{ icon('download', 14) }} {{ value.split('/')[-1] }} {% else %} {% endif %} {% elif model_field and model_field.is_fk %} {% if value %} {{ value }} {% else %} {% endif %} {% else %} {{ value }} {% endif %} {% else %} {% endif %}
{% endif %} {% endfor %}
{% endfor %} {# Permission matrix (read-only for Role) #} {% if permission_matrix %}

{{ icon('shield', 18) }} {{ t('Permissions') }}

{% if permission_matrix.wildcard %}
{{ icon('shield', 16) }} {{ t('Superuser') }} — {{ t('Full access to all resources. Bypasses matrix below.') }}
{% endif %}
{% for v in permission_matrix.verbs %}{% endfor %} {% for row in permission_matrix.rows %} {% for cell in row.cells %} {% endfor %} {% endfor %}
{{ t('Model') }}{{ t(v) }}
{{ row.label }} {% if cell.checked %} {{ icon('check', 14) }} {% else %} {% endif %}
{% endif %} {# M2M Relations #} {% for m2m in m2m_fields %}

{{ m2m.label }}

{% if m2m.current %}
{% for opt in m2m.current %} {{ opt.label }} {% endfor %}
{% else %}

{{ t('No related records') }}

{% endif %}
{% endfor %} {# Inline relations #} {% for inline in inlines %}

{{ inline.label }}

{% if inline.rows %}
{% for col in inline.columns %}{% endfor %} {% for row in inline.rows %} {% for col in inline.columns %}{% endfor %} {% endfor %}
{{ col }}
{{ row[col] }} {% if inline.target_slug %} {{ icon('search', 16) }} {% endif %}
{% else %}

{{ t('No related records') }}

{% endif %}
{% endfor %} {# Action buttons #}
{% if can_edit %} {{ icon('edit', 14) }} {{ t('Edit') }} {% endif %} {{ icon('arrow-left', 14) }} {{ t('Back to list') }}
{% if item and item.id and can_delete %}
{{ request.csrf_input() }}
{% endif %}
{% endblock %}