{% extends '@SyliusShop/layout.html.twig' %}
{% import '@SyliusShop/Macro/pagination.html.twig' as pagination %}

{% block stylesheets %}
    {{ parent() }}
    {{ encore_entry_link_tags('shop', null, 'dedi') }}
{% endblock %}

{% block flash %}
{% endblock %}

{% block content %}
    <div class="listing-container mbiz-sylius-search-grid">
        {% include '@SyliusShop/Product/Index/_header.html.twig' %}

        <section class="listing-search-container">
            <div class="container">
                <div class="row">
                    <div class="col-md-3">
                        <p class="listing-search-title">{{ 'monsieurbiz_searchplugin.filters.filter_results' | trans }}</p>
                    </div>
                    <div class="col-md-9">
                        <div class="row listing-search-wrapper">
                            <div class="col-12 col-md-12 col-lg">
                                <span class="listing-nb-shown"><strong>{{ resultSet.totalHits }}</strong> {{ 'app.ui.product.nb_displayed'|trans({'%count%': resultSet.totalHits}) }}</span>
                            </div>
                            <div class="col col-md">
                                {% include '@MonsieurBizSyliusSearchPlugin/Search/_sorting.html.twig' %}
                            </div>
                            <div class="col-md-auto">
                                {% include '@MonsieurBizSyliusSearchPlugin/Search/_pagination.html.twig' %}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <div class="container">
            <div class="row">
                <aside class="col-md-3">
                    {% include '@MonsieurBizSyliusSearchPlugin/Taxon/_sidebar.html.twig' %}
                </aside>
                <div class="col-md-9">
                    {% if resultSet.totalHits == 0 %}
                        <p class="text-center">
                            {{ 'monsieurbiz_searchplugin.search.result.no_result'|trans }}
                        </p>
                    {% else %}
                        <div class="row" id="products">
                            {% for result in resultSet.results %}
                                <div class="col-6 col-lg-4 d-flex">
                                    {% include '@MonsieurBizSyliusSearchPlugin/Taxon/_box.html.twig' with {'result': result} %}
                                </div>
                            {% endfor %}
                        </div>

                        {{ pagination.simple_shop(resultSet.pager, {'css_container_class': 'pagination justify-content-center'}) }}
                    {% endif %}
                </div>
            </div>
        </div>
    </div>
{% endblock %}
