{% extends 'layout.twig' %}

{% block body %}
    {% if mode != 'campagne' %}
	<div class="contenu clearfix" id="importModele">
		<h1>{{ titre }}
		</h1>

		{{ ariane() }}

		<div class="tab-content">
			<div id="divImprot" class="clearfix">
	{% endif %}
				{% if mode == 'AO' %}

					<h2>{{ consultation.OBJET_AO }}
						{{ 'créé le' | trad }}
						{{ consultation.DTE_AO | dateTrad }}
						{{ 'par' | trad }}
						{{ AOEventCreat.NOM }}</h2>

					{% include '@Consultation/Consultation/block_entete.twig' %}
				{% elseif mode == 'campagne' %}
					{# <h2>{{ subtitle }}</h2> #}
					{% include "@Evaluation/Campaign/entete.twig" %}
				{% else %}
					<h2>{{ 'Gestions des thèmes' | trad }}</h2>
				{% endif %}

				<div>
					<h2>
						{{ 'Liste des modèles' | trad }}

						<a class="button secondaire" href="{{ pathBack }}">{{ 'Retour' | trad }}</a>
					</h2>
					<table class="table table-hover">
						<thead class="thead-dark">
							<tr>
								<th scope="col" width="">{{ 'id' | trad }}</th>
								<th scope="col" width="">{{ 'Libellé' | trad }}</th>
								<th scope="col" width="">{{ 'Grille' | trad }}</th>
								<th scope="col" width="">{{ 'Date création' | trad }}</th>
								<th scope="col" width="">{{ 'Utilisateur création' | trad }}</th>
								<th scope="col" width="">{{ 'Date Modification' | trad }}</th>
								<th scope="col" width="">{{ 'Utilisateur Modification' | trad }}</th>
								<th scope="col">{{ 'Non modifiable sur AO ?' | trad }}</th>
								<th width="30px"></th>
							</tr>
						</thead>
						<tbody>
							{% for modele in listeModele %}
								<tr id="modele{{ modele.ID_MODEL }}">
									<td>{{ modele.ID_MODEL }}</td>
									<td>{{ modele.LIB_MODEL }}</td>
									<td>{{ modele.ID_GRILLE }}</td>
									<td>{{ modele.DTE_CREAT | dateTrad }}</td>
									<td>{{ modele.CREE_NOM }}
										({{ modele.CREE_PAR }})</td>
									<td>{{ modele.DTE_MODIF | dateTrad }}</td>
									<td>{{ modele.MODIF_NOM }}
										({{ modele.MODIF_PAR }})</td>
									<td>{{ modele.NON_MODIF_AO | boolTrad }}</td>
									<td>
										{{ hover_action('modele' ~ modele.ID_MODEL, 'download_noir_v2' , "ajaxPopupV2('"~path('Evaluation.ImportBibliotheque.importModele', {mode:mode,idMode:idMode, idModele:modele.ID_MODEL})~"')", 'float: right;') }}
									</td>
								</tr>
							{% endfor %}
						</tbody>
					</table>
				</div>

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