templates/geo/parts/resort-list-small.html.twig line 1

Open in your IDE?
  1. {% if cities|length > 0 %}
  2.     <div class="container__header">
  3.         {% if route in ['app_country_search', 'app_country_search_season'] %}
  4.             {% set hN = 'h2' %}
  5.         {% else %}
  6.             {% set hN = 'h3' %}
  7.         {% endif %}
  8.         <{{ hN }} class="container__header-title">
  9.             {% if route == 'app_country_search_season' %}
  10.                 {{ 'Популярные курорты'|trans }} {{ (season~'Vn')|trans }}
  11.             {% else %}
  12.                 {{ 'Популярные курорты'|trans }}
  13.             {% endif %}
  14.         </{{ hN }}>
  15.     </div>
  16.     <div class="small-card-with-caption-list__container">
  17.         {% for city in cities %}
  18.             {# класс active добавляем к small-card-with-caption-list__item если страница курорта и курорт совпадают #}
  19.             <a class="small-card-with-caption-list__item" href="{% if route in ['app_country_search_departure_city', 'app_city_search_departure_city'] %}{{ path('app_city_search_departure_city', { country: page.info.countryTr, city: city.nameTr, departureCity: departureCity.nameTr }) }}{% elseif route == 'app_country_search_season' %}{{ path('app_city_search_season', { country: page.info.countryTr, city: city.nameTr, season: season }) }}{% else %}{{ path('app_city_search', { country: page.info.countryTr, city: city.nameTr }) }}{% endif %}" title="{{ city.name }}">
  20.                 <span class="small-card-with-caption-list__photo" style="background-image: url('{{ city.desktop_gallery }}');"></span>
  21.                 <span class="small-card-with-caption-list__title">{{ city.name }}</span>
  22.             </a>
  23.         {% endfor %}
  24.     </div>
  25. {% endif %}