{% extends 'layout.twig' %}

{% block body %}
    <!-- Modal content -->
    <div id="myModal" class="modal" tabindex="-1" role="dialog">

        <div class="modal-dialog" style="width:auto;height:auto;{% if application != 'Mobility' %}min-width:500px{% endif %}" role="document">
            <div id="modal-content" class="modal-content" style="z-index:99999;{% if application != 'Mobility' %}min-width: 600px;{% endif %}">
                <div class="modal-header">
                    <span class="modal-close">&times;</span>
                    <h3 id="modal-title"></h3>
                </div>
                <div id="modal-body" style="padding: 15px;z-index:99999">
                </div>
            </div>
        </div>
    </div>
	<div class="contenu clearfix"  id="categorie">
		<h1>
			{{ titre }}
			
			{% if droits.HA_MQUESCM %}
                {{ Button('Nouvelle catégorie' | trad, true, path('Evaluation.Category.creationCategorie'), '', '', '', '', '', '') }}
                {{ Button('Import' | trad, true, path('Evaluation.Category.importIndex'), '', '', '', '', '', '') }}
            {% endif %}
            {{ ButtonExport(path('Evaluation.Category.export'), 'filtre_categorie' , path('Ajax.Erreur.popupInformation') , path('Ajax.Outil.appelAsync'), 'Export catégories' | trad ) }}
		</h1>
		
		{{ ariane() }}
		
		<div class="tab-content" id="divRefresh">
			<form method="post" name="filtre_categorie" id="filtre_categorie">
                <div class="resultat_filtre">
                {{ bullFiltre(post, 'filtre_categorie') }}
                </div>
                <table class="table table-hover">
                    <thead class="thead-dark">
                        <tr>
                            <th scope="col" width="10%">{{ triTable('ID_GRILLE',  post.tri_ID_GRILLE, 'Code' | trad, '', '', 'filtre_categorie') }}</th>
                            <th scope="col" width="">{{ triTable('LIB_GRILLE',  post.tri_LIB_GRILLE, 'Libellé' | trad, '', '', 'filtre_categorie') }}</th>
                            <th scope="col" width="7%">{{ 'Actions' | trad }}</th>
                        </tr>
                        <tbody>
                            <tr class="recherche" >
                                <td>{{ filterTable('ID_GRILLE', post.filter_ID_GRILLE, '', '', '','filtre_categorie', '','Code' | trad,'',true) }}</td>
                                <td>{{ filterTable('LIB_GRILLE', post.filter_LIB_GRILLE, '', '', '','filtre_categorie', '','Libellé' | trad,'',true) }}</td>
                                <td></td>
                            </tr>
                        </tbody>
                        {% for category in categoryList %}
                            <tr id="category{{ loop.index }}">
                                <td>{{ category.ID_GRILLE }}</td>
                                <td>{{ category.LIB_GRILLE }}</td>
                                <td class="parametrage" >   
                                    {% if droits.HA_MQUESCM %}
                                        {{ menuContextuel('category'~ loop.index, false, category.menuContextuel, 6) }}   
                                    {% endif %}
                                </td>
                            </tr>
                        {% endfor %}
                    </thead>
                </table>
                {{ paginations(path('Evaluation.Category.index'),infoPagination.nombreDePage, infoPagination.page, infoPagination.post, 'divRefresh') }}

            </form>
        </div>
    
    </div>
{% endblock %}