{% extends 'Front/layout.html.twig' %}

{% import 'Front/Default/macro.html.twig' as m %}

{% set metatitle = content.metatitle ? content.metatitle : content.menu %}
{% set metadescription = content.metadescription ? content.metadescription : null %}

{% set bodyClass = content.menu.class %}

{% block body %}
    <div class="row">
        <div class="content list col">
            <div class="content-text">
                {{ content.article|replace_custom_keys|raw }}
            </div>

            <div class="row list-cards cards-partners">
                {% for partner in partners %}
                    <div class="col-md-6 col-lg-3">
                        <article class="item card bg-white">
                            <a data-fancybox data-type="ajax" href="{{ path('modal_partner', {partner:partner.id}) }}" title="Découvrir {{ partner.name }}" class="d-block" rel="nofollow">
                                <div class="item-content">
                                    <figure class="img-block">
                                        {% if partner.logoPath is not empty %}
                                        <img alt="" class="img-fluid" src="{{ vich_uploader_asset(partner, 'logoFile')|imagine_filter('150H') }}"/>
                                        {% else %}
                                        {{ m.svg({class: 'icon-logo', id:'logo--logo-grayscale'}) }}
                                        {% endif %}
                                    </figure>

                                    <header>
                                        <h3 class="item-title h5">
                                            {{ partner.name }}
                                        </h3>
                                    </header>
                                </div>
                            </a>
                        </article>
                    </div>
                {% endfor %}
            </div>

            {% include 'Front/Paginator/pagination.html.twig' with {
                pages:pagination|length
            } only %}
        </div>

        {% include "Front/_part/sidebar.html.twig" %}
    </div>
{% endblock %}

{% block before_body %} 
    {% set pageHeaderPicture = ( content.picture ? asset(content.getWebPath()) : null ) %}
    {% set pageHeaderTitle = content.menu.parent.title %}
    {% set pageHeaderIntroduction = content.introduction|replace_custom_keys|raw %}
    {% include "Front/_part/page-header.html.twig" %}
    {{ render(controller('AppBundle:Render:module', { position:'before_body' })) }}
{% endblock %}

{% block after_body %} 
    {{ render(controller('AppBundle:Render:module', { position:'after_body' })) }}
{% endblock %}