templates/front/article/list.html.twig line 1

Open in your IDE?
  1. {% extends 'base_front.html.twig' %}
  2. {% block meta %}
  3.     <title>Les produits disponibles pour votre mariage</title>
  4.     <meta name="description" content="Les produits disponibles. Actuellement, {{ countProducts }} produits disponibles.">
  5. {% endblock %}
  6. {% block body %}
  7.     <div class="page-header" style="
  8.     {% if categoryBackground is defined and categoryBackground is not null and categoryBackground.image is not null %}
  9.         background: url({{ asset(constant('App\\Services\\File::IMAGE_CATEGORY_DIR') ~ categoryBackground.image) }})
  10.     {% else %}
  11.         background: url({{ asset('images/vacance_article.jpg') }})
  12.     {% endif %}
  13.     no-repeat center;background-size: cover">
  14.         <div class="container">
  15.             <div class="row">
  16.                 <!-- page caption -->
  17.                 <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12 ">
  18.                     <div class="page-caption">
  19.                         <h1 class="page-title">Articles</h1>
  20.                     </div>
  21.                 </div>
  22.                 <!-- /.page caption -->
  23.             </div>
  24.         </div>
  25.         <!-- page caption -->
  26.         <div class="page-breadcrumb">
  27.             <div class="container">
  28.                 <div class="row">
  29.                     <nav aria-label="breadcrumb">
  30.                         <ol class="breadcrumb">
  31.                             <li class="breadcrumb-item"><a href="{{ path('front_home') }}" class="breadcrumb-link">Accueil</a></li>
  32.                             <li class="breadcrumb-item active text-white" aria-current="page">Recherche {% if app.session.get('categoryName') %}{{ app.session.get('categoryName') }}{% endif %} {% if app.session.get('departmentName') %}- {{ app.session.get('departmentName') }}{% endif %} {% if app.session.get('weddingdate') %}- {{ app.session.get('weddingdate') }}{% endif %}</li>
  33.                         </ol>
  34.                     </nav>
  35.                 </div>
  36.             </div>
  37.         </div>
  38.         <!-- page breadcrumb -->
  39.     </div>
  40.     <!-- /.page-header -->
  41.     <!-- vendor-section -->
  42.     <div class="content">
  43.         <div class="container">
  44.             <div class="row">
  45.                 <div class="col-xl-8 col-lg-8 col-md-7 col-sm-12 col-12">
  46.                     <div class="row">
  47.                         {% for product in products %}
  48.                             <div class="col-lg-6 col-sm-12 col-12">
  49.                                 <div class="container-block-Pcompanies mb-3">
  50.                                     <div class="container-imageP zoomimg">
  51.                                         {% if product.photos is not empty %}
  52.                                             <img src="{{ asset(constant('App\\Services\\File::IMAGE_PRODUCT_DIR') ~ product.photos.first.url) }}" alt="default image" class="img-fluid" style="height: 213px;object-fit: cover; border-radius: .5rem .5rem 0 0;">
  53.                                         {% else %}
  54.                                             <img src="{{ asset('images/vecteezy_vector-gear-logo-design-with-multi-colors-range_6172776.jpg') }}" alt="default image" class="img-fluid" style="height: 213px;object-fit: cover; border-radius: .5rem .5rem 0 0;">
  55.                                         {% endif %}
  56.                                     </div>
  57.                                     <div class="container-info-presta" style="padding-bottom: 80px;">
  58.                                         <h2 class="vendor-title">
  59.                                             <a href="{{ path('front_product_single', {'slug': product.subCategories[0].categories[0].slug, 'subCategorySlug': product.subCategories[0].subCategorySlug, 'product_id': product.id, 'productSlug': product.productSlug}) }}" class="title">{{ product.name }}</a>
  60.                                         </h2>
  61.                                         <p class="vendor-address">
  62.                                             {% for department in product.departments %}
  63.                                                 {{ department.name }}
  64.                                                 {% if not loop.last %},
  65.                                                 {% endif %}
  66.                                             {% else %}
  67.                                                 Toute la France
  68.                                             {% endfor %}
  69.                                         </p>
  70.                                         <p>
  71.                                             <i class="fas fa-money-bill-wave"></i>
  72.                                             Prix
  73.                                             <strong>{{ product.price|number_format(2, '.') }}</strong>
  74.                                             €</p>
  75.                                         <p>
  76.                                             <i class="fa fa-star rated"></i>
  77.                                             {% set notes = 0 %}
  78.                                             {% for avi in product.avis %}
  79.                                                 {% set notes = notes + avi.globalNote %}
  80.                                             {% endfor %}
  81.                                             {% set noteTotal = (notes > 0) ? notes / product.avis|length : 0 %}
  82.                                             {{ product.avis|length }} Avis</p>
  83.                                         <p>{{ product.quantity }}
  84.                                             Quantité restante</p>
  85.                                     </div>
  86.                                     <div class="wishlist-sign">
  87.                                         <a href="#" class="btn-wishlist">
  88.                                             <i class="fa fa-heart"></i>
  89.                                         </a>
  90.                                     </div>
  91.                                     <a href="{{ path('front_product_single', {'slug': product.subCategories[0].categories[0].slug, 'subCategorySlug': product.subCategories[0].subCategorySlug, 'product_id': product.id, 'productSlug': product.productSlug}) }}" class="title">
  92.                                         <button class="btnVoirP btn">Voir le produit</button>
  93.                                     </a>
  94.                                 </div>
  95.                             </div>
  96.                         {% else %}
  97.                             <div class="vendor-thumbnail list-view p-4">Aucun service correspondant</div>
  98.                         {% endfor %}
  99.                     </div>
  100.                     {# {% for product in products %}
  101.                         <div class="vendor-thumbnail list-view">
  102.                         <!-- Vendor thumbnail -->
  103.                         <div class="row">
  104.                             <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 border-right pr-0 zoom-img">
  105.                                 <div class="vendor-img" style="background:url({% if product.photos is not empty %}{{ asset(constant('App\\Services\\File::IMAGE_PRODUCT_DIR') ~ product.photos.first.url) }}{% else %}{{ asset('images/illustration-default.jpg') }}{% endif %})no-repeat center;background-size:cover;height:100%">
  106.                                     <!-- Vendor img -->
  107.                                     <a href="{{ path('front_product_single', {'slug': product.subCategories[0].categories[0].slug, 'subCategorySlug': product.subCategories[0].subCategorySlug, 'product_id': product.id, 'productSlug': product.productSlug}) }}">
  108.                                         <div style="height:100%;width:100%">
  109.                                         </div>
  110.                                     </a>
  111.                                     <div class="wishlist-sign">
  112.                                         {% if app.user and app.user.roles == ['ROLE_USER'] %}
  113.                                             {% set isWish = filter_service.getIfIsWish(app.user, product) %}
  114.                                             {% if isWish %}
  115.                                                 <a href="#" class="btn-wishlist" style="background-color:#ff4d4d;"><i class="fa fa-heart" style="color:#fff"></i></a>
  116.                                             {% else %}
  117.                                                 <a href="#" class="btn-wishlist"><i class="fa fa-heart"></i></a>
  118.                                             {% endif %}
  119.                                         {% endif %}
  120.                                     </div>
  121.                                 </div>
  122.                             </div>
  123.                             <!-- /.Vendor img -->
  124.                             <div class="col-xl-8 col-lg-8 col-md-12 col-sm-12 col-12 pl-0">
  125.                                 <div class="vendor-content">
  126.                                     <!-- Vendor Content -->
  127.                                     <h2 class="vendor-title"><a href="{{ path('front_product_single', {'slug': product.subCategories[0].categories[0].slug, 'subCategorySlug': product.subCategories[0].subCategorySlug, 'product_id': product.id, 'productSlug': product.productSlug}) }}" class="title">{{ product.name }}</a></h2>
  128.                                     <p class="vendor-address">
  129.                                         {% for department in product.departments %}
  130.                                             {{ department.name }}{% if not loop.last %},{% endif %}
  131.                                         {% else %}
  132.                                             Toute la France
  133.                                         {% endfor %}
  134.                                     </p>
  135.                                     <!-- /.Vendor meta -->
  136.                                 </div>
  137.                                 <div class="vendor-meta m-0">
  138.                                     <div class="vendor-meta-item vendor-meta-item-bordered">
  139.                                         <span class="vendor-price">
  140.                                         {{ product.price|number_format(2, '.') }}€
  141.                                         </span>
  142.                                         <span class="vendor-text">Prix</span></div>
  143.                                     <div class="vendor-meta-item vendor-meta-item-bordered">
  144.                                         <span class="vendor-guest">
  145.                                               {{ product.quantity }}
  146.                                          </span>
  147.                                         <span class="vendor-text">Quantité restante</span>
  148.                                     </div>
  149.                                     {% set notes = 0 %}
  150.                                     {% for avi in product.avis %}
  151.                                         {% set notes = notes + avi.globalNote %}
  152.                                     {% endfor %}
  153.                                     {% set noteTotal = (notes > 0) ? notes / product.avis|length : 0 %}
  154.                                     <div class="vendor-meta-item vendor-meta-item-bordered">
  155.                                         <span class="rating-star">
  156.                                             {% for i in 1..5 %}
  157.                                                 {% if i < noteTotal %}
  158.                                                     <i class="fa fa-star rated"></i>
  159.                                                 {% else %}
  160.                                                     <i class="fa fa-star rate-mute"></i>
  161.                                                 {% endif %}
  162.                                             {% endfor %}
  163.                                     </span>
  164.                                         <span class="rating-count vendor-text">({{ product.avis|length }})</span></div>
  165.                                 </div>
  166.                                 <!-- /.Vendor Content -->
  167.                             </div>
  168.                         </div>
  169.                     </div>
  170.                     {% else %}
  171.                         <div class="vendor-thumbnail list-view p-4">Aucun article correspondant</div>
  172.                     {% endfor %} #}
  173.                     <div class="pagination">
  174.                         <nav aria-label="Page navigation example">
  175.                             {{ knp_pagination_render(products) }}
  176.                         </nav>
  177.                     </div>
  178.                     <!-- /.paginations -->
  179.                 </div>
  180.                 <!-- sidebar-section -->
  181.                 {{ include('front/inc/filter_sidebar.html.twig') }}
  182.                 <!-- /.sidebar-section -->
  183.             </div>
  184.         </div>
  185.     </div>
  186. {% endblock %}
  187. {% block javascript %}
  188.     <script src="{{ asset('js/getCommune.js') }}"></script>
  189. {% endblock %}