{% block body %}

	<h1>
		{{ 'Consultations' | trad }}
	</h1>
	
	{{ ariane() }}
	
	<h2 id="divMenu" style="position:relative;">
	    {{ 'Consultation' | trad }} {{ consultation.NO_AO }} {{ 'réponse de' | trad }} {{ convertLibelleGlobal(typeFG == 'F'? 'FOURNISS':'GRPFOU', '', reponseEntete.CODE_FOU, true) }} {{ 'du' | trad }} {{ reponseEntete.DTE_REP | dateTrad }} {% if reponseEntete.REFRPFOU %} {{ 'Réf.' | trad }} {{ reponseEntete.REFRPFOU }} {% endif %}

   		{% if 'Modifier l\'entête' | trad and canEdit %}
    		<a class="modifier_v2  white-tooltip"  href="{{ path('Consultation.SaisieReponses.createEditEntet', {idAO: idAO, typeFG:typeFG, idFrs:idFrs, idRep:idRep, CV:CV}) }}" style="float: none;">
    			<span class="infos_tooltip left">
    				{{ 'Modifier l\'entête' | trad }}
                </span>
            </a>
        {% endif %}
        
        {% if canEdit and not contrib %}
			{# TODO : replace popupConfirmation with a function with less parameters #}
            <button id="validerButton" type="button" class="button principal" onClick="popupConfirmation(
				'{{ path('Ajax.Erreur.popupConfirmationSuppresion') }}', '',
				'{{ path(
					'Consultation.SaisieReponses.validateReponse',
					{idAO: idAO, typeFG:typeFG, idFrs:idFrs, idRep:idRep, CV:CV}
				) }}',
				'{{ 'Voulez-vous confirmer la validation de la réponse ?' | trad }}',
				'redirect',
				null,
				null,
				null,
				null,
				null,
				null,
				null,
				null,
				null,
				'{{ 'Validation de la réponse' | trad }}'
			)">
                {{ 'Valider' | trad }}
            </button>
            <button type="button" class="button secondaire" onClick="popupConfirmation('{{ path('Ajax.Erreur.popupConfirmationSuppresion') }}', '', '{{ path('Consultation.SaisieReponses.deleteReponse', {idAO: idAO, typeFG:typeFG, idFrs:idFrs, idRep:idRep, CV:CV}) }}', '{{ 'Etes-vous sûr de vouloir supprimer la réponse ?' | trad |e('js')|raw }}', 'redirect', '', '','','filtre_Consultation')">
                {{ 'Supprimer' | trad }}
            </button>
        {% elseif canDevalidate %}
            <button type="button" class="button secondaire" onClick="popupConfirmation('{{ path('Ajax.Erreur.popupConfirmationSuppresion') }}', '', '{{ path('Consultation.SaisieReponses.devalidateReponse', {idAO: idAO, typeFG:typeFG, idFrs:idFrs, idRep:idRep, CV:CV}) }}', '{{ 'Êtes-vous sûr de vouloir dévalider la réponse ?' | trad }}', 'redirect')">{{ 'Dévalider' | trad }}
			</button>
        {% endif %}
	</h2>
		
	<details open class="block_edition clearfix" id="divEntete">
		<summary class="titre_block">
			{{ 'Entête de la réponse' | trad }}
		</summary>
		<div class="clearfix">	
			<div class="colonne2">
				<div class="informations">
					<p>
						<span class="champs_label">{{ 'Date limite de l\'offre' | trad }}</span>
						<span class="resultat">{{ reponseEntete.DTELIMIT | dateTrad }}</span>
					</p>
					<p>
						<span class="champs_label">{{ 'Devise' | trad }}</span>
						<span class="resultat">{{ convertLibelleGlobal('Devise', '', reponseEntete.DEVISE, true) }}</span>
					</p>
				</div>
			</div>
			<div class="colonne2 last">
				<div class="informations">
					<p>
						<span class="champs_label">{{ 'Type' | trad }}</span>
						<span class="resultat">{{ reponseEntete.C_V == 'C'? 'Conforme' | trad:'Variante' | trad }}</span>
					</p>
					<p>
						<span class="champs_label">{{ 'Commentaire fournisseur' | trad }}</span>
						<span class="resultat">{{ shortLibelle(reponseEntete.COM_FRS, 100) }}</span>
					</p>
				</div>
			</div>
		</div>
	</details>

	{{ arianeSub() }}

{% endblock %}