{% extends '@ajax-layout/layout.twig' %}
{% block body %}
<div class="modal-body clearfix display_table">
    <input type="hidden" name="data_question" id="data_question" value="{{id_theme}}" />
    <input type="hidden" name="modeForm" id="mode_form" value="{{mode}}" />
    <span class="icone-modal interrogation"></span>
    <div class="display_cell">
        {{ deleteMessage }} 
    </div>
</div>
<div class="modal-footer">
    <a type="button" class="button secondaire" data-dismiss="modal" onClick="desactivePopup()">{{ 'Fermer'|trad }}</a>
    <a class="button principal" onClick="supprimerTheme({{ path('Evaluation.BibliothequeDeQuestions.supprimerTheme', {mode:mode, idCamp:idCamp, idTheme:idTheme}) | json | e('html_attr') }})">{{ 'Confirmer'|trad }}</a>
</div>
<script>
    function supprimerTheme(path)
    {
        $.ajax({
            url : path,
            type: 'POST',
            dataType : 'HTML',
            data: {'choix' : 'O'},
            success: function (data) 
            {
                var json_obj = $.parseJSON(data);
                if('supprimer' in json_obj)
                {
                    window.location.reload();
                    desactivePopup();
                }
            }
        });
    }
</script>
{% endblock %}