{% set route = app.request.get('_route') %}
{% set city = app.request.get('city') ?? null %}
{%- set defaultCity = city.id == default_city().id -%}
{% set items = item.children %}
{% set crumbHomepage = items|slice(0, 1)|first %}
{% set crumbHomepage = {label: crumbHomepage ? crumbHomepage.label : '', uri: path('homepage')} %}
{% if 'profile_preview.page' in route %}
{% set profile = app.request.get('profile') %}
{% set profileItem = {label: 'Индивидуалка ' ~ profile.name|trans ~ ' (' ~ profile.personParameters.age ~ ')', uri: '' } %}
{% if (defaultCity) %}
{% if profile.stations|length > 0 %}
{% set profileStation = profile.stations[0] %}
{% set items = [
crumbHomepage,
{label: 'Метро СПБ', uri: path('station_list.page', {city: city.uriIdentity})},
{label: 'Проститутки ' ~ profileStation.name|trans, uri: path('profile_list.list_by_station', {city: city.uriIdentity, station: profileStation.uriIdentity})},
profileItem
] %}
{% else %}
{% set items = [
crumbHomepage,
profileItem
] %}
{% endif %}
{% else %}
{% set items = [
crumbHomepage,
{label: city.name|trans, uri: path('profile_list.list_by_city', {city: city.uriIdentity})},
profileItem
] %}
{% endif %}
{%- elseif 'profile_list.list_height_tall' in route -%}
{% set items = [
crumbHomepage
] %}
{%- if not defaultCity -%}
{% set items = items|merge([
{label: city.name|trans, uri: path('profile_list.list_by_city', {'city': city.uriIdentity})}
]) %}
{%- endif -%}
{% set items = items|merge([
{label: 'Высокие'}
]) %}
{%- elseif 'profile_list.list_height_short' in route -%}
{% set items = [
crumbHomepage
] %}
{%- if not defaultCity -%}
{% set items = items|merge([
{label: city.name|trans, uri: path('profile_list.list_by_city', {'city': city.uriIdentity})}
]) %}
{%- endif -%}
{% set items = items|merge([
{label: 'Низкие'}
]) %}
{%- elseif 'profile_list.list_by_station_' in route %}
{#
profile_list.list_by_station_uzbek
profile_list.list_by_station_mature
profile_list.list_by_station_cheap
profile_list.list_by_station_verified
profile_list.list_by_station_eromassage
#}
{% set labelMap = {
'uzbek': 'Узбечки',
'mature': 'Зрелые',
'cheap': 'Недорогие',
'verified': 'Проверенные',
'eromassage': 'Эротический массаж'
} %}
{% set labelName = route|replace({'profile_list.list_by_station_': '', '._pagination': ''}) %}
{% set station = app.request.attributes.get('station') ?? null %}
{% set items = [
crumbHomepage
] %}
{% if feature('has_station_list_page') %}
{% set items = items|merge([
{label: 'Метро СПБ', uri: path('station_list.page', {'city': city.uriIdentity})}
]) %}
{% endif %}
{% set items = items|merge([
{label: station.name|trans, uri: path('profile_list.list_by_station', {'city': station.city.uriIdentity, 'station': station.uriIdentity}) },
{label: labelMap[labelName] , uri: null}
]) %}
{% elseif 'profile_list.list_by_station' in route %}
{% set items = [
crumbHomepage,
{label: 'Метро СПБ', uri: path('station_list.page', {city: city.uriIdentity})},
items|slice(1, 1)|first
] %}
{% elseif 'profile_list.list_by_district_' in route %}
{#
profile_list.list_by_district_uzbek
profile_list.list_by_district_mature
profile_list.list_by_district_cheap
profile_list.list_by_district_verified
profile_list.list_by_district_eromassage
#}
{% set labelMap = {
'uzbek': 'Узбечки',
'mature': 'Зрелые',
'cheap': 'Недорогие',
'verified': 'Проверенные',
'eromassage': 'Эротический массаж'
} %}
{% set labelName = route|replace({'profile_list.list_by_district_': '', '._pagination': ''}) %}
{% set district = app.request.get('district') %}
{% set items = [
crumbHomepage,
{label: district.name|trans, uri: path('profile_list.list_by_district', {'city': city.uriIdentity, 'district': district.uriIdentity}) },
{label: labelMap[labelName] , uri: null}
] %}
{% elseif 'profile_list.list_by_county_' in route %}
{#
profile_list.list_by_county_uzbek
profile_list.list_by_county_mature
profile_list.list_by_county_cheap
profile_list.list_by_county_verified
profile_list.list_by_county_eromassage
#}
{% set labelMap = {
'uzbek': 'Узбечки',
'mature': 'Зрелые',
'cheap': 'Недорогие',
'verified': 'Проверенные',
'eromassage': 'Эротический массаж'
} %}
{% set labelName = route|replace({'profile_list.list_by_county_': '', '._pagination': ''}) %}
{% set okrug = app.request.get('county') %}
{% set items = [
crumbHomepage,
{label: okrug.name|trans, uri: path('profile_list.list_by_county', {'city': city.uriIdentity, 'county': okrug.uriIdentity}) },
{label: labelMap[labelName] , uri: null}
] %}
{% elseif 'profile_list.list_by_provided_service' in route and (city.id != default_city().id) %}
{% set items = [
crumbHomepage,
{label: city.name|trans, uri: path('profile_list.list_by_city', {city: city.uriIdentity})},
items|slice(1, 1)|first
] %}
{% elseif 'profile_list.list_by_city' in route and (city.id != default_city().id) %}
{% set items = [
crumbHomepage,
{label: city.name|trans}
] %}
{% elseif 'profile_list.list_age_starye' in route %}
{% set items = [
crumbHomepage,
{label: 'Старые'}
] %}
{% elseif 'profile_list.list_bdsm' in route %}
{% set items = [
crumbHomepage,
{label: 'БДСМ проститутки '~city.name|geo_name('genitive')}
] %}
{% elseif 'profile_list.list_price_elite' in route %}
{%- set defaultCity = city.id == default_city().id -%}
{% set items = [
crumbHomepage,
{label: 'Элитные проститутки ' ~ (defaultCity ? 'Питера' : city.name|geo_name('genitive'))}
] %}
{% elseif 'profile_list.list_by_breast_type' in route %}
{% set breastType = app.request.get('breastType')|upper|trans({}, 'breast_types') %}
{% set items = [
crumbHomepage,
{label: breastType ~ ' грудь'}
] %}
{% elseif lastCrumbLabelInArticle is defined %}
{% if lastCrumbLabelInArticle == 'Статьи' %}
{% set items = [
{label: 'Главная', uri: path('homepage')},
{label: 'Статьи'}
] %}
{% else %}
{% set items = [
{label: 'Главная', uri: path('homepage')},
{label: 'Статьи', uri: path('static_page.articles')},
{label: lastCrumbLabelInArticle}
] %}
{% endif %}
{% endif %}
{% if items|length > 1 %}
<ul class="breadcrumbs" vocab="http://schema.org/" typeof="BreadcrumbList">
{% for breadcrumb_item in items %}
<li class="{% if loop.last %}last-crumb{% endif %}" property="itemListElement" typeof="ListItem">
{% if not loop.last %}
<a href="{{ breadcrumb_item.uri }}" property="item" typeof="WebPage"><span property="name">{{ breadcrumb_item.label|trans({}, 'breadcrumbs') }}</span></a>
{% else %}
<span property="name">{{ breadcrumb_item.label }}</span>
{% endif %}
<meta property="position" content="{{ loop.index }}">
</li>
{% endfor %}
</ul>
{% endif %}