src/WebBundle/Resources/views/Home/carousel-items.html.twig line 1

Open in your IDE?
  1. {% apply spaceless %}
  2.     {% set locale = userLocale() %}
  3.     {% for key, collection in collections %}
  4.         <div class="swiper-slide wrap-preview" data-id="{{ collection.id }}">
  5.             <div class="preview">
  6.                 {% set i_id = 0 %}
  7.                 {#{% for interior in collection.interiors if interior.isMain == 1 %}#}
  8.                 {% for interior in collection.interiors %}
  9.                     {% set i_id = interior.id %}
  10.                 {% endfor %}
  11.                 {% set awardClass = '' %}
  12.                 {% if collection.exhibition | length > 0 %}
  13.                     {% set awardClass = ' award-bottom' %}
  14.                 {% endif %}
  15.                 {% if collection.awards and collection.awards | length > 0 %}
  16.                     <span class="carousel-awards left{{ awardClass }}">
  17.                     {% if is_mobile() %}
  18.                         <img class="js-tooltip-with-click-trigger"
  19.                             loading="lazy"
  20.                              src="{{ asset('img/award.svg') }}"
  21.                              data-title="{% for award in collection.awards %}{{ award.title }} <br />{% endfor %}"
  22.                              data-tooltip-type="help-tooltip"
  23.                              alt="{% for award in collection.awards %}{{ award.title }}, {% endfor %}"
  24.                         />
  25.                     {% else %}
  26.                         <img class="help-tooltip-right"
  27.                             loading="lazy"
  28.                              src="{{ asset('img/award.svg') }}"
  29.                              title="{% for award in collection.awards %}{{ award.title }} <br />{% endfor %}"
  30.                              alt="{% for award in collection.awards %}{{ award.title }}, {% endfor %}"
  31.                         />
  32.                     {% endif %}
  33.                 </span>
  34.                 {% endif %}
  35.                 <a href="{{ path('app_collection', {'factoryUrl': collection.factory.url | lower, 'collectionUrl': collection.url | lower }) }}"
  36.                    target="_blank"
  37.                    class="js-collection-page-link"
  38.                 >
  39.                     {% set path = pathGenerate('m-main', collection) %}
  40.                     <img
  41.                             {% if key > 3 or is_mobile() and key > 1 %}loading="lazy"{% endif %}
  42.                             src="{{ asset(path) }}"
  43.                             alt="{{ 'footer_tile' | trans }} {{ collection.factory.name | raw }} {{ collection.name | raw }}"
  44.                             data-alt="{% if collection.settings is defined and collection.settings | length > 0 and collection.settings[locale] is defined %}{{ collection.settings[locale]| join(', ') | striptags }}{% endif %}"
  45.                     />
  46.                     <div class="up-bg"></div>
  47.                     <div class="scripts">
  48.                         {% if collection.alternateName != null %}
  49.                             {% set name = collection.alternateName %}
  50.                         {% else %}
  51.                             {% set name = collection.name %}
  52.                         {% endif %}
  53.                         <div class="name"{# title="{{ name }}" #}>
  54.                             {{ name | prime() }}
  55.                         </div>
  56.                         {% include '@Web/Common/idea-add-block.html.twig' with { 'id': i_id, 'favourites': favourites, 'hideClass' : ' ', 'ideasCount': collection.rating, 'collectionId': collection.id, 'minArticlePrice': collection.priceSort } %}
  57.                     </div>
  58.                 </a>
  59.                 {% if withDate == 1 %}
  60.                     {# Решено показывать дату только у сегодняшних и вчерашних коллекций #}
  61.                     {% if collection.publishDate | date('d.m.y') | data_last != '' %}
  62.                         <div class="date"{# title="{{ 'help_carousel_new_date' | trans }}" #}>
  63.                             {# {% if collection.publishDate | date('d.m.y') | data_last != '' %}
  64.                             {{ collection.publishDate | date('d.m.y') | data_last | trans }}
  65.                         {% else %}
  66.                             {{ collection.publishDate | date('d.m.y') }}
  67.                         {% endif %} #}
  68.                             {{ collection.publishDate | date('d.m.y') | data_last | trans }}
  69.                         </div>
  70.                     {% endif %}
  71.                 {% elseif withDate == 2 %}
  72.                     {% if is_mobile() %}
  73.                         <div class="date top-collection-id-{{ collection.id }} js-tooltip-with-click-trigger"
  74.                              {% if type == 'top-week' %}data-title="{{ 'top20week' | trans }}"{% endif %}
  75.                                 {% if type == 'top-month' %}data-title="{{ 'top20help' | trans }}"{% endif %}
  76.                              data-tooltip-type="help-tooltip"
  77.                         >
  78.                             {# Согласно дизайну, когда будут тысячи, нужно писать "K", например, не "2700", а "2.7K" #}
  79.                             <span>+{{ te.valK(collection['ratingMonth']) }}</span>
  80.                             {# Стрелка вверх - класс "arrow-up", стрелка вниз - класс "arrow-down" #}
  81.                             <div class="arrow-{{ collection['arrow'] }}"></div>
  82.                         </div>
  83.                     {% else %}
  84.                         <div class="date top-collection-id-{{ collection.id }} help-tooltip-right"
  85.                              {% if type == 'top-week' %}title="{{ 'top20week' | trans }}"{% endif %}
  86.                                 {% if type == 'top-month' %}title="{{ 'top20help' | trans }}"{% endif %}
  87.                         >
  88.                             {# Согласно дизайну, когда будут тысячи, нужно писать "K", например, не "2700", а "2.7K" #}
  89.                             <span>+{{ te.valK(collection['ratingMonth']) }}</span>
  90.                             {# Стрелка вверх - класс "arrow-up", стрелка вниз - класс "arrow-down" #}
  91.                             <div class="arrow-{{ collection['arrow'] }}"></div>
  92.                         </div>
  93.                     {% endif %}
  94.                 {% else %}
  95.                     <div class="change-rating"></div>
  96.                 {% endif %}
  97.                 {# вывод года релиза коллеции ярлычком, если это текущий год #}
  98.                 {% if collection.releaseYear == ('now' | date('Y')) %}
  99.                     <div class="exhibition-block">
  100.                         <span class="exhibition" title="">{{ 'collection.releaseYear'|trans({'%d%': collection.releaseYear }) }}</span>
  101.                     </div>
  102.                 {% endif %}
  103.                 {% if collection.exhibition | length > 0 %}
  104.                     <div class="exhibition-block">
  105.                         {% for exh in collection.exhibition %}
  106.                             {% if is_mobile() %}
  107.                                 <span class="exhibition js-tooltip-with-click-trigger"
  108.                                       data-title="{{ exh.tooltip | raw }}"
  109.                                       data-tooltip-type="help-tooltip">{{ exh.name }}</span>
  110.                             {% else %}
  111.                                 <span class="exhibition help-tooltip"
  112.                                       title="{{ exh.tooltip | raw }}">{{ exh.name }}</span>
  113.                             {% endif %}
  114.                         {% endfor %}
  115.                     </div>
  116.                 {% endif %}
  117.                 {# выезжающий информер #}
  118.                 <div class="collection-informer"
  119.                      data-processed="0"
  120.                      data-action="{{ path('app_collection_info', { 'collectionId': collection.id }) }}"
  121.                 >
  122.                     <div class="innerBoxInformer">
  123.                         <div class="header-wrapper">
  124.                             <div class="header">
  125.                             <span class="textCollection">
  126.                                 {{ collection.name | prime() | preg_replace('#\\(.*\\)#isUu', '') | raw }}
  127.                             </span>
  128.                                 {# &nbsp; #}
  129.                                 <span class="tolower">{{ 'collection_by' | trans }}</span>
  130.                                 {{ collection.factory.alternateName | prime() | raw }}
  131.                                 <span class="flag flag-{{ collection.factory.country.code | lower }}"></span>
  132.                             </div>
  133.                             {# <div class="vote">
  134.                             <span class="rating help-tooltip-fast-hide"
  135.                                   title="{{ 'collection_ideas_short' | trans | raw | capitalize }}">
  136.                                 <i class="idea-not-added-to-project">
  137.                                     {% include '@Web/SVGIconsCode/lamp-idea-no-added.html.twig' %}
  138.                                 </i>
  139.                                 {{ collection.rating }}
  140.                             </span> #}
  141.                             {# <div class="r-text">{{ 'collection_ideas_short' | trans | raw }}</div> #}
  142.                             {# </div>   #}
  143.                         </div>
  144.                         <div class="loaded-options">
  145.                             {# шаблон разметки этого списка находится в папке views/Collection/collection_info.html.twig #}
  146.                             <div class="smallTimer"></div>
  147.                         </div>
  148.                         {# тут могут быть stars customer reviews ширина = 50% и .vote = 50%
  149.                     <div class="collections-rating">
  150.                     </div> #}
  151.                     </div>
  152.                 </div>
  153.             </div>
  154.         </div>
  155.     {% endfor %}
  156. {% endapply %}