{% extends 'layout.twig' %}

{% block body %}

<section class="contenu clearfix"  id="listeFormat">
	<h1>
		{{ 'Format' | trad }}

		{{ Button('Création d\'un paramètre' | trad, true, path('Catalogue.nomParametrage.createEdit')) }}
	</h1>
		
    {{ ariane() }}

	<div class="tab-content" id="tab-content">
		<form method="post" name="filtre_format" id="filtre_format">		
			<input type="hidden" name="page" value="{{post.page}}">	
			<div id="refreshDiv">
			<table class="table table-hover">
				<thead class="thead-dark">
					<tr>
						<th scope="col" width="">{{ triTable('IDCLE',  post.tri_IDCLE, 'ID clé' | trad, '', '', 'filtre_format') }}</th>
                        <th scope="col" width="">{{ triTable('NOM_PARAMETRE',  post.tri_NOM_PARAMETRE, 'Nom paramètre' | trad, '', '', 'filtre_format') }}</th>
						<th scope="col" width="100px">{{ 'Actions' | trad }}</th>
					</tr>
				</thead>

				<tbody>
					<tr class="recherche">
						<td>{{ filterTable('IDCLE', post.filter_IDCLE, '', '', '', 'filtre_format', '', '') }}</td>
                        <td>{{ filterTable('NOM_PARAMETRE', post.filter_NOM_PARAMETRE, '', '', '', 'filtre_format', '', '') }}</td>
						<td></td>
					</tr>
                    {% for nom in liste %}
                        <tr id="format{{loop.index}}">
                            <td class="code">{{ nom.IDCLE }}</td>
                            <td>{{ nom.NOM_PARAMETRE }}</td>
                            <td>
                                {{ hover_action(
                                    'format'~loop.index, 
                                    'modifier_v2' , 
                                    "redirectJSWithPost('"~path('Catalogue.nomParametrage.createEdit', {idCle:nom.IDCLE,nomParam:nom.NOM_PARAMETRE})~"');", 
                                    'float: right;margin-right:5px;'
                                ) }}
                                {{ hover_action(
                                    'format'~loop.index, 
                                    'Supprimer_v2' , 
                                    "popupConfirmation(\'"~path('Ajax.Erreur.popupConfirmationSuppresion')~"\', \'\', \'"~path('Catalogue.nomParametrage.delete', {idCle:nom.IDCLE,nomParam:nom.NOM_PARAMETRE})~"\', \'"~('Etes-vous sûr de vouloir supprimer la donnée' | trad |e('js')|raw)~" ?\', \'tab-content\', '', '', '', '', '', '')", 
                                    'float: right;margin-right:5px;'
                                ) }}
							</td>
                        </tr>
                    {% endfor %}
				</tbody>
			</table>
			</div>

			{{ paginations(path('Catalogue.nomParametrage.liste'),infoPagination.nombreDePage, infoPagination.page, infoPagination.post, '') }}

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