{% extends '/admin/menu_left_admin.html.twig' %}

{% block title %} Mettre à jour les CGU {% endblock %}

{% block stylesheets %}
{{ parent() }}
    <!-- Include external CSS. -->
    <link href="{{ asset('css/wysiwyg/font-awesome.min.css') }}" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="{{ asset('css/wysiwyg/codemirror.min.css') }}">

    <!-- Include Editor style. -->
    <link href="{{ asset('css/wysiwyg/all.css') }}" rel="stylesheet" type="text/css" />
    <link href="{{ asset('css/wysiwyg/css.css') }}" rel="stylesheet" type="text/css" />
{% endblock %}

{% block main %}

    {% for flashMessage in errors %}
        <div class="alert alert-danger">
            Erreur :  {{ flashMessage }}
        </div>
    {% endfor %}
    {% if not entete is null and not entete.texte==''%}
		<div class="col-xs-12 p-0">
            <div class="bloc-base p-16">
                {{ entete.texte|raw }}
            </div>
        </div>
    {% endif %}
    <div class="bloc-title mb-16">
        <h2 class="align-middle">Modification des Conditions Générales d'Utilisation</h2>
    </div>
    <div class="row m-0">
        <div class="col-xs-5 plr-16 pt-16 pb-16 background-white" style="width : 100%">
            {{ form_label(form.intitule) }}
            {{ form_start(form, { 'attr': { 'novalidate': 'novalidate' }}) }}

            {{ form_widget(form.intitule, { 'attr': { 'class': 'inscription plr-16' , 'rows' : '20'}}) }}
            {{ form_errors(form.intitule) }}
            {#<p class="help-block">Maximum 500 caractères.</p>#}
            <div class="text-right">
                <a href="{{ path('users_list') }}" class="button-square-prev">{{ "BACK"|trans }}</a>
                {% if is_granted('ROLE_PREVIOUS_ADMIN') %}
                    <button disabled class="button-square" title="non accessible en consultation">Valider</button>
                {% else %}
                <button type="submit" class="button-square" onclick="return confirm('Êtes vous sûr de vouloir effectuer ces modifications?')">Valider</button>
                {% endif %}
            </div>
            {{ form_end(form) }}
        </div>
    </div>
{% endblock %}


{% block javascript %}
{{ parent() }}

<!-- Include external JS libs. -->
    <script type="text/javascript" src="{{ asset('bundles/fosckeditor/ckeditor.js') }}"></script>

    <script type="text/javascript" src="{{ asset('js/jquery.min.js') }}"></script>
    <script type="text/javascript" src="{{ asset('js/codemirror.min.js') }}"></script>
    <script type="text/javascript" src="{{ asset('js/xml.min.js') }}"></script>

{% endblock %}