{% set route = app.request.get('_route') %}
{% set city = app.request.get('city') ?? null %}
{% set items = item.children %}
{% set crumbHomepage = items|slice(0, 1)|first %}
{% if 'profile_preview.page' in route %}
{% set profile = app.request.get('profile') %}
{% set profileItem = {label: 'Индивидуалка ' ~ profile.name|trans ~ ' (' ~ profile.personParameters.age ~ ')', uri: '' } %}
{% if(city.id == default_city().id) %}
{% 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_by_station' in route %}
{% set items = [
crumbHomepage,
{label: 'Метро СПБ', uri: path('station_list.page', {city: city.uriIdentity})},
items|slice(1, 1)|first
] %}
{% 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 %}