{% extends '@CadolesCore/base.html.twig' %}

{% block pagewrapper %}
{{ form_start(form) }}
    <h1 class="page-header">
    {% if mode=="update" %}
    Modification Flux = {{flux.title}}
    {% elseif mode=="submit" %}
    Création Flux
    {% endif %}
    </h1>

    {{ form_widget(form.submit) }}
    <a class="btn btn-default" href={{ path('cadoles_portal_config_flux') }}>Annuler</a>

    {% if mode=="update" %}
    <a href={{ path('cadoles_portal_config_flux_delete',{'id':flux.id}) }}
        class="btn btn-danger pull-right"
        data-method="delete" data-csrf="_token:{{ 'csrf' }}"
        data-confirm="Êtes-vous sûr de vouloir supprimer ce flux ?">
          Supprimer
    </a>
    {% endif %}

    <br><br>

    {% 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="form-group row clearfix">      
        <div class="col-md-8">
            {{ form_row(form.title) }}
            {{ form_row(form.url) }}
            {{ form_row(form.maxread) }}
            {{ form_row(form.color) }}
        </div>

        <div class="col-md-4">
            {{ form_row(form.roles) }}
            {{ form_row(form.groups) }}
        </div>
    </div>

  
{{ form_end(form) }}
{% endblock %}

{% block localjavascript %}
{% endblock %}
