{% extends "@openform_front_templates/base.html.twig" %}
{% block bodyAttr %}data-page="detail-page"{% endblock %}
{% block contentClass %}{{entity.menuVariant is defined and entity.menuVariant ? 'header-mak' : ''}}{% 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,'list') : '' %}
{% block header %}
{% include "@openform_front_templates/_includes/_header_mak.html.twig" with {'langLinks' : (langLinks is defined ? langLinks), item : entity} %}
{% endblock %}
{% block content %}
{% set mobile = openform_front_util.isMobileDevice() %}
{% if mobile %}
{% if rootParent.isExhibition is defined %}
{% set href = toolkit_route_localizer.generate('exhibition_item', { 'slug': rootParent.Translation[app.request.locale].slug}, app.request.locale) %}
{% elseif rootParent.isMak is defined %}
{% set href = toolkit_route_localizer.generate('mak_item', {'makSlug': rootParent.getMakSlug(app.request.locale), 'slug': rootParent.Translation[app.request.locale].slug}, app.request.locale) %}
{% endif %}
{% if href is defined %}
<a href="{{href}}" class="index-news__title--mobile-mak">{{rootParent.Translation[app.request.locale].titleHtml|raw}}</a>
{% endif %}
{% endif %}
{% if isDepartment == false %}
{% include "@openform_front_templates/_blocks_sections/block.html.twig" with { sections: openform_front_util.getSections(entity)|length > 0 ? openform_front_util.getSections(entity)|slice(0, 1) : '' } %}
{% endif %}
<section class="index-news">
<div class="index-news__wrapper index-news__wrapper--exh index-news__wrapper--museum js-list-data container">
{# ! if entity.isSkipped #}
{% if isDepartment %}
<h1 class="index-news__title index-news__title--mak">{{ entity.Translation[app.request.locale].titleHtml|raw }}</h1>
{% if (entity.Translation[app.request.locale].text is defined and entity.Translation[app.request.locale].text) or (openform_front_util.getImagePathByType(entity.Thumb ?? '', 'detail')) %}
<div class="mak-block block-image block-image--position-left">
<div class="block-image__container">
<div class="block-image__text index-news__text-mak">
{% if entity.Translation[app.request.locale].text is defined %}
<div class="block__text">{{ entity.Translation[app.request.locale].text|raw }}</div>
{% endif %}
</div>
<div class="block-image__image">
{% set img = openform_front_util.getImagePathByType(entity.Thumb ?? '', 'detail') %}
{% if img %}
<img class="block-image__image__img" loading="lazy" src="{{ asset(img) }}" alt="{{ entity.Translation[app.request.locale].alt }}">
{% endif %}
</div>
</div>
</div>
{% endif %}
{% endif %}
{% set departments = entity.getVisibleDepartments(app.request.locale) %}
{% set hideDepartments = true %}
{% for department in departments|filter(department => department.isSkipped == false and department.Parent) %}
{% set hideDepartments = false %}
{% endfor %}
{% set skipDepartments = false %}
{% for key, department in departments %}
{% if department.isSkipped == true and department.AntiqueSuit|length > 0 %}
{% set skipDepartments = true %}
{% endif %}
{% endfor %}
{% if entity.getVisibleDepartments(app.request.locale) is defined and entity.getVisibleDepartments(app.request.locale)|length > 0 and not hideDepartments %}
{% if isDepartment %}
<h1 class="index-news__title index-news__title--mak">{{ 'T_SUBDEPARTMENTS'|trans({}, 'openform_front', app.request.locale) }}</h1>
{% else %}
<h1 class="index-news__title index-news__title--mak">{{ 'T_DEPARTMENTS'|trans({}, 'openform_front', app.request.locale) }}</h1>
{% endif %}
{% endif %}
<div class="index-news__items js-result-content">
{# listowanie działów nie-ukrytych #}
{% for department in departments %}
{% if department.isSkipped == false %}
{% set departmentHref = toolkit_route_localizer.generate('mak_department_item', {'makSlug' : parentPage.Translation[app.request.locale].slug, 'slug' : department.Translation[app.request.locale].slug}, app.request.locale) %}
{% set img = openform_front_util.getImagePathByType(department.Thumb ?? '','list') %}
<a class="news-item news-item--mak" href="{{ departmentHref }}" aria-label="{{ 'T_READ_MORE'|trans({}, 'openform_front', app.request.locale) }} {{ department.Translation[app.request.locale].title }}">
{% if img %}
<img class="news-item__image news-item__image--mak" loading="lazy" src="{{ asset(img) }}" alt="{{ department.Translation[app.request.locale].alt }}">
{% endif %}
<div class="news-item__content">
<h2 class="news-item__title news-item__title--mak">{{ department.Translation[app.request.locale].titleHtml|raw }}</h2>
{#
<div class="news-item__date-wrapper">
<time class="news-item__date">
{{ department.publishDate|explodedDate(app.request.locale).D }}
{{ department.publishDate|explodedDate(app.request.locale).month }}
{{ department.publishDate|explodedDate(app.request.locale).y }}
</time>
</div>
#}
<p class="news-item__text news-item__text--mak">{{ department.Translation[app.request.locale].shortLead }}</p>
</div>
</a>
{% endif %}
{% endfor %}
</div>
{% if entity.getVisibleAntiqueSuits is defined and entity.getVisibleAntiqueSuits(app.request.locale)|length > 0 or skipDepartments %}
{# or skipDepartments #}
<h2 class="index-news__title index-news__title--mak mak__title">{{ 'T_COLLECTIONS'|trans({}, 'openform_front', app.request.locale) }}</h2>
{% elseif not hideDepartments %}
{# <h2 class="index-news__title mak__title mak__title index-news__title--mak">{{ 'T_COLLECTIONS'|trans({}, 'openform_front', app.request.locale) }}</h2> #}
{% else %}
{# <h2 class="{{ 'index-news__title index-news__title--mak' }}">{{ 'T_COLLECTIONS'|trans({}, 'openform_front', app.request.locale) }}</h2> #}
{% endif %}
<div class="mak__items mak__items--small-gap js-result-content">
{# listowanie kolekcji z działu aktualnego #}
{% if entity.getVisibleAntiqueSuits is defined %}
{% set antiqueSuits = entity.getVisibleAntiqueSuits(app.request.locale) %}
{% for antiqueSuit in antiqueSuits %}
{% set antiqueSuitHref = toolkit_route_localizer.generate('antique_suit_item', {'slug' : antiqueSuit.Translation[app.request.locale].slug}, app.request.locale) %}
{% set img = openform_front_util.getImagePathByType(antiqueSuit.Thumb ?? '', 'list') %}
<a class="news-item news-item--mak" href="{{ antiqueSuitHref }}" aria-label="{{ 'T_READ_MORE'|trans({}, 'openform_front', app.request.locale) }} {{ antiqueSuit.Translation[app.request.locale].title }}">
{% if img %}
<img class="news-item__image news-item__image--mak" loading="lazy" src="{{ asset(img) }}" alt="{{ antiqueSuit.Translation[app.request.locale].alt }}">
{% endif %}
<div class="news-item__content">
<h2 class="news-item__title news-item__title--mak">{{ antiqueSuit.Translation[app.request.locale].titleHtml|raw }}</h2>
{#
<div class="news-item__date-wrapper">
<time class="news-item__date">
{{ antiqueSuit.publishDate|explodedDate(app.request.locale).D }}
{{ antiqueSuit.publishDate|explodedDate(app.request.locale).month }}
{{ antiqueSuit.publishDate|explodedDate(app.request.locale).y }}
</time>
</div>
#}
<p class="news-item__text news-item__text--mak">{{ antiqueSuit.Translation[app.request.locale].shortLead }}</p>
</div>
</a>
{% endfor %}
{% endif %}
{# listowanie kolekcji z podrzędnych działów ukrytych #}
{% for key, department in departments %}
{% if department.isSkipped == true %}
{% set antiqueSuits = department.getVisibleAntiqueSuits(app.request.locale) %}
{% for antiqueSuit in department.AntiqueSuit %}
{% set antiqueSuitHref = toolkit_route_localizer.generate('antique_suit_item',{'slug' : antiqueSuit.Translation[app.request.locale].slug}, app.request.locale) %}
{% set img = openform_front_util.getImagePathByType(antiqueSuit.Thumb ?? '', 'list') %}
<a class="news-item news-item--mak" href="{{ antiqueSuitHref }}" aria-label="{{ 'T_READ_MORE'|trans({}, 'openform_front', app.request.locale) }} {{ antiqueSuit.Translation[app.request.locale].title }}">
{% if img %}
<img class="news-item__image news-item__image--mak" loading="lazy" src="{{asset(img)}}" alt="{{ antiqueSuit.Translation[app.request.locale].alt }}">
{% endif %}
<div class="news-item__content">
<h2 class="news-item__title news-item__title--mak">{{ antiqueSuit.Translation[app.request.locale].titleHtml|raw }}</h2>
{#
<div class="news-item__date-wrapper">
<time class="news-item__date">
{{ antiqueSuit.publishDate|explodedDate(app.request.locale).D }}
{{ antiqueSuit.publishDate|explodedDate(app.request.locale).month }}
{{ antiqueSuit.publishDate|explodedDate(app.request.locale).y }}
</time>
</div>
#}
<p class="news-item__text news-item__text--mak">{{ antiqueSuit.Translation[app.request.locale].shortLead }}</p>
</div>
</a>
{% endfor %}
{% endif %}
{% endfor %}
</div>
</div>
</section>
{% if isDepartment %}
{% include "@openform_front_templates/_blocks_sections/block.html.twig" with { sections: openform_front_util.getSections(entity)|length > 0 ? openform_front_util.getSections(entity):''} %}
{% else %}
{% include "@openform_front_templates/_blocks_sections/block.html.twig" with { sections: openform_front_util.getSections(entity)|length > 0 ? openform_front_util.getSections(entity)|slice(1, openform_front_util.getSections(entity)|length) : '' } %}
{% endif %}
{% endblock %}