{% extends "front-office/_base.html.twig" %}
{% block script %}
<script defer src="{{ asset('assets/js/sewing-list.js') }}"></script>
{% endblock %}
{% block content %}
<div class="sewing-list meli-section-90">
{# Breadcrumb #}
<div class="breadcrumb">
<a class="txt-century txt-orange txt-size12 txt-regular txt-underline" href="{{ path('home') }}">Accueil</a>
<span class="txt-century txt-orange txt-size12 txt-regular"> > </span>
<span class="txt-century txt-orange txt-size12 txt-regular">La boutique</span>
</div>
{% if app.request.get('page') is null
or app.request.get('page') == 1 %}
<section class="video-container">
<p class="title txt-dancing txt-orange txt-bold txt-size40 txt-center">Comment la boutique fonctionne-t-elle ? </p>
<div class="video-box meli-section-80"
>
<video controls width="100%" controlslist="nodownload">
<source src="{{ asset('assets/video/video-achat.mp4') }}" type="video/mp4">
</video></div>
</section>
{% endif %}
<section class="sewings-container">
<h1 class="title txt-dancing txt-green txt-bold txt-size40 txt-center">La boutique</h1>
<div class="filters-box meli-section-45">
<div class="meli-between-center">
{# Level #}
{% set afterUri = "" %}
{% if app.request.requestUri == app.request.pathInfo %}
{# There isn't parameters, so not "?" #}
{% set afterUri = "?" %}
{% else %}
{% set params = app.request.requestUri|split('?')[1]|split("&") %}
{% set afterUri = "?" %}
{% for p in params %}
{% if p|split("=")[0] != "page" and p|split("=")[0] != "level" %}
{% set afterUri = afterUri~p~"&" %}
{% endif %}
{% endfor %}
{% endif %}
<div class="level meli-width-30 js-sewing-list-btn"
data-target="js-sewing-list-level-down"
>
<span class="label txt-century txt-bold txt-size20 txt-green">Difficulté</span>
<span class="icon-down"></span>
<ul class="list-down bgc-green" id="js-sewing-list-level-down">
<li>
<a class="txt-century txt-regular txt-size15 txt-white"
href="{{ path('sewing_list') }}">Tous</a>
</li>
<li>
<a class="txt-century txt-regular txt-size15 txt-white"
href="{{ app.request.pathInfo~afterUri }}level=facile">Facile</a>
</li>
<li>
<a class="txt-century txt-regular txt-size15 txt-white"
href="{{ app.request.pathInfo~afterUri }}level=intermediaire">Intermédiaire</a>
</li>
<li>
<a class="txt-century txt-regular txt-size15 txt-white"
href="{{ app.request.pathInfo~afterUri }}level=difficile">Difficile</a>
</li>
</ul>
</div>
{% set afterUri = "" %}
{% if app.request.requestUri == app.request.pathInfo %}
{# There isn't parameters, so not "?" #}
{% set afterUri = "?" %}
{% else %}
{% set params = app.request.requestUri|split('?')[1]|split("&") %}
{% set afterUri = "?" %}
{% for p in params %}
{% if p|split("=")[0] != "page" and p|split("=")[0] != "category" %}
{% set afterUri = afterUri~p~"&" %}
{% endif %}
{% endfor %}
{% endif %}
{# Category #}
<div class="category meli-between-center meli-width-65">
{% for c in categories %}
<a href="{{ app.request.pathInfo~afterUri }}category={{ c.id }}">
<div class="item">
<p class=" txt-century txt-bold txt-size20 txt-red">{{ c.name }}</p>
</div>
</a>
{% endfor %}
</div>
{# Responsive Category #}
<div class="resp-category">
<div class="js-sewing-list-btn"
data-target="js-sewing-list-category-down">
<span class="label txt-century txt-bold txt-size20 txt-red">Catégorie</span>
<span class="icon-down"></span>
</div>
<ul class="list-down bgc-green" id="js-sewing-list-category-down">
{% for c in categories %}
<li>
<a class="txt-century txt-regular txt-size15 txt-white"
href="{{ app.request.pathInfo~afterUri }}category={{ c.id }}">{{ c.name }}</a>
</li>
{% endfor %}
</ul>
</div>
</div>
</div>
<div class="line-blue"></div>
<div class="sewings-box">
{% set withoutFilter = true %}
{% include "front-office/partials/sewing/_list.html.twig" %}
</div>
</section>
{% set afterUri = "" %}
{% if app.request.requestUri == app.request.pathInfo %}
{# There isn't parameters, so not "?" #}
{% set afterUri = "?" %}
{% else %}
{% set params = app.request.requestUri|split('?')[1]|split("&") %}
{% set afterUri = "?" %}
{% for p in params %}
{% if p|split("=")[0] != "page" %}
{% set afterUri = afterUri~p~"&" %}
{% endif %}
{% endfor %}
{% endif %}
{# PAGNIATION #}
{% include "front-office/partials/sewing/_pagination.html.twig" %}
</div>
{% endblock %}