{% 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-6">
        <div class="panel panel-info">
            <div class="panel-heading">
                Titre & Texte
            </div>
            <div class="panel-body">
                {{ form_row(form.translations) }}
            </div>
        </div>
        <div class="row">
            <div class="col-md-6">
                <div class="panel panel-info">
                    <div class="panel-heading">
                        Dépublier l'actualité
                    </div>
                    <div class="panel-body">
                        {{ form_row(form.disabled) }}
                    </div>
                </div>
            </div>
            <div class="col-md-6">
                <div class="panel panel-info">
                    <div class="panel-heading">
                        Autheur
                    </div>
                    <div class="panel-body">
                        {{ form_row(form.author) }}
                    </div>
                </div>
            </div>
        </div>
        <div class="panel panel-info">
            <div class="panel-heading">
                Date de publication
            </div>
            <div class="panel-body">
                {{ form_row(form.publishedAt) }}
                {{ form_row(form.unPublishedAt) }}
            </div>
        </div>
    </div>
    <div class="col-md-6">
        <div class="panel panel-info">
            <div class="panel-heading">
                Images
            </div>
            <div class="panel-body">
                {{ form_row(form.images) }}
            </div>
        </div>
        <div class="panel panel-info">
            <div class="panel-heading">
                Lien Youtube
            </div>
            <div class="panel-body">
                {{ form_row(form.video) }}
                {% if item is defined %}
                    {% if item.video is not null %}
                        <div class="plyr__video-embed" id="player">
                            <iframe
                                src="https://www.youtube.com/embed/{{ item.video.path }}?origin={{ app.request.getSchemeAndHttpHost() }}&amp;iv_load_policy=3&amp;modestbranding=1&amp;playsinline=1&amp;showinfo=0&amp;rel=0&amp;enablejsapi=1"
                                allowfullscreen allowtransparency allow="autoplay"></iframe>
                        </div>
                    {% endif %}
                {% endif %}
            </div>
        </div>
        <div class="panel panel-info">
            <div class="panel-heading">
                Fichier
            </div>
            <div class="panel-body">
                {{ form_row(form.file) }}
            </div>
        </div>
        <div class="panel panel-info">
            <div class="panel-heading">
                Indiquer une date et une adresse si l'article concerne un évènement.
            </div>
            <div class="panel-body">
                {{ form_row(form.eventAt) }}
                {{ form_row(form.address) }}
                {{ form_row(form.postal) }}
                {{ form_row(form.city) }}
                {{ form_row(form.country) }}
            </div>
        </div>
        <div class="panel panel-info">
            <div class="panel-heading">
                Catégorie
            </div>
            <div class="panel-body">
                {{ form_row(form.category) }}
            </div>
        </div>
    </div>
</div>
{{ form_rest(form) }}
