templates/_parts/hero/_hero-info.html.twig line 1

Open in your IDE?
  1. {% set class = class|default('') %}
  2. {% set heroSettings = heroSettings|default(null) %}
  3. <div class="hero-info {{ class }}">
  4.     <div class="container container_spacer">
  5.         <div class="hero-info__inner grid-block">
  6.             {# Title #}
  7.             {% if heroSettings.title %}
  8.                 <h2 class="hero-info__title h2_laptop">
  9.                     {{ heroSettings.title }}
  10.                 </h2>
  11.             {% endif %}
  12.             <div class="hero-info__address-wrapper">
  13.                 {# Address #}
  14.                 {% if heroSettings.address and not heroSettings.addressInList %}
  15.                     <div class="hero-info__address">
  16.                         <div class="hero-info__address-icon">
  17.                             {{ source('_parts/icons/balloon.svg') }}
  18.                         </div>
  19.                         <h3 class="hero-info__address-title text__black-text">
  20.                             {{ heroSettings.address }}
  21.                         </h3>
  22.                     </div>
  23.                 {% endif %}
  24.                 {# Description #}
  25.                 {% if heroSettings.description %}
  26.                     <div class="hero-info__description text__main text__black-text">
  27.                         {{ heroSettings.description }}
  28.                     </div>
  29.                 {% endif %}
  30.             </div>
  31.             {# Info list #}
  32.             <ul class="hero-info__list">
  33.                 {% if heroSettings.deadline%}
  34.                     <li class="hero-info__item">
  35.                         <div class="hero-info__item-key">
  36.                             {{ heroSettings.deadlineTitle }}
  37.                         </div>
  38.                         <div class="hero-info__item-value">
  39.                             {{ heroSettings.deadline }}
  40.                         </div>
  41.                     </li>
  42.                 {% endif %}
  43.                 {% if heroSettings.district %}
  44.                     <li class="hero-info__item">
  45.                         <div class="hero-info__item-key">
  46.                             Район
  47.                         </div>
  48.                         <div class="hero-info__item-value">
  49.                             {{ heroSettings.district }}
  50.                         </div>
  51.                     </li>
  52.                 {% endif %}
  53.                 {% if heroSettings.address and heroSettings.addressInList %}
  54.                     <li class="hero-info__item">
  55.                         <div class="hero-info__item-key">
  56.                             Адрес
  57.                         </div>
  58.                         <div class="hero-info__item-value">
  59.                             {{ heroSettings.address }}
  60.                         </div>
  61.                     </li>
  62.                 {% endif %}
  63.                 {% if not heroSettings.address %}
  64.                     <li class="hero-info__item">
  65.                         <div class="hero-info__item-key">
  66.                             Адрес
  67.                         </div>
  68.                         <div class="hero-info__item-value">
  69.                             <ul class="hero-info__addresses-list">
  70.                                 {% for address in heroSettings.addresses.toArray %}
  71.                                     <li class="hero-info__address-item">
  72.                                         {{ address.address }}
  73.                                     </li>
  74.                                 {% endfor %}
  75.                             </ul>
  76.                         </div>
  77.                     </li>
  78.                 {% endif %}
  79.                 {% if heroSettings.numberOfFloors %}
  80.                     <li class="hero-info__item">
  81.                         <div class="hero-info__item-key">
  82.                             Этажи
  83.                         </div>
  84.                         <div class="hero-info__item-value">
  85.                             {{ heroSettings.numberOfFloors }}
  86.                         </div>
  87.                     </li>
  88.                 {% endif %}
  89.                 {% if heroSettings.flatsArea %}
  90.                     <li class="hero-info__item">
  91.                         <div class="hero-info__item-key">
  92.                             Площадь квартир
  93.                         </div>
  94.                         <div class="hero-info__item-value">
  95.                             {{ heroSettings.flatsArea }}
  96.                         </div>
  97.                     </li>
  98.                 {% endif %}
  99.             </ul>
  100.             {# Video #}
  101.             {% if heroSettings.videoLink %}
  102.                 <div class="hero-info__video-link-wrap">
  103.                     <a href="{{ heroSettings.videoLink }}"
  104.                        class="hero-info__video-link"
  105.                        title="{{ heroSettings.videoTitle }}"
  106.                        data-fslightbox="hero-info-video"
  107.                        itemprop="url"
  108.                     >
  109.                         <div class="hero-info__preview-wrap"
  110.                              itemprop="thumbnail"
  111.                              itemscope
  112.                              itemtype="http://schema.org/ImageObject"
  113.                         >
  114.                             {% if heroSettings is has_image('videoPreviewImageName') %}
  115.                                 {% include '_parts/image/adaptive-image.html.twig' with {
  116.                                     object: heroSettings,
  117.                                     field: 'imageFile',
  118.                                     size: 'hero_video_preview_thumb',
  119.                                     alt: heroSettings.videoTitle,
  120.                                     class: 'hero-info__image',
  121.                                     classPicture: 'hero-info__picture',
  122.                                 } %}
  123.                             {% else %}
  124.                                 {% set urlPreview = get_url_preview(heroSettings.videoLink) %}
  125.                                 <img class="hero-info__image"
  126.                                      src="{{ urlPreview }}"
  127.                                      itemprop="contentUrl"
  128.                                 >
  129.                             {% endif %}
  130.                             <div class="hero-info__video-link-icon play-icon">
  131.                                 {{ source('_parts/icons/play.svg') }}
  132.                             </div>
  133.                         </div>
  134.                         <div class="hero-info__video-title text__body text__black-text">
  135.                             {{ heroSettings.videoTitle }}
  136.                         </div>
  137.                     </a>
  138.                 </div>
  139.             {% endif %}
  140.             {# Logo #}
  141.             {% if not heroSettings.hideLogo %}
  142.                 <div class="hero-info__logo">
  143.                     {{ source('_parts/icons/kssk-logo.svg') }}
  144.                 </div>
  145.             {% endif %}
  146.         </div>
  147.     </div>
  148. </div>