{% extends 'grid.html.twig' %}
{% set linkLangSupport = app.request.locale == 'en' ? '/en' : '' %}
{% block bodyClasses %}{% endblock %}
{% block specialPageClass %} full-width-page{% endblock %}
{% set city = app.request.attributes.get('city') %}
{% block title %}
{{ seo_title() }}
{% endblock %}
{% block metaDescription %}
<meta name="description" content="{{ seo_description() }}">
{% endblock %}
{% block mainContainer %}
<h1 role="heading" class="border-line">{{ seo_heading() }}</h1>
<div class="city-block">
{% if city.counties|length > 0 %}
{% set sorted_stations = city.counties|sort((a, b) => a.name|upper <=> b.name|upper) %}
{% for county in sorted_stations %}
{% if loop.index == (loop.length/2+1) or loop.index == 1 %}
<div class="column">
{% endif %}
<div class="title">
<a href="{{ path('profile_list.list_by_county', {'city': city.uriIdentity, 'county': county.uriIdentity}) }}">{{ county.name|trans }}</a>
</div>
<ul>
{% for district in county.districts|sort((a, b) => a.name|trans|upper <=> b.name|trans|upper) %}
<li>
<a href="{{ path('profile_list.list_by_district', {'city': city.uriIdentity, 'district': district.uriIdentity}) }}">{{ district.name|trans }}</a><br>
</li>
{% endfor %}
</ul>
{% if loop.index == (loop.length/2) or loop.revindex == 1 %}
</div>
{% endif %}
{% endfor %}
{% else %}
<ul class="list-unstyled">
{% for district in city.districts|sort((a, b) => a.name|trans|upper <=> b.name|trans|upper) %}
{% set profilesCount = count_by_districts[district.id] ?? 0 %}
<li><a href="{{ path('profile_list.list_by_district', {'city': city.uriIdentity, 'district': district.uriIdentity}) }}"><span class="link">{{ district.name }}</span> <span class="count">{{ profilesCount }}</span></a></li>
{% endfor %}
</ul>
{% endif %}
</div>
{# {{ include('components/big_footer.html.twig', { 'type': 'main' }) }} #}
{{ include('components/seo.partial.twig', {type: 'top'}) }}
{{ include('components/seo.partial.twig', {type: 'bottom'}) }}
{% endblock %}