{% extends "admin_base.html" %} {% block title %}{% if admin_detail_title %}{{ admin_detail_title }}{% endif %} — {{ resource.title | default(value=resource_key) }} #{{ object_id }}{% endblock %} {% block breadcrumb %} {% if parent_key %} / {{ parent_title }} {% endif %} / {{ resource.title | default(value=resource_key) }} / {% if admin_detail_breadcrumb %}{{ admin_detail_breadcrumb }}{% endif %} #{{ object_id }} {% endblock %} {% block content %} {% block detail_header %}

{% if admin_detail_title %}{{ admin_detail_title }}{% endif %} — {{ resource.title | default(value=resource_key) }}

{% if admin_detail_entry_label %}{{ admin_detail_entry_label }}{% endif %} #{{ object_id }}

{% block detail_actions %}
{% if admin_detail_btn_list %}{{ admin_detail_btn_list }}{% endif %} {% set_global can_modify = false %} {% if current_user %} {% if current_user.is_superuser %} {% set_global can_modify = true %} {% else %} {% for groupe in current_user.groupes %} {% for perm in groupe.permissions %} {% if perm.resource_key == resource.key and perm.can_update %} {% set_global can_modify = true %} {% endif %} {% endfor %} {% endfor %} {% endif %} {% endif %} {% if current_user and can_modify %} {% set has_password = false %} {% for key, value in entry %}{% if key == "password" or key == "password_hash" %}{% set_global has_password = true %}{% endif %}{% endfor %} {% if has_password %}
{% csrf %}
{% endif %} {% if admin_detail_btn_edit %}{{ admin_detail_btn_edit }}{% endif %}
{% csrf %}
{% if admin_detail_btn_edit %}{{ admin_detail_btn_edit }}{% endif %} {% if has_password %}
{% csrf %}
{% endif %}
{% csrf %}
{% endif %}
{% endblock %}
{% endblock %} {% block detail_table %}
{% for key, value in entry %} {% if key != "id" %} {% endif %} {% endfor %}
id #{{ object_id }}
{{ key }} {% if key == "password" or key == "password_hash" %} •••••••• {% elif value == true %} {% if admin_list_bool_true %}{{ admin_list_bool_true }}{% endif %} {% elif value == false %} {% if admin_list_bool_false %}{{ admin_list_bool_false }}{% endif %} {% elif value %} {% if rich_fields and key in rich_fields %}{{ value | sanitize }}{% else %}{{ value }}{% endif %} {% else %} {% endif %}
{% endblock %} {% if m2m_fields is defined and m2m_fields %} {% for field in m2m_fields %}
{{ field.label }}
{% if field.selected | length > 0 %} {% for choice in field.choices %} {% if choice[0] in field.selected %} {{ choice[1] }} {% endif %} {% endfor %} {% else %} {% endif %}
{% endfor %} {% endif %} {% if inlines is defined and inlines %} {% for inline in inlines %}
{{ inline.title }} {% if inline.can_create %} + {{ inline.title }} {% endif %}
{% for col in inline.columns %} {% endfor %} {% for row in inline.rows %} {% for col in inline.columns %} {% endfor %} {% else %} {% endfor %}
{% if inline.column_labels[col] %}{{ inline.column_labels[col] }}{% else %}{{ col | replace(from="_", to=" ") }}{% endif %}
{% set value = row[col] %} {% if value == true %}{% if admin_list_bool_true %}{{ admin_list_bool_true }}{% endif %} {% elif value == false %}{% if admin_list_bool_false %}{{ admin_list_bool_false }}{% endif %} {% elif value %}{{ value }} {% else %}{% endif %} {% if inline.can_update %} {% if admin_list_btn_edit %}{{ admin_list_btn_edit }}{% endif %} {% endif %} {% if inline.can_delete %}
{% csrf %}
{% endif %}
{% endfor %} {% endif %} {% endblock %}