{% extends 'layout.twig' %}

{% block body %}

    <div class="contenu">
        <h1>{{ 'Extraction des textes' | trad }}</h1>

        <button type="button" class="principal button" id="extraire">{{ 'Extraire' | trad }}</button>

    </div>

    <script>
        $('#extraire').click(function(){
            activeLoader();
            $.ajax({
                url : '{{ path('Systeme.GestionSystem.ajaxExtractionTraduction') }}',
                dataType : 'json',
                type: "POST",
                data: {},
                
                success : function(data){ 
                    window.open(data.file,'_blank');

                    if (data.error) {
                        alert(data.error);
                    }

                    desactiveLoader();
                }
            });
        });
    </script>

{% endblock %}