{% set route = app.request.get('_route') %}
{% set city = app.request.get('city') ?? null %}
{% set isDefaultCity = city == default_city() %}
{% set locale = app.request.locale ?? 'ru' %}
{% set specialClass = specialClass is defined ? '' ~ specialClass : '' %}
{% set isAccount = isAccount is defined ? isAccount : false %}
{# <div class="swiper" id="-swiper">
<div class="swiper-wrapper" id="-list">
<a class="swiper-slide" href=""> #}
{% macro _breadcrumbs_generate(items) %}
<div class="swiper breadcrumbs-swiper list-swiper" id="breadcrumbs-swiper" style="padding:0">
<ul class="breadcrumbs swiper-wrapper" itemscope itemtype="https://schema.org/BreadcrumbList" id="breadcrumbs-list">
{% for breadcrumb_item in items %}
<li class="breadcrumbs-item swiper-slide{% if loop.last %} last-crumb{% endif %}" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
{% if not loop.last %}
<a href="{{ breadcrumb_item.uri }}" itemprop="item"><span itemprop="name">{{ breadcrumb_item.label|trans({}, 'breadcrumbs') }}</span></a>
{% else %}
<span itemprop="name">{{ breadcrumb_item.label|trans({}, 'breadcrumbs') }}</span>
{% endif %}
<meta itemprop="position" content="{{ loop.index - 1 }}">
</li>
{% endfor %}
</ul>
{# <div class="swiper-scrollbar swiper-loading"></div> #}
<div class="swiper-button-list swiper-loading">
<div class="swiper-button swiper-button-prev"><span class="swiper-button-wrap swiper-button-prev-wrap"></span></div>
<div class="swiper-button swiper-button-next"><span class="swiper-button-wrap swiper-button-next-wrap"></span></div>
</div>
</div>
{% endmacro %}
{% set mapArray = {
'profile_list.list_by_city': 'Индивидуалки',
'profile_list.list_by_city._pagination': 'Индивидуалки',
'profile_list.massage':'Массажистки',
'profile_list.massage._pagination':'Массажистки',
'saloon_list.list_by_city': 'Интим салоны',
'saloon_list.list_by_city._pagination': 'Интим салоны',
'profile_list.list_approved': 'Проверенные анкеты',
'profile_list.list_approved._pagination': 'Проверенные анкеты',
'profile_list.list_new': 'Новые анкеты',
'profile_list.list_new._pagination': 'Новые анкеты',
'profile_list.list_price_high': 'Элитные',
'profile_list.list_price_high._pagination': 'Элитные',
'profile_list.list_price_low': 'Дешевые',
'profile_list.list_price_low._pagination': 'Дешевые',
'profile_list.list_with_video': 'Анкеты с видео',
'profile_list.list_with_video._pagination': 'Анкеты с видео',
'profile_list.list_with_selfie': 'Анкеты с селфи',
'profile_list.list_with_selfie._pagination': 'Анкеты с селфи',
'profile_list.list_with_comments': 'Анкеты с отзывами',
'profile_list.list_with_comments._pagination': 'Анкеты с отзывами',
'profile_list.list_by_gender': 'Жиголо',
'profile_list.list_by_gender._pagination': 'Жиголо',
'profile_search.page': 'Расширенный поиск',
'profile_search.page._pagination': 'Расширенный поиск'
} %}
{% if route == null %}
{% set route = 'profile_list.massage' %}
{% endif %}
{# ТОЛЬКО ДЛЯ ЛК #}
{% if isAccount %}
{{ _self._breadcrumbs_generate(items) }}
{# ВСЁ ЧТО НИЖЕ ОТНОСИТСЯ К ПАБЛИКУ #}
{% elseif (not isDefaultCity and 'profile_list.list_by_city' in route) %}
{% set items = [
{label: 'Главная', uri: path('homepage')}
] %}
{% if not isDefaultCity %}
{% set items = items|merge([{label: city.name|trans}]) %}
{% endif %}
{{ _self._breadcrumbs_generate(items) }}
{% elseif mapArray[route] is defined and not (isDefaultCity and 'profile_list.list_by_city' in route) %}
{% set items = [
{label: 'Главная', uri: path('homepage')}
] %}
{% if not isDefaultCity %}
{% set items = items|merge([{label: city.name|trans, uri: path('profile_list.list_by_city', {city: city.uriIdentity})}]) %}
{% endif %}
{% set items = items|merge([{label: mapArray[route]}]) %}
{{ _self._breadcrumbs_generate(items) }}
{% elseif 'profile_list.list_by_district' in route %}
{% set district = app.request.attributes.get('district') ?? null %}
{% set items = [
{label: 'Главная', uri: path('homepage')},
{label: 'Все районы', uri: path('district_list.page', {city: district.city.uriIdentity})},
{label: district ? district.name|trans : '', uri: null}
] %}
{{ _self._breadcrumbs_generate(items) }}
{% elseif 'district_list.page' in route %}
{% set district = app.request.attributes.get('district') ?? null %}
{% set items = [
{label: 'Главная', uri: path('homepage')},
{label: 'Все районы'}
] %}
{{ _self._breadcrumbs_generate(items) }}
{% elseif 'station_list.page' in route %}
{% set district = app.request.attributes.get('district') ?? null %}
{% set items = [
{label: 'Главная', uri: path('homepage')},
{label: 'Все станции'}
] %}
{{ _self._breadcrumbs_generate(items) }}
{% elseif 'profile_list.list_by_station' in route %}
{% set station = app.request.attributes.get('station') ?? null %}
{# {% set items = [
{label: 'Главная', uri: path('homepage')},
{label: station ? 'Метро ' ~ station.name|trans : '', uri: path('profile_list.list_by_station', {city: city.uriIdentity, station: station.uriIdentity})}
] %}
{% set page = current_listing_page() %}
{% if page and page.currentPage > 1 and page.totalCount > 0 %}
{% set items = items|merge([{label: 'Страница ' ~ page.currentPage ~ ' из ' ~ (page.totalCount / page.currentLimit)|round(0, 'ceil')}]) %}
{% endif %}
{#{label: 'Метро Москвы', uri: path('station_list.page')},#!}
<ul class="breadcrumbs" itemscope itemtype="https://schema.org/BreadcrumbList">
{% for breadcrumb_item in items %}
<li class="breadcrumbs-item{% if loop.last %} last-crumb{% endif %}" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
{% if not loop.last %}
<a href="{{ breadcrumb_item.uri }}" itemprop="item"><span itemprop="name">{{ breadcrumb_item.label|trans({}, 'breadcrumbs') }}</span></a>
{% else %}
<span itemprop="name">{{ breadcrumb_item.label|trans({}, 'breadcrumbs') }}</span>
{% endif %}
<meta itemprop="position" content="{{ loop.index - 1 }}">
</li>
{% endfor %}
</ul> #}
{% set items = [
{label: 'Главная', uri: path('homepage')},
{label: 'Все станции', uri: path('station_list.page', {'city': city.uriIdentity})},
{label: station ? 'Метро ' ~ station.name|trans : '', uri: path('profile_list.list_by_station', {city: city.uriIdentity, station: station.uriIdentity})}
] %}
{{ _self._breadcrumbs_generate(items) }}
{% elseif 'city_list.by_country' in route %}
{% set items = [
{label: 'Главная', uri: path('homepage')},
{label: 'По городам'}
] %}
{{ _self._breadcrumbs_generate(items) }}
{% elseif 'static_page.license' in route %}
{% set items = [
{label: 'Главная', uri: path('homepage')},
{label: 'Услувия использования'}
] %}
{{ _self._breadcrumbs_generate(items) }}
{# {% elseif 'profile_list.list_by_city' in route %}
{% set station = app.request.attributes.get('station') ?? null %}
{% set items = [
{label: 'Главная', uri: path('homepage')},
{label: 'Подмосквье', uri: path('city_list.by_country')},
{label: city.name|trans, uri: null}
] %}
{% for breadcrumb_item in items %}
{% if not loop.last %}
{% set items = items|merge([{label: breadcrumb_item.label|trans({}, 'breadcrumbs'), uri: breadcrumb_item.uri }]) %}
{% else %}
{% set items = items|merge([{label: breadcrumb_item.label|trans({}, 'breadcrumbs') }]) %}
{% endif %}
{% endfor %} #}
{% elseif item.children|length > 1 %}
{# Перегоняем в индексированный массив #}
{% set children = [] %}
{% for breadcrumb_item in item.children %}
{% set children = children|merge([breadcrumb_item]) %}
{% endfor %}
{% if route == 'profile_preview.page' %}
{#
На странице анкеты Москвы выводим крошки вида
Главная / ЗАО (то есть ссылка на округ) / Дорогомилово (то есть ссылка на район) / Кутузовская (то есть ссылка на метро) / индивидуалка Аня (Аня простым текстом, без ссылки)
(согласно https://redminez.net/issues/27876),
а на остальных Главная / Город / индивидуалка Имя
#}
{% set profile = options.profile ?? null %}
{% set items = [
{label: 'Главная', uri: path('homepage')}
] %}
{% set children = items|merge([children[1]]) %}
{# {% set main = [
{label: 'Главная', uri: path('homepage')},
{label: city.name, uri: path('profile_list.list_by_city', {city: city.uriIdentity})}
] %}
{% set children = main|merge([children[1]]) %} #}
{# <ul class="breadcrumbs" itemscope itemtype="https://schema.org/BreadcrumbList">
<li class="breadcrumbs-item" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
<a href="{{ (children|first).uri }}" itemprop="item"><span itemprop="name">{{ (children|first).label }}</span></a>
<meta itemprop="position" content="0">
</li> #}
{% set position = 1 %}
{% if city and city.id == 1 %}
{% if not profile.masseur and profile.personParameters.gender != gender_trans() and profile.personParameters.gender != gender_male() %}
{% set station = profile.stations|length ? profile.stations[0] : null %}
{#{% if profile and station and station.district and station.county %}#}
{% if profile and station and station.county %}
{% set items = items|merge([{label: station.county.name|trans, uri: path('profile_list.list_by_county', {city: city.uriIdentity, county: station.county.uriIdentity}) }]) %}
{% set items = items|merge([{label: station.district.name|trans, uri: path('profile_list.list_by_district', {city: city.uriIdentity, district: station.district.uriIdentity}) }]) %}
{% set items = items|merge([{label: station.name|trans, uri: path('profile_list.list_by_station', {city: city.uriIdentity, station: station.uriIdentity}) }]) %}
{# <li class="breadcrumbs-item" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
<a href="{{ path('profile_list.list_by_county', {city: city.uriIdentity, county: station.county.uriIdentity }) }}" itemprop="item"><span itemprop="name">{{ station.county.name|trans }}</span></a>
<meta itemprop="position" content="1">
</li> #}
{# <li class="breadcrumbs-item" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
<a href="{{ path('profile_list.list_by_district', {city: city.uriIdentity, district: station.district.uriIdentity}) }}" itemprop="item"><span itemprop="name">{{ station.district.name|trans }}</span></a>
<meta itemprop="position" content="2">
</li> #}
{# <li class="breadcrumbs-item" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
<a href="{{ path('profile_list.list_by_station', {city: city.uriIdentity, station: station.uriIdentity}) }}" itemprop="item"><span itemprop="name">{{ station.name|trans }}</span></a>
<meta itemprop="position" content="1">
</li> #}
{% set position = 4 %}
{% else %}
{#
если у анкеты нет станции, то:
Южный (ЮАО), Донской, Ленинский проспект
#}
{% set items = items|merge([{label: locale == 'ru' ? 'Южный (ЮАО)' : 'South (SAD)', uri: path('profile_list.list_by_county', {city: city.uriIdentity, county: 'yuzhnyj-yuao' }) }]) %}
{% set items = items|merge([{label: locale == 'ru' ? 'Донской' : 'Donskoy', uri: path('profile_list.list_by_district', {city: city.uriIdentity, district: 'donskoj'}) }]) %}
{% set items = items|merge([{label: locale == 'ru' ? 'Ленинский проспект' : 'Leninskij prospekt', uri: path('profile_list.list_by_station', {city: city.uriIdentity, station: 'leninskij-prospekt'}) }]) %}
{# <li class="breadcrumbs-item" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
<a href="{{ path('profile_list.list_by_county', {city: city.uriIdentity, county: 'yuzhnyj-yuao' }) }}" itemprop="item"><span itemprop="name">{{ locale == 'ru' ? 'Южный (ЮАО)' : 'South (SAD)' }}</span></a>
<meta itemprop="position" content="1">
</li>
<li class="breadcrumbs-item" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
<a href="{{ path('profile_list.list_by_district', {city: city.uriIdentity, district: 'donskoj'}) }}" itemprop="item"><span itemprop="name">{{ locale == 'ru' ? 'Донской' : 'Donskoy' }}</span></a>
<meta itemprop="position" content="2">
</li>
<li class="breadcrumbs-item" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
<a href="{{ path('profile_list.list_by_station', {city: city.uriIdentity, station: 'leninskij-prospekt'}) }}" itemprop="item"><span itemprop="name">{{ locale == 'ru' ? 'Ленинский проспект' : 'Leninskij prospekt' }}</span></a>
<meta itemprop="position" content="1">
</li> #}
{% set position = 4 %}
{% endif %}
{% endif %}
{% else %}
{% set items = items|merge([{label: city.name, uri: path('profile_list.list_by_city', {city: city.uriIdentity}) }]) %}
{# <li class="breadcrumbs-item" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
<a href="{{ path('profile_list.list_by_city', {city: city.uriIdentity}) }}" itemprop="item"><span itemprop="name">{{ city.name }}</span></a>
<meta itemprop="position" content="1">
</li> #}
{% set position = 2 %}
{% endif %}
{% if profile.masseur %}
{% set items = items|merge([{label: 'Массажистки', uri: path('masseur_list.page', {city: city.uriIdentity}) }]) %}
{# <li class="breadcrumbs-item" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
<a href="{{ path('masseur_list.page', {city: city.uriIdentity}) }}" itemprop="item"><span itemprop="name">Массажистки</span></a>
<meta itemprop="position" content="1">
</li> #}
{% elseif profile.personParameters.gender == gender_trans() %}
{# {% set items = items|merge([{label: 'Трансы', uri: path('profile_list.list_by_gender', {city: city.uriIdentity, gender: gender_trans()|gender_uri}) }]) %} #}
{# <li class="breadcrumbs-item" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
<a href="{{ path('profile_list.list_by_gender', {city: city.uriIdentity, gender: gender_trans()|gender_uri}) }}" itemprop="item"><span itemprop="name">Трансы</span></a>
<meta itemprop="position" content="1">
</li> #}
{% elseif profile.personParameters.gender == gender_male() %}
{# {% set items = items|merge([{label: 'Жиголо', uri: path('profile_list.list_by_gender', {city: city.uriIdentity, gender: gender_male()|gender_uri}) }]) %} #}
{# <li class="breadcrumbs-item" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
<a href="{{ path('profile_list.list_by_gender', {city: city.uriIdentity, gender: gender_male()|gender_uri}) }}" itemprop="item"><span itemprop="name">Жиголо</span></a>
<meta itemprop="position" content="1">
</li> #}
{% endif %}
{# <li class="breadcrumbs-item" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"> #}
{% set profile_type_name = 'Индивидуалка' %}
{% set profile_type_name = profile.masseur ? 'Массажистка' : profile_type_name %}
{% set profile_type_name = profile.personParameters.gender == gender_trans() ? 'Мужчина' : profile_type_name %}
{% set profile_type_name = profile.personParameters.gender == gender_male() ? 'Жиголо' : profile_type_name %}
{% set breadcrumbs_list = profile_type_name ~ ' ' ~ children|last.label ~ ' ID' ~ profile.id %}
{% set items = items|merge([{label: breadcrumbs_list }]) %}
{# <span itemprop="name">{{ profile_type_name }} {{ children|last.label }} ID{{ profile.id }}</span> #}
{# <meta itemprop="position" content="{{ position }}"> #}
{# </li> #}
{# </ul> #}
{{ _self._breadcrumbs_generate(items) }}
{% elseif route == 'saloon_preview.page' %}
{% set saloon = options.saloon ?? null %}
{# {% set main = [{label: 'Главная', uri: path('homepage')}] %}
{% set children = main|merge([children[1], children[2]]) %} #}
{% set items = [
{label: 'Главная', uri: path('homepage')}
] %}
{% set items = items|merge([children[1], children[2]]) %}
{{ _self._breadcrumbs_generate(items) }}
{% else %}
{# <ul class="breadcrumbs" itemscope itemtype="https://schema.org/BreadcrumbList"> #}
{% if route == 'profile_list.list_by_district' %}
{# Убираем название округа #}
{% set children = children | map((k) => k) | filter((v, k) => k != 2) %}
{% elseif route == 'profile_list.list_by_county' %}
{# Убираем слово районы #}
{% set children = [children[0], children[2]] %}
{% endif %}
{% if city.id == 1 %}
{# Делаем првый элемент "Главная" #}
{% set items = [
{label: 'Главная', uri: path('homepage')}
] %}
{% set children = items|merge([children[1]]) %}
{% else %}
{# Делаем првый элемент "Главная", второй - город #}
{% set items = [
{label: 'Главная', uri: path('homepage')},
{label: city.name, uri: path('profile_list.list_by_city', {city: city.uriIdentity})}
] %}
{% set children = items|merge([children[1]]) %}
{% endif %}
{% set items = [] %}
{% for breadcrumb_item in children %}
{# <li class="breadcrumbs-item{% if loop.last %} last-crumb{% endif %}" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"> #}
{% if not loop.last %}
{# <a href="{{ breadcrumb_item.uri }}" itemprop="item"><span itemprop="name">{{ breadcrumb_item.label|trans({}, 'breadcrumbs') }}</span></a> #}
{% set items = items|merge([{label: breadcrumb_item.label|trans({}, 'breadcrumbs'), uri: breadcrumb_item.uri }]) %}
{% else %}
{# <span itemprop="name">{{ breadcrumb_item.label|trans({}, 'breadcrumbs') }}</span> #}
{% set items = items|merge([{label: breadcrumb_item.label|trans({}, 'breadcrumbs') }]) %}
{% endif %}
{# <meta itemprop="position" content="{{ loop.index }}"> #}
{# </li> #}
{% endfor %}
{# </ul> #}
{{ _self._breadcrumbs_generate(items) }}
{% endif %}
{% endif %}