{# templates/admin/logs/index.html.twig #} {% extends 'admin/base_admin.html.twig' %} {% block title %}Logs d'accès admin — NUM-ECARD{% endblock %} {% block stylesheets %} {{ parent() }} {% endblock %} {% block content %}
{# ── HEADER ─────────────────────────────────────────────────────────── #}

🔒 Logs d'accès administrateur

RGPD Art. 5(1)(b) & 5(2) — Référent RGPD uniquement — Purge le {{ purge_date|date('d/m/Y') }}
{{ total }} entrée{{ total > 1 ? 's' : '' }} {{ total_today }} aujourd'hui
{# ── FILTRES ─────────────────────────────────────────────────────────── #}
{# ── TABLE ───────────────────────────────────────────────────────────── #}
{% if logs is empty %}
📋

Aucun log pour ces critères.

{% else %}
{% for log in logs %} {% endfor %}
Date / Heure Admin Action Ressource Chemin IP (tronquée) Ctx
{{ log.createdAt|date('d/m/Y') }}
{{ log.createdAt|date('H:i:s') }}
{{ log.adminEmail }} {{ log.action }} {{ log.resource ?? '—' }} {{ log.method }} {{ log.path|length > 55 ? log.path|slice(0, 55) ~ '…' : log.path }} {{ log.ipTronquee }} {% if log.context %} {% else %} {% endif %}
{# ── PAGINATION ──────────────────────────────────────────── #} {% if total_pages > 1 %}
Page {{ current_page }} / {{ total_pages }}  ·  {{ total }} entrée{{ total > 1 ? 's' : '' }}
{% endif %} {% endif %}
{# ── NOTE RGPD ───────────────────────────────────────────────────────── #}
🔒 RGPD — Notice : Logs collectés sur le fondement des Art. 5(1)(b) et 5(2) RGPD. Usage autorisé : sécurité et audit interne exclusivement. Toute consultation à des fins commerciales ou disciplinaires est interdite. Purge automatique le {{ purge_date|date('d/m/Y') }}.
{% endblock %} {% block javascripts %} {{ parent() }} {% endblock %} {# ── MACRO : couleur du badge selon l'action ─────────────────────────── #} {% macro actionBadge(action) %} {%- if action starts with 'delete' or action starts with 'revoke' -%} bg-danger {%- elseif action starts with 'edit' or action starts with 'update' or action starts with 'adjust' -%} bg-warning text-dark {%- elseif action starts with 'generate' or action starts with 'send' or action starts with 'push' -%} bg-info text-dark {%- elseif action starts with 'activate' or action starts with 'grant' or action starts with 'reactivate' -%} bg-success {%- elseif action starts with 'deactivate' or action starts with 'suspend' -%} bg-secondary {%- else -%} bg-primary {%- endif -%} {% endmacro %}