{% extends 'base.html.twig' %}

{% block pagewrapper %}
{{ form_start(form) }}
    <h1 class="page-title">
    Mailing
    </h1>

    <p>
        {{ form_widget(form.submit) }}
    </p>

    {% if app.session.flashbag.has('error') %}
        <div class='alert alert-danger' style='margin: 5px 0px'>
            <strong>Erreur</strong><br>
            {% for flashMessage in app.session.flashbag.get('error') %}
                {{ flashMessage }}<br>
            {% endfor %}
        </div>
    {% endif %}

    {% if app.session.flashbag.has('notice') %}
        <div class='alert alert-info' style='margin: 5px 0px'>
            <strong>Information</strong><br>
            {% for flashMessage in app.session.flashbag.get('notice') %}
                {{ flashMessage }}<br>
            {% endfor %}
        </div>
    {% endif %}
    <div class="card">
        <div class="card-header">
            <i class="fa fa-pencil-alt fa-fw"></i> Destinataires
        </div>

        <div class="card-body">
            {{ form_row(form.niveau01) }}
            {% if form.groups is defined %}
                {{ form_row(form.groups) }}
            {% endif %}
        </div>
    </div>

    <div class="card">
        <div class="card-header">
            <i class="fa fa-envelop fa-fw"></i> Mail
        </div>

        <div class="card-body">
            {{ form_row(form.subject) }}
            {{ form_row(form.message) }}
        </div>
    </div>    
{{ form_end(form) }}
{% endblock %}
