<section class="col-md-9 col-xs-12 dates-retenir">
    <h2 class="h2-home-theme"><span>{{ rootTitle|raw }}</span></h2>
    <a href="{{ path('ez_urlalias', {'locationId': rootID }) }}" class="voir-plus"> Voir tous les événements</a>
    <div id="slideDates" class="flexslider bloc-agenda-style2">

        <div class="flex-viewport">
            <ul class="slides">
                {% for locationId,event in eventsList %}
                    <li class="fitted">
                        <a href="{{ path('ez_urlalias', {'locationId': locationId }) }}"></a>
                        {{ ez_render_field( event, "vignette", { 'template': 'AyalineEzAgendaCollectivitesBundle:fields:event_ezobjectrelation.html.twig', 'parameters': { 'alias': 'home_event_agenda_3' } } ) }}
                        <div class="caption">
                            <div class="date-event">
                                {% if event.fields.date_debut is defined and not ez_is_field_empty( event, "date_debut" ) and event.fields.date_fin is defined and not ez_is_field_empty( event, "date_fin" )
                                and event.getFieldValue('date_debut').date != event.getFieldValue('date_fin').date %}
                                    <time datetime="{{ ez_field_value(event, "date_debut")|localizeddate('none', 'none', app.request.locale, null, "yyyy-MM-dd") }}">{{ ez_field_value(event, "date_debut")|localizeddate('none', 'none', app.request.locale, null, "dd") }} - {{ ez_field_value(event, "date_fin")|localizeddate('none', 'none', app.request.locale, null, "dd") }}</time>
                                    <span class="date">{{ ez_field_value(event, "date_debut")|localizeddate('none', 'none', app.request.locale, null, "MMM") }} {{ ez_field_value(event, "date_fin")|localizeddate('none', 'none', app.request.locale, null, "MMM") }}</span>
                                {% else %}
                                    <div>
                                        <time datetime="{{ ez_field_value(event, "date_debut")|localizeddate('none', 'none', app.request.locale, null, "yyyy-MM-dd") }}">{{ ez_field_value(event, "date_debut")|localizeddate('none', 'none', app.request.locale, null, "dd") }}</time>
                                        <span class="date">{{ ez_field_value(event, "date_debut")|localizeddate('none', 'none', app.request.locale, null, "MMM") }}</span>
                                    </div>
                                {% endif %}
                            </div>
                            <h3>{{ ez_render_field(event, 'thematiques') }}</h3>
                            <p>{{ ez_render_field(event, 'titre') }}</p></div>
                    </li>
                {% endfor %}
            </ul>
        </div>
        <ul class="flex-direction-nav">
            <li><a class="flex-prev" href="#" tabindex="-1"></a></li>
            <li><a class="flex-next flex-disabled" href="#" tabindex="-1"></a></li>
        </ul>
    </div>
</section>