{% extends '@CpCreationVitiCore/admin/base.html.twig' %}

{% block content %}
    <h1 class="page-header">Journal d'audit</h1>

    <div class="panel panel-default">
        <div class="panel-heading">
            Entités suivies ({{ entities|length }})
        </div>
        <table class="table table-striped">
            <thead>
            <tr>
                <th>Entité</th>
                <th>Table</th>
                <th>Logs</th>
                <th>Action</th>
            </tr>
            </thead>
            <tbody>
            {% for entity in entities %}
                <tr>
                    <td>
                        <strong>{{ entity.label }}</strong><br>
                        <small>{{ entity.class }}</small>
                    </td>
                    <td><code>{{ entity.table }}</code></td>
                    <td>{{ entity.count }}</td>
                    <td>
                        <a href="{{ path('admin_audit_history', { entity: entity.param }) }}" class="btn btn-info btn-xs">
                            <i class="fas fa-history"></i> Voir les logs
                        </a>
                    </td>
                </tr>
            {% else %}
                <tr>
                    <td colspan="4">Aucun journal d'audit disponible.</td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>
{% endblock %}
