{% extends 'Nordinfo/Main/base.html.twig' %}
{% set show_btt = true %}
{% block title %}{{ post.title }} - Nord Info{% endblock %}
{% if post.dateDebut is defined and post.dateDebut != null %}
{% set date_segments = post.dateDebut | split('/') %}
{% set date = date_segments[1] ~ '/' ~ date_segments[0] ~ '/' ~ date_segments[2] %}
{% else %}
{% set date = "" %}
{% endif %}
{% if post.dateFin is defined and post.dateFin != null %}
{% set date_segmentss = post.dateFin | split('/') %}
{% set date_fin = date_segmentss[1] ~ '/' ~ date_segmentss[0] ~ '/' ~ date_segmentss[2] %}
{% else %}
{% set date_fin = "" %}
{% endif %}
{% if referer is not null %}
{% set url_back = referer %}
{% else %}
{% set url_back = path('info') %}
{% endif %}
{% set main_type = "folder" %}
{% block header_epingles %}
{{ include('Lenord/Main/parts/epingles.html.twig') }}
{% endblock %}
{% block header_breadcrumb %}
{{ include('Nordinfo/Main/parts/breadcrumb.html.twig') }}
{% endblock %}
{% block body %}
<main role="main" class="mainContent pt-0" id="mainContent" tabindex="-1">
{% include 'Nordinfo/Main/parts/back_btn.html.twig' with {'back_btn_class':''} %}
<div class="headerBanner {% if placement_image|default %}{{ placement_image }}{% endif %} {% if post.type.type == 'folder' %}--pageDetails{% endif %}" {% if post.illustrationdetailName is null %} style="background-image: url('{{ asset('upload/images/'~post.illustrationfilName) | imagine_filter('banner_full_width') }}')" {% else %} style="background-image: url('{{ asset('upload/images/'~post.illustrationdetailName) | imagine_filter('banner_full_width') }}')" {% endif %}></div>
<div style="background-color: {{ post.palettecouleur.getCodeHexa() }};" class="pb-5 mb-5">
<div class="container containerPostDetails {% if post.type.type == 'folder' %}--pageDetails --pageFolder{% endif %}">
<article class="pt-5">
<p class="text-center fsXs">
<span class="__date">{{ date|format_datetime('none', 'none', 'fr_FR', null, "d MMMM Y") }}</span>
<span class="lsMd ttUppercase">
{% if post.topics|length > 1 %}{% for top in post.topics %}{% if loop.index != 1 %}, {% endif %}{{ top.displayName }}{% endfor %}
{% else %}{% for top in post.topics %}{{ top.displayName }}{% endfor %}{% endif %}
{% if post.territories|length > 0 and post.topics|length > 0 %}<span class="separator">|</span>{% endif %}
{% if post.territories|length > 1 %}{% for t in post.territories %}{% if loop.last == false and post.territories|length > 1 %}{{ t.displayName ~", " }}{% else %}{{ t.displayName }}{% endif %}{% endfor %}
{% else %}{% for t in post.territories %}{{ t.displayName }}{% endfor %}{% endif %}
</span>
</p>
<h1 class="text-center">{{ post.title }}</h1>
{% if post.subtitle|length > 0 %}<p class="__subtitle">{{ post.subtitle }}</p>{% endif %}
{% if post.chapo|length > 0 %}<p class="__chapo">{{ post.chapo }}{% if post.url1|length > 0 %}<br><a href="{{ post.url1 }}" target="_blank" class="_external"><span>{{ post.link1 }}</span></a>{% endif %}</p>{% endif %}
<div class="containerContent mb-2">{{ content_post|raw }}</div>
{% if false %}
{% if post.credits is not null %}
<p class="text-secondary font-italic fontWeightMedium fsXs">Crédits photo :
{{ post.credits }}
</p>
{% endif %}
{% endif %}
</article>
</div>
</div>
<div class="container _masonry">
<div class="gridMasonry" id="gridMasonry">
<div class="grid-sizer"></div>
{% for post in related_posts|sort((a, b) => a.orderFolder <=> b.orderFolder) %}
{{ include('Nordinfo/Main/parts/item_list_related_folder.html.twig') }}
{% endfor %}
</div>
</div>
<div style="padding-bottom:200px;"></div>
</main>
{% endblock %}