{% if not form.vars.valid %}
    <div class="alert alert-danger alert-dismissible" role="alert">
        <h5>Les erreurs a corriger !</h5>
        {% if not form.vars.valid %}
            <ul class="list-error">
                {% for error in form.vars.errors %}
                    <span class="title-error">{{ (error.origin.config.name)|trans([]) }}</span>
                    <li>{{ error.message }}</li>
                {% endfor %}
            </ul>
        {% endif %}
        {% for children in form.children %}
            {% if not children.vars.valid %}
                <span class="title-error"> {{ (children.vars.name)|trans([]) }}</span>
                <ul>
                    {% for error in children.vars.errors.form.getErrors(true) %}
                        <li>{{ error.message }}</li>
                    {% endfor %}
                </ul>
            {% endif %}
        {% endfor %}
    </div>
{% endif %}

<div class="row">
    <div class="col-md-12">
        <div class="panel panel-info">
            <div class="panel-heading">
                Collection
            </div>
            <div class="panel-body">
                {{ form_row(form.name) }}
                {{ form_row(form.code) }}
                {{ form_row(form.description) }}
                {{ form_row(form.mode) }}
            </div>
        </div>
    </div>
</div>
<div class="row">
    <div class="col-md-12">
        <div class="panel panel-info">
            <div class="panel-heading">
                Produits manuels
            </div>
            <div class="panel-body">
                {{ form_row(form.items) }}
            </div>
        </div>
    </div>
</div>
{{ form_rest(form) }}
