{% extends 'Front/Render/Modal/layout.html.twig' %}

{% set modalClass = 'pee cancel' %}
{% set headerClass = 'bg-la-rioja' %}
{% set bodyClass = 'text-center' %}
{% set footerClass = '' %}

{% block header %}
    <div class="text-center">
        <h3 class="item-title h3 text-no-transform text-normal text-center">
            {{ ('sentence.modal.pee.cancel.demande.title.' ~ app.user.type)|trans({}, 'sentence')|raw }}   
        </h3>
    </div>
{% endblock %}

{% block body %}
    {% if demande.operationpee.state in [constant('AppBundle\\Enum\\OperationPEEState::OPEN')] %}
    <p>
        {{ ('sentence.modal.pee.cancel.demande.description.' ~ app.user.type)|trans({}, 'sentence')|raw }}  
    </p>
    {% else %}
    <p>
        {{ ('sentence.modal.pee.cancel.demande.description.contact_us')|trans({}, 'sentence')|raw }}  
    </p>
    {% endif %}
{% endblock %}

{% block footer %}
    {% if demande.operationpee.state in [constant('AppBundle\\Enum\\OperationPEEState::OPEN')] %}
    <div class="text-center">
        <button data-fancybox-close class="btn btn-lg" title="Fermer">Non</button>
        <button class="btn btn-lg modal-cta-ajax" title="Annuler la demande" data-id="{{ demande.id }}">Oui</button>
    </div>
    <script>
        var modal_cta_ajax_url = '{{ path('cancel_demande_pee', { demande : demande.id }) }}';
        var modal_cta_ajax_data = {};
    </script>
    {% else %}
    <div class="text-center">
        <a class="btn btn-lg modal-cta-ajax" href="{{ path('template', {'id': 81, 'title': 'contact'}) }}">Contacter CGénial</a>
    </div>
    {% endif %}
{% endblock %}