{% extends "@openform_front_templates/base.html.twig" %}
{% from '@openform_front_templates/_includes/_icons.html.twig' import arrowObjectPrev %}
{% block bodyAttr %}data-page="detail-page"{% endblock %}
{% set pageSubTitle = entity.Translation[app.request.locale].title %}
{% set metaTitle = entity.Translation[app.request.locale].metaTitle ? entity.Translation[app.request.locale].metaTitle : entity.Translation[app.request.locale].title %}
{% set metaDescription = entity.Translation[app.request.locale].metaDescription %}
{% set metaKeywords = entity.Translation[app.request.locale].metaKeywords %}
{% set pageImage = entity.imagePath ? openform_front_util.getImagePathByType(entity.Thumb,'banner') : '' %}
{% if entity|getClassName == 'Page' %}
{% set pagesChildren = pagesChildren is not defined ? openform_front_util.getRepository('Openform:Page').getAllVisibleChildren(entity.id, app.request.locale) : pagesChildren %}
{% elseif entity|getClassName == 'Proposal' %}
{% set pagesChildren = entity.MenuPage is defined ? entity.MenuPage %}
{% elseif entity|getClassName == 'Mission' %}
{% set pagesChildren = entity.MenuPage is defined ? entity.MenuPage %}
{% else %}
{% set pagesChildren = [] %}
{% endif %}
{% block content %}
{% if entity.Translation[app.request.locale].subtitle or entity.Translation[app.request.locale].titleHtml or entity.Translation[app.request.locale].text or pagesChildren|length %}
<section class="detal-header container">
{% if entity.Translation[app.request.locale].subtitle or entity.Translation[app.request.locale].titleHtml %}
<div class="detal-header__title-block {{entity.imagePath ? 'detal-header__title-block--image'}}">
<div class="detal-header__title-block__subtitle">{{ entity.Translation[app.request.locale].subtitle }}</div>
<div class="detal-header__title-block__title">{{ entity.Translation[app.request.locale].titleHtml|raw }}</div>
</div>
{% endif %}
{% if entity.imagePath %}
<img class="detal-header__background" src="{{pageImage}}" alt="{{ entity.Translation[app.request.locale].alt }}">
{% endif %}
{% if entity.Translation[app.request.locale].text or pagesChildren|length %}
<div class="detal-header__content {{entity.templateId is defined and entity.templateId == 2 and entity.showChildren is defined and entity.showChildren ? 'detal-header__content--list'}}">
{% if entity.Translation[app.request.locale].text %}
<div class="detal-header__content__text block__text-L">{{ entity.Translation[app.request.locale].text|raw }}</div>
{% endif %}
{% if entity.showChildren is defined and entity.showChildren and pagesChildren|length %}
<div class="detal-header__content__subpages">
{{ include('@openform_front_templates/Page/components/_subpages.html.twig', {pagesChildren: pagesChildren, class: entity.templateId is defined and entity.templateId == 2 ? 'detal-header__subpage--list'}) }}
</div>
{% endif %}
</div>
{% endif %}
</section>
{% endif %}
{% include "@openform_front_templates/_blocks_sections/block.html.twig" with { sections: openform_front_util.getSections(entity), entity: entity } %}
{% if parentPage is defined and parentPage.idname and parentPage.idname=="page_news" %}
{% set href = toolkit_route_localizer.generate('news_list', {}, app.request.locale) %}
<div class="object__nav container">
<a href="{{href}}" class="object__nav__button">{{arrowObjectPrev(('T_HOME_NEWS')|trans({}, 'openform_front', app.request.locale))}}{{ ('T_HOME_NEWS')|trans({}, 'openform_front', app.request.locale) }}</a>
</div>
{% endif %}
{% endblock %}