{% set page = _parent.entity %}
{% set lastPosts = get_posts(6, 1, null) %}
{% set actualPostId = page.post.id %}
{% set settings = get_settings_data() %}
{% set categories = page.post.categories.toArray|default([]) %}
{% set countCategories = categories|length %}
{% set blogUrl = get_blog_url(app.request.locale|default('pl')) %}
<section class="parent-container container-fluid py-5">
<div class="row justify-content-around pb-5">
<div class="col-lg-8 col-xl-7 col-xxl-6 blog-content">
<p class="text-center">
{% for postCategory in categories %}
{% if postCategory.category.page.isPublished|default(false) %}
{% set categoryId = postCategory.category.id|default(null) %}
{% set category = categoryId is null ? '' : ('?category=' ~ categoryId) %}
<a href="{{ blogUrl ~ category|default('#') }}">{{ postCategory.category.translations.pl.categoryName|default('') }}</a>
{% else %}
{{ postCategory.category.translations.pl.categoryName|default('') }}
{% endif %}
{% endfor %}
</p>
<h1 class="my-3 text-center f-48 fw-bold">{{ section.translations.pl.title|default(null) is null ? page.post.translations.pl.head|default('') : section.translations.pl.title|default('') }}</h1>
<p class="text-center">{{ date_format(section.createdAt|default(null)) }}</p>
<div class="row justify-content-center mt-3 mb-5">
<div class="col-xxl-8 col-xl-8 col-lg-7 col-12 col-sm-5 px-xxl-0">
<div class="zoom"><img src="{{ section.image.fileName|default(null) is null ? (CONST_IMAGE_URL ~ page.post.postPreview.fileName|default(''))|imagine_filter('full') : (CONST_IMAGE_URL ~ section.image.fileName|default(''))|imagine_filter('full') }}" alt=""></div>
</div>
</div>
{{ section.translations.pl.htmlContents.first|default('')|raw }}
</div>
<div class="col-lg-4 col-xl-3 col-xxl-2 blog-search py-4 text-center pb-5">
<div class="blog-text-sticky pt-5 mt-5">
<div class="d-flex search-wrapper mx-auto">
<input type="search" placeholder="wyszukaj" class="bg-grey" id="searchPhrase">
<button type="submit" class="loupe bg-grey relative-loupe" id="searchBtn">
<img src="{{ asset('assets/img/lupa-icon.svg') }}" alt="">
</button>
</div>
{% if lastPosts.items|length > 1 %}
<p class="fw-bold f-30 mt-5 pb-0">ostatnie wpisy</p>
{% endif %}
{% set i = 0 %}
{% for post in lastPosts.items %}
{% if actualPostId != null and actualPostId != post.id and i < 5 %}
<p>
<a href="{{ post.page.url|default }}">{{ post.translations.pl.head|default }}</a>
</p>
{% set i = i + 1 %}
{% endif %}
{% endfor %}
<div class="text-center mt-4">
<a href="{{ blogUrl|default('#') }}" class="btn btn-dark btn-sm">czytaj więcej</a>
</div>
{% if settings is not null %}
{% if settings.instagram is not null and settings.instagram != '' %}
<div class="position-relative insta-container">
<p class="text-uppercase text-end pb-0 follow-us">follow us</p>
<a href="{{ settings.instagram|default('#') }}" target="blank"><img src="{{ asset('assets/img/instagram.svg') }}" alt="" class="instagram"></a>
</div>
{% endif %}
{% endif %}
</div>
</div>
</div>
</section>
{% include 'front/blocks/blog/block_content_menu.twig' %}
{% include 'front/blocks/blog/block_content_bottom_proposition.twig' %}