{% extends 'base.html.twig' %}

{% block title %}Logs d'action{% endblock %}

{% block body %}
<div class="container mt-4">
    <h1>100 derniers logs d'action</h1>
    <table class="table table-striped table-bordered">
        <thead>
            <tr>
                <th>Date</th>
                <th>Type</th>
                <th>Données</th>
            </tr>
        </thead>
        <tbody>
            {% for log in logs %}
                <tr>
                    <td>{{ log.createdAt|date('Y-m-d H:i:s') }}</td>
                    <td>{{ log.type }}</td>
                    <td><pre style="white-space: pre-wrap;">{{ log.data|json_encode(constant('JSON_PRETTY_PRINT')) }}</pre></td>
                </tr>
            {% else %}
                <tr><td colspan="3">Aucun log trouvé.</td></tr>
            {% endfor %}
        </tbody>
    </table>
</div>
{% endblock %} 