{% do setAriane(1, 'Modification en attente' | trad) %}

{% extends 'layout.twig' %}

{% block body %}
	
<section class="contenu">
    <h1>{{ 'Accords-cadres' | trad }}</h1>

    {{ ariane() }}

    <header class="bs-row">
        <h2>
            {{- strBuild(
                'Suivi des évènements de @1@' | trad,
                [entityLabel(acd, 'CODE_ACD', 'LIBELLE')]
            ) -}}
        </h2>
        <div class="bs-col text-right">
            <form class="d-inline"
                action="{{ path('Ajax.Outil.appelAsync') }}"
                onsubmit="return ajaxSubmit(event)"
                data-onsuccess="successPopupExport"
            >
                <input type="hidden" name="exportPathAction" value="{{ 
                    path('Contrat.Event.export', {idacc: acd.CODE_ACD}) | e('html_attr')
                }}" />
                <button type="submit" class="button secondaire">
                    {{- 'Exporter' | trad -}}
                </button>
            </form>
        </div>
    </header>

    <form method="post" name="form_table" id="form_table">
        <table class="table" id="tableau">
            <thead class="thead-dark">
                <tr>
                    <th>{{ 'Type d’événements' | trad }}</th>
                    <th>{{ 'Date' | trad }}</th>
                    <th>{{ 'Heure' | trad }}</th>
                    <th>{{ 'Utilisateur' | trad }}</th>
                    <th>{{ 'Commentaire' | trad }}</th> 
                </tr>
            </thead>
            <tbody>
                {% for event in listeSuiviEvent %}
                    <tr>
                        <td>{{ entityLabel(event, 'CODE_EVT', 'LIB') }}</td>
                        <td>{{ event.DTE | dateTrad }}</td>
                        <td>{{ event.HEURE | heureTrad }}</td>
                        <td>{{ entityLabel(event, 'UTIL', 'Util_NOM') }}</td>
                        <td>{{ event.COMMENTAIRE }}</td>
                    </tr>
                {% else %}
                    <tr><td class="text-muted text-center" colspan="5">
                        {{- 'Aucun élément' | trad -}}
                    </td></tr>
                {% endfor %}
            </tbody>
        </table>
        {# {{ paginations(
            path('Contrat.accord-cadre.index', {type: id, idacc: typeAcc}),
            infoPagination.nombreDePage,
            infoPagination.page,
            infoPagination.post,
            ''
        ) }} #}
    </form>
</section>
{% endblock %}