{% extends '@ajax-layout/layout.twig' %}

{% block body %}
<div class="modal-body clearfix display_table">
	<span class="icone-modal interrogation"></span>
    <div class="display_cell">
    	{{ message | raw }}
  	</div>
</div>
<div class="modal-footer">
    <button type="button" class="button secondaire" data-dismiss="modal" onClick="desactivePopup();desactiveLoader();">{{ 'Annuler' | trad}}</button>
    {% if demandeDeConfirmation %}
    	<button type="button" class="button principal" id="confirmeDelete" onClick="AjaxValidationCampagne('{{ path('Evaluation.Campaign.validation', {id : id, confirm : 1 }) }}', '{{ entity }}', '{{ div }}', '{{ form }}');">{{ 'Confirmer' | trad}}</button>
    {% endif %}
</div>
<script>
function AjaxValidationCampagne(path, entity, div, form)
{
	activeLoader();
	$.ajax({
      dataType : 'html',
    	url: path,
    	data : { 'entity' : entity ,'div' : div ,'form' : form, 'page' : '{{page}}',  'post' : {{post | raw }} },
    	type: "POST",
    	success: function(result){
    		$("#modal-content").addClass("modal_small");
				$("#modal-body").html(result);
        
        	desactiveLoader();
			//	activePopup ();
    			
    	},
		error: function(data){
			desactiveLoader();
			console.log(data);
			$("#modal-content").addClass("modal_small");
			$("#modal-body").html(data.responseText);
			activePopup();
		}
    	// error: function (data){
      //   	desactiveLoader();
      //       $("#modal-content").addClass("modal_small");
    	// 	$("#modal-body").html(data.responseText);
      //       activePopup();
    	// }
    });
}
</script>
{% endblock %}