{% extends 'grid.html.twig' %}
{% set linkLangSupport = app.request.locale == 'en' ? '/en' : '' %}
{% block mainContainer %}
{{ knp_menu_render('breadcrumbs', {'template': '__design/v2023/_menu/breadcrumbs.html.twig'}) }}
<div class="heading d-flex">
<h1 class="heading-title text-title mr-1" role="heading">{{ seo_heading() ? seo_heading() : 'Поиск по районам' }}</h1>
</div>
<div class="catalog-district-container white-block mb-4">
{% set currentCounty = null %}
{% set sorted_stations = city.counties|sort((a, b) => a.name|upper <=> b.name|upper) %}
{% for county in sorted_stations %}
{% set profilesCountInCounty = count_by_counties[county.id] ?? 0 %}
{% set newCounty = county.name %}
{% if newCounty != currentCounty %}
{% if loop.index != 1 %}</div>{% endif %}
{% set currentCounty = newCounty %}
<div class="catalog catalog-district mb-4">
<a class="catalog-title mb-2 fw-700 d-flex-c" href="{{ path('profile_list.list_by_county', {'city': city.uriIdentity, 'county': county.uriIdentity}) }}">
{{ county.name|trans }} <span class="metro-count counties-count d-flex-c clr-main-text fw-600">{{ profilesCountInCounty }}</span>
</a>
{% endif %}
{% for district in county.districts|sort((a, b) => a.name|trans|upper <=> b.name|trans|upper) %}
{% set profilesCount = count_by_districts[district.id] ?? 0 %}
<div class="catalog-item">
<a class="metro-link d-flex-c" href="{{ path('profile_list.list_by_district', {'city': city.uriIdentity, 'district': district.uriIdentity}) }}">
<span class="metro-name mr-1">{{ district.name|trans }}</span>
<span class="metro-count d-flex-c clr-main-text fw-600">{{ profilesCount }}</span>
</a>
</div>
{% endfor %}
{# <div class="catalog-item">
<a class="metro-link d-flex-c" href="{{ path('profile_list.list_by_station', {'city': city.uriIdentity, 'station': station.uriIdentity}) }}">
{% include 'components/metro/icon_generate.partial.twig' with {data: station.id|station_lines} %}
<span class="metro-name mr-1">{{ station.name|trans }}</span>
<span class="metro-count d-flex-c clr-main-text fw-600">10</span>
</a>
</div> #}
{% endfor %}
</div>
{# <div class="new-questionare">
{{ include('components/last_girl_list.html.twig') }}
</div>
{{ include('components/seo_text.html.twig', { 'type': 'bottom', "noindex": false }) }} #}
{% endblock %}