{% set menuActive = 'Administration' %}
{% set menuLeft = 'Administration.GestionUtilisateur.listCollab' %}
{% do setAriane(0, 'Liste des collaborateurs' | trad) %}

{% extends 'layout.twig' %}
{% block body %}
<section class="contenu">
    <h1>{{ 'Administration' | trad }}</h1>
    
    {% include '@Administration/GestionUtilisateur/_navbar.twig' with {
        current_route: current_route,
        mapCount: mapCount,
    } only %}

    <article class="tab-content" id="divRefresh">
        <header class="bs-row">
            <h4 class="bs-col">{{ 'Liste des collaborateurs' | trad }}</h4>
            <div class="bs-col text-right">
                <form class="bs-col-auto ml-auto"
                    action="{{ path('Ajax.Outil.appelAsync') }}"
                    onsubmit="return ajaxSubmit(event, new FormData(document.getElementById('form-filtre')))"
                    data-onsuccess="successPopupExport"
                >
                    <input type="hidden" name="exportPathAction" 
                        value="{{ path('Administration.ExportUtilisateur.export') }}"
                    />
                    <button class="button principal m-0" type="submit">
                        {{- 'Exporter' | trad -}}
                    </button>
                </form>
            </div>
        </header>
        {% embed '@Administration/GestionUtilisateur/_tableUser.twig' with {
            listItem: listItem,
            infoPagination: infoPagination,
            post: post,
        } only %}
            {% block action %}
                <a class="button principal" href="{{ path(
                    'Administration.GestionUtilisateur.formEditUser',
                    {userId: item.CODE}
                ) }}">
                    {{- 'Modifier' | trad -}}
                </a>
            {% endblock %}
        {% endembed %}
    </article>
</section>
{% endblock %}


