{% apply spaceless %}
{% set locale = userLocale() %}
{% for key, collection in collections %}
<div class="swiper-slide wrap-preview" data-id="{{ collection.id }}">
<div class="preview">
{% set i_id = 0 %}
{#{% for interior in collection.interiors if interior.isMain == 1 %}#}
{% for interior in collection.interiors %}
{% set i_id = interior.id %}
{% endfor %}
{% set awardClass = '' %}
{% if collection.exhibition | length > 0 %}
{% set awardClass = ' award-bottom' %}
{% endif %}
{% if collection.awards and collection.awards | length > 0 %}
<span class="carousel-awards left{{ awardClass }}">
{% if is_mobile() %}
<img class="js-tooltip-with-click-trigger"
loading="lazy"
src="{{ asset('img/award.svg') }}"
data-title="{% for award in collection.awards %}{{ award.title }} <br />{% endfor %}"
data-tooltip-type="help-tooltip"
alt="{% for award in collection.awards %}{{ award.title }}, {% endfor %}"
/>
{% else %}
<img class="help-tooltip-right"
loading="lazy"
src="{{ asset('img/award.svg') }}"
title="{% for award in collection.awards %}{{ award.title }} <br />{% endfor %}"
alt="{% for award in collection.awards %}{{ award.title }}, {% endfor %}"
/>
{% endif %}
</span>
{% endif %}
<a href="{{ path('app_collection', {'factoryUrl': collection.factory.url | lower, 'collectionUrl': collection.url | lower }) }}"
target="_blank"
class="js-collection-page-link"
>
{% set path = pathGenerate('m-main', collection) %}
<img
{% if key > 3 or is_mobile() and key > 1 %}loading="lazy"{% endif %}
src="{{ asset(path) }}"
alt="{{ 'footer_tile' | trans }} {{ collection.factory.name | raw }} {{ collection.name | raw }}"
data-alt="{% if collection.settings is defined and collection.settings | length > 0 and collection.settings[locale] is defined %}{{ collection.settings[locale]| join(', ') | striptags }}{% endif %}"
/>
<div class="up-bg"></div>
<div class="scripts">
{% if collection.alternateName != null %}
{% set name = collection.alternateName %}
{% else %}
{% set name = collection.name %}
{% endif %}
<div class="name"{# title="{{ name }}" #}>
{{ name | prime() }}
</div>
{% include '@Web/Common/idea-add-block.html.twig' with { 'id': i_id, 'favourites': favourites, 'hideClass' : ' ', 'ideasCount': collection.rating, 'collectionId': collection.id, 'minArticlePrice': collection.priceSort } %}
</div>
</a>
{% if withDate == 1 %}
{# Решено показывать дату только у сегодняшних и вчерашних коллекций #}
{% if collection.publishDate | date('d.m.y') | data_last != '' %}
<div class="date"{# title="{{ 'help_carousel_new_date' | trans }}" #}>
{# {% if collection.publishDate | date('d.m.y') | data_last != '' %}
{{ collection.publishDate | date('d.m.y') | data_last | trans }}
{% else %}
{{ collection.publishDate | date('d.m.y') }}
{% endif %} #}
{{ collection.publishDate | date('d.m.y') | data_last | trans }}
</div>
{% endif %}
{% elseif withDate == 2 %}
{% if is_mobile() %}
<div class="date top-collection-id-{{ collection.id }} js-tooltip-with-click-trigger"
{% if type == 'top-week' %}data-title="{{ 'top20week' | trans }}"{% endif %}
{% if type == 'top-month' %}data-title="{{ 'top20help' | trans }}"{% endif %}
data-tooltip-type="help-tooltip"
>
{# Согласно дизайну, когда будут тысячи, нужно писать "K", например, не "2700", а "2.7K" #}
<span>+{{ te.valK(collection['ratingMonth']) }}</span>
{# Стрелка вверх - класс "arrow-up", стрелка вниз - класс "arrow-down" #}
<div class="arrow-{{ collection['arrow'] }}"></div>
</div>
{% else %}
<div class="date top-collection-id-{{ collection.id }} help-tooltip-right"
{% if type == 'top-week' %}title="{{ 'top20week' | trans }}"{% endif %}
{% if type == 'top-month' %}title="{{ 'top20help' | trans }}"{% endif %}
>
{# Согласно дизайну, когда будут тысячи, нужно писать "K", например, не "2700", а "2.7K" #}
<span>+{{ te.valK(collection['ratingMonth']) }}</span>
{# Стрелка вверх - класс "arrow-up", стрелка вниз - класс "arrow-down" #}
<div class="arrow-{{ collection['arrow'] }}"></div>
</div>
{% endif %}
{% else %}
<div class="change-rating"></div>
{% endif %}
{# вывод года релиза коллеции ярлычком, если это текущий год #}
{% if collection.releaseYear == ('now' | date('Y')) %}
<div class="exhibition-block">
<span class="exhibition" title="">{{ 'collection.releaseYear'|trans({'%d%': collection.releaseYear }) }}</span>
</div>
{% endif %}
{% if collection.exhibition | length > 0 %}
<div class="exhibition-block">
{% for exh in collection.exhibition %}
{% if is_mobile() %}
<span class="exhibition js-tooltip-with-click-trigger"
data-title="{{ exh.tooltip | raw }}"
data-tooltip-type="help-tooltip">{{ exh.name }}</span>
{% else %}
<span class="exhibition help-tooltip"
title="{{ exh.tooltip | raw }}">{{ exh.name }}</span>
{% endif %}
{% endfor %}
</div>
{% endif %}
{# выезжающий информер #}
<div class="collection-informer"
data-processed="0"
data-action="{{ path('app_collection_info', { 'collectionId': collection.id }) }}"
>
<div class="innerBoxInformer">
<div class="header-wrapper">
<div class="header">
<span class="textCollection">
{{ collection.name | prime() | preg_replace('#\\(.*\\)#isUu', '') | raw }}
</span>
{# #}
<span class="tolower">{{ 'collection_by' | trans }}</span>
{{ collection.factory.alternateName | prime() | raw }}
<span class="flag flag-{{ collection.factory.country.code | lower }}"></span>
</div>
{# <div class="vote">
<span class="rating help-tooltip-fast-hide"
title="{{ 'collection_ideas_short' | trans | raw | capitalize }}">
<i class="idea-not-added-to-project">
{% include '@Web/SVGIconsCode/lamp-idea-no-added.html.twig' %}
</i>
{{ collection.rating }}
</span> #}
{# <div class="r-text">{{ 'collection_ideas_short' | trans | raw }}</div> #}
{# </div> #}
</div>
<div class="loaded-options">
{# шаблон разметки этого списка находится в папке views/Collection/collection_info.html.twig #}
<div class="smallTimer"></div>
</div>
{# тут могут быть stars customer reviews ширина = 50% и .vote = 50%
<div class="collections-rating">
</div> #}
</div>
</div>
</div>
</div>
{% endfor %}
{% endapply %}