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

{% block title %}Ajouter thématique{% endblock %}

{% block main %}
    <div class="row plr-16 ptb-24">
        <div class="col-xs-5 p-0">
            <div class="bloc-base p-16">

                {% for flashMessage in app.session.flashbag.get('error') %}
                    <div class="alert alert-danger">
                        Erreur :  {{ flashMessage }}
                    </div>
                {% endfor %}

                {% for flashMessage in app.session.flashbag.get('success') %}
                    <div class="alert alert-success">
                        Succès : {{ flashMessage }}
                    </div>
                {% endfor %}

                <div class="bloc-title mb-16">
                    <h2 class="align-middle">Ajouter une thématique</h2>
                </div>
                <div class="row m-0">
                    <div class="col-xs-12 plr-16 pt-16 pb-16 background-white">
                        {{ form_start(form) }}
                        <div class="form-group mb-16">
                            {{ form_label(form.code) }}
                            {{ form_widget(form.code, { 'attr': { 'class': 'inscription plr-16' }}) }}
                            {{ form_errors(form.code) }}
                        </div>
                        <div class="form-group mb-16">
                            {{ form_label(form.intitule) }}
                            {{ form_widget(form.intitule, { 'attr': { 'class': 'inscription plr-16' }}) }}
                            {{ form_errors(form.intitule) }}
                        </div>
                        <div class="form-group mb-16">
                            {{ form_label(form.extension) }}
                            {{ form_widget(form.extension, { 'attr': { 'class': 'inscription plr-16' }}) }}
                            {{ form_errors(form.extension) }}
                            <p class="help-block">Encadrées par des "," / Laisser vide pour aucune restrictions</p>
                        </div>
                        <div class="form-group mb-16">
                            {{ form_row(form.visible) }}
                            <p class="help-block"></p>
                        </div>
                        <div class="text-right">
                            <a href="{{ path('thematique_index') }}" class="button-square-prev prevBtn">Retour</a>
                            <button class="button-square">Ajouter</button>
                        </div>
                        {{ form_end(form) }}
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}
