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

{% block body %}
<div class="modal-body clearfix display_table">
	<span class="icone-modal {{ iconePopup | default('interrogation') }}"></span>
    <div class="display_cell">
    	{{ message|raw  }}
  	</div>
</div>
<div class="modal-footer">
    
    <button type="button" class="button secondaire" data-dismiss="modal" 
        {% if reload %}
        onclick="window.location.reload();"
        {% else %}
        onclick="desactivePopup();desactiveLoader();"
        {% endif %}
    >{{ 'Fermer'|trad }}</button>
    
    {% if pathURL != '' and div != 'redirection' %}
    	<button type="button" class="button principal" onClick="AjaxGestion('{{ pathURL }}','{{ div }}', '{{ option|e('js')|raw }}', '{{ popup }}', '{{ form }}');desactivePopup();{% if loader %}activeLoader(){% endif %}">{{ 'Confirmer'|trad }}</button>
    {% elseif pathURL != '' and div == 'redirection' %}
   		<a class="button principal"  href="{{ pathURL }}">{{ 'Confirmer'|trad }}</a>
    {% elseif onclick != '' %}
        <button type="button" class="button principal" onClick="{{ onclick }}('{{ option |e('js')|raw }}');desactivePopup();{% if loader %}activeLoader(){% endif %}">{{ 'Confirmer'|trad }}</button>
    {% endif %}
</div>
<script>
{% if refresh %}
    $( document ).ready(function() {
        refrechDiv(window.location.pathname, '{{ div_refresh }}', '{{ form_refresh }}');

        {% if withOutPopup %}
            desactivePopup();
        {% endif %}
    });
    
{% elseif reload %}
    $( ".modal-close" ).click(function() {
    	location.reload();
    });
{% endif %}
</script>

{% endblock %}