{% if jpos is defined and jpos is not empty %}
<div class="block-jpo-une">
{% if type == 'home' %}
{#<h2>JOURNÉES PORTES OUVERTES</h2>#}
<div class="dropdown jpo-month" data-bs-display="static">
<div class="dropdown-toggle" type="button" id="dropdownMenuButton" data-bs-toggle="dropdown" aria-expanded="false">
Période : <a href="{{ path('jpo-liste')}}#{{ jpos[0].date | date('n') }}" class="scroll-month">{{jpos[0].date | format_date(pattern='MMMM Y') }}</a>
</div>
<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton">
{% for jpo in jpos %}
{% if loop.first %}
{% set previous_jpo = jpo %}
{% else %}
{% set previous_jpo = jpos[loop.index0 - 1] %}
{% endif %}
{% if loop.last %}
{% set next_jpo = jpo %}
{% else %}
{% set next_jpo = jpos[loop.index0 + 1] %}
{% endif %}
{% if jpo.date | date('m') != previous_jpo.date | date('m') or previous_jpo == jpo %}
{% for month in 1..12 %}
{% if jpo.date | date('n') == month %}
<li><a href="{{ path('jpo-liste')}}#{{ jpo.date | date('n') }}" class="dropdown-item scroll-month">{{jpo.date | format_date(pattern='MMMM Y') }}</a></li>
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
</ul>
</div>
{% else %}
<h2 class="mb-4">À LA UNE</h2>
{% endif %}
<div class="position-relative">
<div class="overflow-visible">
<span id="jpo-next" class="next-slide-jpo"></span>
<span id="jpo-prev" class="prev-slide-jpo"></span>
<div class="jpo-une d-none d-md-block d-lg-block">
{% for jpo in jpos %}
{% if loop.index == 1 or loop.index == 4 or loop.index == 7 %}
<div class="slide-jpo w-100">
{% endif %}
<article class="jpo position-relative">
<div class="w-100 d-flex justify-content-center mb-2">
<div class="icon"></div>
</div>
{% if jpo.etablissement.jpoPlus == 1 %}
<span class="badge-plus-jpo"></span>
{% endif %}
<figure class="resize">
{% set imgSrc = vich_uploader_asset(jpo.etablissement.logo, 'logoFile') %}
{% if imgSrc %}
<img loading="lazy" src="{{ vich_uploader_asset(jpo.etablissement.logo, 'logoFile') | imagine_filter('etab_hp_logo') }}" alt="{{ jpo.lieu }}" title="{{ jpo.etablissement.denomination }}">
{#<img loading="lazy" class="resp" src='{{imgSrc}}' alt='{{jpo.lieu}}' width='140' height='140'/>#}
{% endif %}
{#{% elseif jpo.etablissement.imagesDiaporama is not empty %}
<img
loading="lazy"
src="{{ asset('images/jouve/photo/' ~ jpo.etablissement.imagesDiaporama | first) | imagine_filter('etab_fiche')}}"
class="resp"
alt="{{ jpo.lieu }}"
title="{{ jpo.lieu }}">
{% endif %}#}
</figure>
<div class="content">
<p class="date">{{jpo.date | format_date(pattern='d MMMM Y') }}</p>
{#<p class="city">{{jpo.lieu | u.truncate(30, '…', true)}}</p>#}
<p class="city">{{ jpo.etablissement.ville|lieuLibelle }}</p>
<p class="estab">{{ jpo.etablissement.denomination | u.truncate(50, '…', true)}}</p>
</div>
<a class="see-more" href="{{ path('jpo-etab', {'id': jpo.id}) }}" data-trace-action="{{ constant('App\\Entity\\Trace::JPO') | e('html_attr') }}" data-trace-etab="{{ jpo.etablissement.id | e('html_attr') }}">Découvrir</a>
</article>
{% if loop.index == 3 or loop.index == 6 or loop.last %}
</div>
{% endif %}
{% endfor %}
</div>
<div class="jpo-une d-block d-md-none d-lg-none">
{% for jpo in jpos %}
<div class="slide-jpo w-100">
<article class="jpo position-relative">
<div class="w-100 d-flex justify-content-center">
<div class="icon"></div>
</div>
{% if jpo.etablissement.jpoPlus == 1 %}
<span class="badge-plus-jpo"></span>
{% endif %}
<figure class="resize">
{% set imgSrc = vich_uploader_asset(jpo.etablissement.logo, 'logoFile') %}
{% if imgSrc %}
<img loading="lazy" class="resp" src='{{imgSrc}}' alt='{{jpo.lieu}}' width='140' height='140'/>
{#{% elseif jpo.etablissement.imagesDiaporama is not empty %}
<img
loading="lazy"
class="resp"
src="{{ asset('images/jouve/photo/' ~ (jpo.etablissement.imagesDiaporama | first) ) | imagine_filter('etab_fiche')}}"
alt="{{ jpo.lieu }}"
title="{{ jpo.lieu }}">#}
{% endif %}
</figure>
<div class="content">
<p class="date">{{jpo.date | format_date(pattern='d MMMM Y') }}</p>
{#<p class="city">{{jpo.lieu | u.truncate(30, '…', true)}}</p>#}
<p class="city">{{ jpo.etablissement.ville|lieuLibelle }}</p>
<p class="estab">{{ jpo.etablissement.denomination | u.truncate(50, '…', true)}}</p>
</div>
<a class="see-more" href="{{ path('jpo-etab', {'id': jpo.id}) }}" data-trace-action="{{ constant('App\\Entity\\Trace::JPO') | e('html_attr') }}" data-trace-etab="{{ jpo.etablissement.id | e('html_attr') }}">Découvrir</a>
</article>
</div>
{% endfor %}
</div>
</div>
</div>
{% if type == 'home' %}
<div class="all-day">
<a href="{{ path('jpo-liste')}}" class="btn-gris">Toutes les journées portes ouvertes</a>
</div>
{% endif %}
</div>
{% endif %}