<div class="actus-home">
    <h2>Actualités</h2>
    <ul>
        {% for actu in actus %}
            <li class="item">
                <article>
                    {% if loop.index == 1 %}
                        <header>
                            <h3>
                                <a href="{{ path('single_actu', {
                                    idlevel1: mainmenuactu.id,
                                    titlelevel1: mainmenuactu.slug,
                                    idlevel2: actu.menu.id,
                                    titlelevel2: actu.menu.slug,
                                    id: actu.id,
                                    title: actu.title|lower|replace({' ':'-'})|url_encode
                                }) }}">
                                    {{ actu.title }}
                                </a>
                            </h3>
                            <time class="date" datetime="{{ actu.created|date('Y-m-d') }}">
                                {{ actu.created|date("d/m/Y") }}
                            </time>
                        </header>

                        <figure class="img-block">
                            <img src="{{ asset(actu.getWebPath()) }}" alt="{{ actu.title }}" />
                        </figure>

                        <div>{{ actu.article|striptags|truncate(300, false, '…')|raw }}</div>
                    {% else %}
                        <header>
                            <h3>
                                <a href="{{ path('single_actu', {
                                    idlevel1: mainmenuactu.id,
                                    titlelevel1: mainmenuactu.slug,
                                    idlevel2: actu.menu.id,
                                    titlelevel2: actu.menu.slug,
                                    id: actu.id,
                                    title: actu.title|lower|replace({' ':'-'})|url_encode
                                }) }}" >
                                    {{ actu.title }}
                                </a>
                            </h3>
                            <time class="date" datetime="{{ actu.created|date('Y-m-d') }}">
                                {{ actu.created|date("d/m/Y") }}
                            </time>
                        </header>
                    {% endif %}
                </article>
            </li>
        {% endfor %}
    </ul>
    <p>
        <a class="link-more link-more-theme" href="{{ path('list_actu', {id:mainmenuactu.id, slug:mainmenuactu.slug, type:'All'}) }}">
            Voir toutes les actus
            <span class="bubble bubble-xs">
                <i class="icon-cgenial icon-arrow-right"></i>
            </span>
        </a>
    </p>
</div>