{% extends "/admin/menu_left_admin.html.twig" %}

{% block title %}Historique actions{% endblock %}


{% block main %}

    {% if not entete is null and not entete.texte==''%}
        <div class="col-xs-12 p-0">
            <div class="bloc-base p-16">
                {{ entete.texte|raw }}
            </div>
        </div>
    {% endif %}
    <div class="bloc-title mb-16">
        <h2 class="align-middle">Historique des actions</h2>
    </div>
    <div class="row m-0">
        <div class="col-xs-12 p-16 background-white">
            <div class="table-responsive">
                <table id="myTable" class="display">
                    <thead class="background-orange">
                    <tr>
                        <th class="plr-8 ptb-16">Date</th>
                        <th class="plr-8 ptb-16">Utilisateur</th>
                        <th class="plr-8 ptb-16">Type d'action</th>
                        <th class="plr-8 ptb-16">Entité</th>
                        <th class="plr-8 ptb-16">Message</th>
                    </tr>
                    </thead>
                    <tbody>

                    {% for h in histo|sort %}
                        <tr>
                            {% if '30/11/-0001' not in h.date|date('d/m/Y H:i:s') and h.date is not null %}
                                <td class="plr-8 ptb-24">{{h.date ? h.date|date('d/m/Y H:i:s')}}</td>
                            {% else %}
                                <td class="plr-8 ptb-24"></td>
                            {% endif %}
                            <td class="plr-8 ptb-24">{{ h.utilisateur.prenom }} {{ h.utilisateur.nom }}</td>
                            <td class="plr-8 ptb-24">{{ h.type }}</td>
                            <td class="plr-8 ptb-24">{{ h.entite }}</td>
                            <td class="plr-8 ptb-24">{{ h.message }}</td>
                        </tr>
                    {% endfor %}
                    </tbody>
                </table>
            </div>
        </div>
    </div>
{% endblock %}