templates/accessory/index.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}{{ title }}{% endblock %}
  3. {% block meta %}
  4.     <meta name="description" content="{{ 'accessories.meta_description'|trans }}">
  5.     <meta name="keywords" content="{{ 'accessories.meta_keywords'|trans }}"> 
  6.     <meta property="og:url" content="path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params'))" />
  7. {% endblock %}
  8. {% block hero %}
  9.     <h1 class="text-center">{{ title }}</h1>
  10.     <p class="text-center color-primary">{{ 'accessories.poster_note'|trans }}</p>
  11. {% endblock %}
  12. {% block body %}
  13.     <section class="accessories_list">
  14.         <div class="">
  15.             <div class="filter__item">
  16.                 <div class="row">
  17.                     <div class="col-lg-2 col-md-3 col-sm-3 col-6">
  18.                         <div>
  19.                             <select class="filter__sort form-select">
  20.                                 <option value="{{ path('dj_accessories') }}">{{ 'accessories.sort_by'|trans }}</option>
  21.                                 <option {% if sort == "price-asc" %}selected="selected"{% endif %} value="{{ path(app.request.attributes.get('_route'), app.request.query.all) }}{% if app.request.query.all %}&{% else %}?{% endif %}page={{ page }}&sort=price&direction=asc">{{ 'accessories.price_asc'|trans }}</option>
  22.                                 <option {% if sort == "price-desc" %}selected="selected"{% endif %} value="{{ path(app.request.attributes.get('_route'), app.request.query.all) }}{% if app.request.query.all %}&{% else %}?{% endif %}page={{ page }}&sort=price&direction=desc">{{ 'accessories.price_desc'|trans }}</option>
  23.                             </select>
  24.                         </div>
  25.                     </div>
  26.                     <div class="col-lg-10 col-md-6 col-sm-6 col-6 d-flex align-items-center">
  27.                         <div class="filter__found text-start">
  28.                             <h4>
  29.                                 <span>{{ accessories.getTotalItemCount }}</span>
  30.                                 accessories
  31.                             </h4>
  32.                         </div>
  33.                     </div>
  34.                 </div>
  35.             </div>
  36.             <div class="row">
  37.                 {% for accessory in accessories %}
  38.                     <div class="col-lg-3 col-md-6 col-sm-6 mt-4">
  39.                         <div class="product__item d-flex flex-column h-100 bg-white rounded p-2 {% if accessory.quantity > 0 %}box-green{% else %}box-red{% endif %}">
  40.                             <div class="product__item__pic text-center">
  41.                                 {% if accessory.img != null %}
  42.                                     <a href="{{ path('dj_accessory', {'slug': accessory.slug}) }}">
  43.                                         <img src="{{ asset('uploads/accessories/' ~ accessory.slug ~ '/' ~ accessory.img) }}" class="card-img-top" alt="{{ accessory.designation }}">
  44.                                     </a>
  45.                                 {% else %}
  46.                                     <a href="{{ path('dj_accessory', {'slug': accessory.slug}) }}">
  47.                                         <img src="{{ asset('uploads/accessories/default_accessory.png') }}" class="card-img-top" alt="{{ accessory.designation }}">
  48.                                     </a>
  49.                                 {% endif %}
  50.                                 <ul class="product__item__pic__hover">
  51.                                     {# <li>
  52.                                         <a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https://www.mazykkaaccessories Dj/vinyle/{{ accessory.slug }}/&src=sdkpreparse" class="fb-xfbml-parse-ignore">
  53.                                             <i class="fa fa-facebook"></i>
  54.                                         </a>
  55.                                     </li> #}
  56.                                     {# <li>
  57.                                         <a href="{{ path('cart_add', {'id': accessory.id}) }}">
  58.                                             <i class="fa fa-shopping-cart"></i>
  59.                                         </a>
  60.                                     </li> #}
  61.                                 </ul>
  62.                             </div>
  63.                             <div class="product__item__text">
  64.                                 <h6>
  65.                                     <a href="{{ path('dj_accessory', {'slug': accessory.slug}) }}">{{ accessory.designation }}</a>
  66.                                 </h6>
  67.                                 {% if accessory.promo and accessory.promo > 0 %}
  68.                                     <h5> <del class="fw-normal fs-6 me-2">{{ accessory.price|number_format(2) }} € <span class="vat">TTC</span></del>  <span class="success">{{ accessory.promo|number_format(2) }} €</span></h5>
  69.                                 {% else %}
  70.                                     <h5>{{ accessory.price|number_format(2) }} € <span class="vat">TTC</span></h5>
  71.                                 {% endif %}
  72.                             </div>
  73.                             
  74.                             <div class="mt-auto text-center">
  75.                                 {% if accessory.quantity > 0 %}
  76.                                     {% if app.user %}
  77.                                         <a href="{{ path('cart_add', {'id': accessory.id}) }}" class="btn btn-primary mt-2 w-100">
  78.                                             <i class="fa fa-shopping-cart" aria-hidden="true"></i>
  79.                                         </a>
  80.                                     {% else %}
  81.                                         <button type="button" class="btn btn-primary mt-2 w-100" data-bs-toggle="modal" data-bs-target="#needConnexionModal">
  82.                                             <i class="fa fa-shopping-cart" aria-hidden="true"></i>
  83.                                         </button>
  84.                                     {% endif %}
  85.                                 {% else %}
  86.                                     <h3 class="red">Hors stock</h3>
  87.                                 {% endif %}
  88.                                 
  89.                             </div>
  90.                         </div>
  91.                     </div>
  92.                 {% endfor %}
  93.             </div>
  94.             <div class="pagination my-3 d-flex justify-content-center">
  95.                 {{ knp_pagination_render(accessories, '@KnpPaginator/Pagination/twitter_bootstrap_v4_pagination.html.twig') }}
  96.             </div>
  97.         
  98.         </div>
  99.     </section>
  100. {% endblock %}
  101. {% block javascript %}{% endblock %}