templates/pages/boutique.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}Boutique{% endblock %}
  3. {% block description %}{% endblock %}
  4. {% block nbProduit %}{% if panier %}<p class="nb-produit">{{panier.nbProduit}}</p>{% endif %}{% endblock %}
  5. {% block nbProduit2 %}{% if panier %}<p class="nb-produit nb-produit-second">{{panier.nbProduit}}</p>{% endif %}{% endblock %}
  6. {% block nbProduit3 %}{% if panier %}<p class="nb-produit nb-produit-third">{{panier.nbProduit}}</p>{% endif %}{% endblock %}
  7. {% block nbProduit4 %}{% if panier %}<p class="nb-produit nb-produit-fourth">{{panier.nbProduit}}</p>{% endif %}{% endblock %}
  8. {% block body %}
  9.     <div id="{{ page.id }}" class="bandeau-page">
  10.         <h1>{{ page.titre }}</h1>
  11.     </div>
  12.     <div class="presentation">
  13.         <div class="container">
  14.             <div class="row top-page top-page-boutique">
  15.             {% if drive is defined and drive is not null and drive.active == false %}
  16.                 <div class="text-center">
  17.                     <p class="m-3">{{drive.content}}</p>
  18.                 </div>
  19.             {% elseif connected is empty %}
  20.                 <div class="text-center border rounded">
  21.                     <p class="m-3">Connectez-vous pour enregistrer votre panier</p>
  22.                     <div class="d-flex justify-content-center flex-column flex-md-row">
  23.                         <a href="/login" class="btn btn-primary m-3 button-responsive">Se connecter</a>
  24.                         <a href="/register" class="btn btn-primary m-3 button-responsive">S'inscrire</a>
  25.                     </div>
  26.                 </div>
  27.             </div>
  28.             {% endif %}
  29.             <section class="content-page d-flex boutique mt-0 align-items-md-start">
  30.                 <div class="filter">
  31.                     {% include 'pages/_filter.html.twig' with {form: form, fromageDisplay: fromageDisplay, cremerieDisplay: cremerieDisplay,
  32.                      cidreDisplay: cidreDisplay, plateauDisplay: plateauDisplay, nbPersonnesDisplay: nbPersonnesDisplay} only %}
  33.                 </div>
  34.                 <div class="d-flex flex-wrap justify-content-center w-100">
  35.                     {% if produits %}
  36.                         {% for produit in produits %}
  37.                             {% include 'pages/card_product.html.twig' with {product: produit, drive: drive, connected: connected} only %}
  38.                         {% endfor %}
  39.                     {% else %}
  40.                         <p>Pas de résultat trouvé, veuillez modifier votre recherche.</p>
  41.                     {% endif %}
  42.                 </div>
  43.             </section>
  44.             {% if nbPages > 1 %}
  45.                 {% set nearbyPagesLimit = 4 %}
  46.                 {% set categories = [] %}
  47.                 {% for categorie in app.request.get('categories') %}
  48.                     {% set categories = categories | merge([categorie]) %}
  49.                 {% endfor %}
  50.                 {% set origines = [] %}
  51.                 {% for origine in app.request.get('origines') %}
  52.                     {% set origines = origines | merge([origine]) %}
  53.                 {% endfor %}
  54.                 {% set types = [] %}
  55.                 {% for type in app.request.get('types') %}
  56.                     {% set types = types | merge([type]) %}
  57.                 {% endfor %}
  58.                 {% set laits = [] %}
  59.                 {% for lait in app.request.get('laits') %}
  60.                     {% set laits = laits | merge([lait]) %}
  61.                 {% endfor %}
  62.                 {% set laitsTraitement = [] %}
  63.                 {% for laitTraitement in app.request.get('laitsTraitement') %}
  64.                     {% set laitsTraitement = laitsTraitement | merge([laitTraitement]) %}
  65.                 {% endfor %}
  66.                 <div class="d-flex justify-content-center">
  67.                     <ul class="pagination">
  68.                     {% set currentPage = currentPage + 1 %}
  69.                         {% if currentPage != 1 %}
  70.                         <li class="m-3">
  71.                             <a class="btn btn-primary w-100" href="{{ path('boutique', { 'page': 1, categories, origines, types, laits, laitsTraitement} ) }}">Première page</a>
  72.                         </li>
  73.                         {% endif %}
  74.                         {% for i in 1..nbPages %}
  75.                             {% if 0 == (currentPage - nearbyPagesLimit) - loop.index %}
  76.                                 <li class="m-3 disabled"><button class="input-active btn btn-primary w-100">...</button></li>
  77.                             {% elseif 0 == (currentPage + nearbyPagesLimit) - loop.index %}
  78.                                 <li class="m-3 disabled"><button class="input-active btn btn-primary w-100">...</button></li>
  79.                             {% elseif 0 < (currentPage - nearbyPagesLimit) - loop.index %}
  80.                             {% elseif 0 > (currentPage + nearbyPagesLimit) - loop.index %}
  81.                             {% else %}
  82.                                 <li {% if currentPage == loop.index  %} class="m-3 active"{% else %} class="m-3"{% endif %}>
  83.                                     <a class="input-active btn btn-primary w-100" href="{{ path('boutique', { 'page': loop.index, categories, origines, types, laits, laitsTraitement}) }}">{{ loop.index }}</a>
  84.                                 </li>
  85.                             {% endif %}
  86.                         {% endfor %}
  87.                         {% if currentPage != nbPages %}
  88.                         <li class="m-3">
  89.                             <a class="btn btn-primary w-100" href="{{ path('boutique', { 'page': nbPages, categories, origines, types, laits, laitsTraitement}) }}">Dernière page</a>
  90.                         </li>
  91.                         {% endif %}
  92.                     </ul>
  93.                 </div>
  94.             {% endif %}
  95.         </div>
  96.     </div>
  97.     <div id="top-shop" class="top-shop d-none">
  98.         <i class="fas fa-arrow-up"></i>
  99.     </div>
  100. {% endblock %}