{% set class = class|default('') %}
{% set heroSettings = heroSettings|default(null) %}
<div class="hero-info {{ class }}">
<div class="container container_spacer">
<div class="hero-info__inner grid-block">
{# Title #}
{% if heroSettings.title %}
<h2 class="hero-info__title h2_laptop">
{{ heroSettings.title }}
</h2>
{% endif %}
<div class="hero-info__address-wrapper">
{# Address #}
{% if heroSettings.address and not heroSettings.addressInList %}
<div class="hero-info__address">
<div class="hero-info__address-icon">
{{ source('_parts/icons/balloon.svg') }}
</div>
<h3 class="hero-info__address-title text__black-text">
{{ heroSettings.address }}
</h3>
</div>
{% endif %}
{# Description #}
{% if heroSettings.description %}
<div class="hero-info__description text__main text__black-text">
{{ heroSettings.description }}
</div>
{% endif %}
</div>
{# Info list #}
<ul class="hero-info__list">
{% if heroSettings.deadline%}
<li class="hero-info__item">
<div class="hero-info__item-key">
{{ heroSettings.deadlineTitle }}
</div>
<div class="hero-info__item-value">
{{ heroSettings.deadline }}
</div>
</li>
{% endif %}
{% if heroSettings.district %}
<li class="hero-info__item">
<div class="hero-info__item-key">
Район
</div>
<div class="hero-info__item-value">
{{ heroSettings.district }}
</div>
</li>
{% endif %}
{% if heroSettings.address and heroSettings.addressInList %}
<li class="hero-info__item">
<div class="hero-info__item-key">
Адрес
</div>
<div class="hero-info__item-value">
{{ heroSettings.address }}
</div>
</li>
{% endif %}
{% if not heroSettings.address %}
<li class="hero-info__item">
<div class="hero-info__item-key">
Адрес
</div>
<div class="hero-info__item-value">
<ul class="hero-info__addresses-list">
{% for address in heroSettings.addresses.toArray %}
<li class="hero-info__address-item">
{{ address.address }}
</li>
{% endfor %}
</ul>
</div>
</li>
{% endif %}
{% if heroSettings.numberOfFloors %}
<li class="hero-info__item">
<div class="hero-info__item-key">
Этажи
</div>
<div class="hero-info__item-value">
{{ heroSettings.numberOfFloors }}
</div>
</li>
{% endif %}
{% if heroSettings.flatsArea %}
<li class="hero-info__item">
<div class="hero-info__item-key">
Площадь квартир
</div>
<div class="hero-info__item-value">
{{ heroSettings.flatsArea }}
</div>
</li>
{% endif %}
</ul>
{# Video #}
{% if heroSettings.videoLink %}
<div class="hero-info__video-link-wrap">
<a href="{{ heroSettings.videoLink }}"
class="hero-info__video-link"
title="{{ heroSettings.videoTitle }}"
data-fslightbox="hero-info-video"
itemprop="url"
>
<div class="hero-info__preview-wrap"
itemprop="thumbnail"
itemscope
itemtype="http://schema.org/ImageObject"
>
{% if heroSettings is has_image('videoPreviewImageName') %}
{% include '_parts/image/adaptive-image.html.twig' with {
object: heroSettings,
field: 'imageFile',
size: 'hero_video_preview_thumb',
alt: heroSettings.videoTitle,
class: 'hero-info__image',
classPicture: 'hero-info__picture',
} %}
{% else %}
{% set urlPreview = get_url_preview(heroSettings.videoLink) %}
<img class="hero-info__image"
src="{{ urlPreview }}"
itemprop="contentUrl"
>
{% endif %}
<div class="hero-info__video-link-icon play-icon">
{{ source('_parts/icons/play.svg') }}
</div>
</div>
<div class="hero-info__video-title text__body text__black-text">
{{ heroSettings.videoTitle }}
</div>
</a>
</div>
{% endif %}
{# Logo #}
{% if not heroSettings.hideLogo %}
<div class="hero-info__logo">
{{ source('_parts/icons/kssk-logo.svg') }}
</div>
{% endif %}
</div>
</div>
</div>