templates/geo/parts/early.html.twig line 1

Open in your IDE?
  1. <div id="months"></div>
  2. <div class="container">
  3.     <div class="container__header">
  4.         <h3 class="container__header-title" data-anchor="months">
  5.             {{ 'Туры по месяцам'|trans }}
  6.         </h3>
  7.     </div>
  8.     <div class="season-tour-list__container">
  9.         {% set minPriceBySeasonWinter = [] %}
  10.         {% set minPriceBySeasonSpring = [] %}
  11.         {% set minPriceBySeasonSummer = [] %}
  12.         {% set minPriceBySeasonAutumn = [] %}
  13.         {% for item in items %}
  14.             {% set backgroundColor = 'white' %}
  15.             {% if item.monthName in ['Dec', 'Jan', 'Feb'] %}
  16.                 {% set backgroundColor = 'blue' %}
  17.                 {% if item.price|round != 0 %}
  18.                     {% set minPriceBySeasonWinter = minPriceBySeasonWinter|merge([item.price|round]) %}
  19.                 {% endif %}
  20.             {% elseif item.monthName in ['Mar', 'Apr', 'May'] %}
  21.                 {% set backgroundColor = 'green' %}
  22.                 {% if item.price|round != 0 %}
  23.                     {% set minPriceBySeasonSpring = minPriceBySeasonSpring|merge([item.price|round]) %}
  24.                 {% endif %}
  25.             {% elseif item.monthName in ['Jun', 'Jul', 'Aug'] %}
  26.                 {% set backgroundColor = 'red' %}
  27.                 {% if item.price|round != 0 %}
  28.                     {% set minPriceBySeasonSummer = minPriceBySeasonSummer|merge([item.price|round]) %}
  29.                 {% endif %}
  30.             {% elseif item.monthName in ['Sep', 'Oct', 'Nov'] %}
  31.                 {% set backgroundColor = 'yellow' %}
  32.                 {% if item.price|round != 0 %}
  33.                     {% set minPriceBySeasonAutumn = minPriceBySeasonAutumn|merge([item.price|round]) %}
  34.                 {% endif %}
  35.             {% endif %}
  36.             <a class="season-tour-list__item {{ backgroundColor }}"
  37.                title="{{ 'Туры'|trans }} на {{ attribute(translate.getMonth, item.monthName|lower)|trans }} {{ 'от'|trans }} {{ item.price }} {{ market.currency.name }}"
  38.                href="
  39.                     {% if route in ['app_city_search', 'app_city_search_season'] %}
  40.                         {{ path('app_city_search_season', {country: page.info.countryTr, city:page.info.nameTr, season: attribute(translate.getMonth, item.monthName|lower)}) }}
  41.                     {% else %}
  42.                         {{ path('app_country_search_season', {country: page.info.countryTr, season: attribute(translate.getMonth, item.monthName|lower)}) }}
  43.                     {% endif %}
  44.                 ">
  45.                 <p class="season-tour-list__item-month">{{ attribute(translate.getMonth, item.monthName|lower)|trans }}</p>
  46.                 {% if route in ['app_city_search_season', 'app_city_search_departure_city', 'app_city_search', 'app_country_search_season', 'app_country_search_departure_city', 'app_country_search'] %}
  47.                     <p class="season-tour-list__item-weather">
  48.                         {% if item.weather is not null %}
  49.                             <i class="icon icon-16px i16-other-5"></i>
  50.                             <span>+{{ item.weather }}°</span>
  51.                         {% endif %}
  52.                         {% if item.water is not null %}
  53.                             <i class="icon icon-16px i16-charact-20"></i>
  54.                             <span>+{{ item.water }}°</span>
  55.                         {% endif %}
  56.                     </p>
  57.                 {% endif %}
  58.                 <p class="season-tour-list__item-price">
  59.                     {% if item.price|round != 0 %}
  60.                         {{ 'от'|trans }} {{ item.price|round }} {{ market.currency.name }}
  61.                     {% else %}
  62.                         {{ 'Туров нет'|trans }}
  63.                     {% endif %}
  64.                 </p>
  65.             </a>
  66.         {% endfor %}
  67.         <a class="season-tour-list__item white" title="{{ 'Туры'|trans }} на {{ 'winterRd'|trans }}"
  68.            href="
  69.             {% if route in ['app_city_search', 'app_city_search_season'] %}
  70.                 {{ path('app_city_search_season', {country: page.info.countryTr, season: 'winter', city:page.info.nameTr,}) }}
  71.             {% else %}
  72.                 {{ path('app_country_search_season', {country: page.info.countryTr, season: 'winter'}) }}
  73.             {% endif %}
  74.           ">
  75.             <p class="season-tour-list__item-month">{{ 'winter'|trans }}</p>
  76.             <p class="season-tour-list__item-price">
  77.                 {% if minPriceBySeasonWinter|length > 0 and min(minPriceBySeasonWinter) != 0 %}
  78.                     {{ 'от'|trans }} {{ min(minPriceBySeasonWinter) }} {{ market.currency.name }}
  79.                 {% else %}
  80.                     {{ 'Туров нет'|trans }}
  81.                 {% endif %}
  82.             </p>
  83.         </a>
  84.         <a class="season-tour-list__item white" title="{{ 'Туры'|trans }} на {{ 'springRd'|trans }}"
  85.            href="
  86.             {% if route in ['app_city_search', 'app_city_search_season'] %}
  87.                 {{ path('app_city_search_season', {country: page.info.countryTr, season: 'spring', city:page.info.nameTr,}) }}
  88.             {% else %}
  89.                 {{ path('app_country_search_season', {country: page.info.countryTr, season: 'spring'}) }}
  90.             {% endif %}
  91.             ">
  92.             <p class="season-tour-list__item-month">{{ 'spring'|trans }}</p>
  93.             <p class="season-tour-list__item-price">
  94.                 {% if minPriceBySeasonSpring|length > 0 and min(minPriceBySeasonSpring) != 0 %}
  95.                     {{ 'от'|trans }} {{ min(minPriceBySeasonSpring) }} {{ market.currency.name }}
  96.                 {% else %}
  97.                     {{ 'Туров нет'|trans }}
  98.                 {% endif %}
  99.             </p>
  100.         </a>
  101.         <a class="season-tour-list__item white" title="{{ 'Туры'|trans }} на {{ 'summerRd'|trans }}"
  102.            href="
  103.             {% if route in ['app_city_search', 'app_city_search_season'] %}
  104.                 {{ path('app_city_search_season', {country: page.info.countryTr, season: 'summer', city:page.info.nameTr,}) }}
  105.             {% else %}
  106.                 {{ path('app_country_search_season', {country: page.info.countryTr, season: 'summer'}) }}
  107.             {% endif %}
  108.             ">
  109.             <p class="season-tour-list__item-month">{{ 'summer'|trans }}</p>
  110.             <p class="season-tour-list__item-price">
  111.                 {% if minPriceBySeasonSummer|length > 0 and min(minPriceBySeasonSummer) != 0 %}
  112.                     {{ 'от'|trans }} {{ min(minPriceBySeasonSummer) }} {{ market.currency.name }}
  113.                 {% else %}
  114.                     {{ 'Туров нет'|trans }}
  115.                 {% endif %}
  116.             </p>
  117.         </a>
  118.         <a class="season-tour-list__item white" title="{{ 'Туры'|trans }} на {{ 'autumnRd'|trans }}"
  119.            href="
  120.            {% if route in ['app_city_search', 'app_city_search_season'] %}
  121.              {{ path('app_city_search_season', {country: page.info.countryTr, season: 'autumn', city:page.info.nameTr,}) }}
  122.            {% else %}
  123.              {{ path('app_country_search_season', {country: page.info.countryTr, season: 'autumn'}) }}
  124.            {% endif %}
  125.            ">
  126.             <p class="season-tour-list__item-month">{{ 'autumn'|trans }}</p>
  127.             <p class="season-tour-list__item-price">
  128.                 {% if minPriceBySeasonAutumn|length > 0 and min(minPriceBySeasonAutumn) != 0 %}
  129.                     {{ 'от'|trans }} {{ min(minPriceBySeasonAutumn) }} {{ market.currency.name }}
  130.                 {% else %}
  131.                     {{ 'Туров нет'|trans }}
  132.                 {% endif %}
  133.             </p>
  134.         </a>
  135.     </div>
  136.     <div class="spoiler__container">
  137.         <div class="spoiler__button not-toggable" id="show-more-seasons-button">
  138.             <span>
  139.                 <i class="icon icon-darr-blue"></i>
  140.                 {{ 'Больше'|trans }}
  141.             </span>
  142.         </div>
  143.     </div>
  144. </div>