templates/DistrictList/list.html.twig line 1

Open in your IDE?
  1. {% extends 'grid.html.twig' %}
  2. {% set linkLangSupport = app.request.locale == 'en' ? '/en' : '' %}
  3. {% block bodyClasses %}{% endblock %}
  4. {% block specialPageClass %} full-width-page{% endblock %}
  5. {% set city = app.request.attributes.get('city') %}
  6. {% block title %}
  7.     {{ seo_title() }}
  8. {% endblock %}
  9. {% block metaDescription %}
  10.     <meta name="description" content="{{ seo_description() }}">
  11. {% endblock %}
  12. {% block mainContainer %}
  13.     <h1 role="heading" class="border-line">{{ seo_heading() }}</h1>
  14.     <div class="city-block">
  15.         {% if city.counties|length > 0 %}
  16.             {% set sorted_stations = city.counties|sort((a, b) => a.name|upper <=> b.name|upper) %}
  17.             {% for county in sorted_stations %}
  18.                 {% if loop.index == (loop.length/2+1) or loop.index == 1 %}
  19.                     <div class="column">
  20.                 {% endif %}
  21.                 <div class="title">
  22.                     <a href="{{ path('profile_list.list_by_county', {'city': city.uriIdentity, 'county': county.uriIdentity}) }}">{{ county.name|trans }}</a>
  23.                 </div>
  24.                 <ul>
  25.                     {% for district in county.districts|sort((a, b) => a.name|trans|upper <=> b.name|trans|upper) %}
  26.                         <li>
  27.                             <a href="{{ path('profile_list.list_by_district', {'city': city.uriIdentity, 'district': district.uriIdentity}) }}">{{ district.name|trans }}</a><br>
  28.                         </li>
  29.                     {% endfor %}
  30.                 </ul>
  31.                 {% if loop.index == (loop.length/2) or loop.revindex == 1 %}
  32.                     </div>
  33.                 {% endif %}
  34.             {% endfor %}
  35.         {% else %}
  36.             <ul class="list-unstyled">
  37.                 {% for district in city.districts|sort((a, b) => a.name|trans|upper <=> b.name|trans|upper) %}
  38.                     {% set profilesCount = count_by_districts[district.id] ?? 0 %}
  39.                     <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>
  40.                 {% endfor %}
  41.             </ul>
  42.         {% endif %}
  43.     </div>
  44.     {# {{ include('components/big_footer.html.twig', { 'type': 'main' }) }} #}
  45.     {{ include('components/seo.partial.twig', {type: 'top'}) }}
  46.     {{ include('components/seo.partial.twig', {type: 'bottom'}) }}
  47. {% endblock %}