templates/frontend/api/cars_list.html.twig line 1

  1. {% for car in cars %}
  2.     {% set other_meta = car.metaDecoded('other_meta') %}
  3.     {% set price_asterisk = other_meta.price_note is defined and not other_meta.price_note is empty %}
  4.     <a class="car-item" href="{{ app_url('car', { 'id': car.id }) }}">
  5.         <div class="car-item-background">
  6.             <div class="thumbnails-slider" data-splide="{{
  7.                 {
  8.                     'type': 'loop',
  9.                     'pagination': false,
  10.                     'arrows': false,
  11.                     'drag': false,
  12.                     'autoplay': 'pause',
  13.                     'interval': 2000,
  14.                 }|json_encode|escape('html') }}" data-splide-navContainer="{1}>.thumbnails-nav">
  15.         {% if car.thumbnails is not empty %}
  16.             {% for image in car.thumbnails %}
  17.                 <div class="thumbnails-slide">
  18.                     {{ app_image_html(image.idFile) }}
  19.                 </div>
  20.             {% endfor %}
  21.         {% else %}
  22.             <div class="thumbnails-slide">
  23.                 {{ app_static_image_html('img/placeholder/car.jpg') }}
  24.             </div>
  25.         {% endif %}
  26.             </div>
  27.             <div class="thumbnails-nav">
  28.             {% if car.thumbnails is not empty %}
  29.                 {% for image in car.thumbnails %}
  30.                     <button type="button" class="thumbnails-nav-item">{{ '%02d'|format(loop.index) }}</button>
  31.                 {% endfor %}
  32.             {% else %}
  33.                 <button type="button" class="thumbnails-nav-item">{{ '%02d'|format(1) }}</button>
  34.             {% endif %}
  35.             </div>
  36.         </div>
  37.         <div class="car-item-content">
  38.             <div class="car-item-top">
  39.                 <h3 class="car-item-title">{{ car.title }}</h3>
  40.             </div>
  41.             <div class="car-item-bottom">
  42.                 {% set price_with_tax = app_car_property(car, 'price-tax', true) %}
  43.                 {% set price_no_tax = app_car_property(car, 'price', true) %}
  44.                 <span class="car-item-info car-item-price">{{ app_car_property_value(price_no_tax, 'price', true) }}{{ price_asterisk ? '*' : '' }}</span>
  45.                 <span class="car-item-info car-item-price price-with-tax">{{ app_car_property_value(price_with_tax, 'price-tax', true) }}{{ price_asterisk ? '*' : '' }}</span>
  46.             </div>
  47.             <div class="car-item-footer">
  48.                 <span class="car-item-info car-item-stock">{{ app_car_property(car, 'availability', true) ? 'Skladem' : 'Není skladem' }}</span>
  49.                 {% set driven = app_car_property(car, 'driven', true) %}
  50.                 {% if driven %}
  51.                 <span class="car-item-info car-item-mileage">{{ app_car_property_value(driven, 'driven', true) }} najeto</span>
  52.                 {% endif %}
  53.             </div>
  54.         </div>
  55.     </a>
  56. {% else %}
  57.     <div>Nebyla nalezena žádná vozidla</div>
  58. {% endfor %}