<div class="preview-container br8 dflex fdc agenda">
<div class="preview-header">
{% if img is defined and img is not empty %}
{% include "blocks/previews/img/image.html.twig" %}
{% else %}
{% include "blocks/previews/img/default-image.html.twig" %}
{% endif %}
{% if date is defined and date is not empty %}
{% set day = date|format_date(locale='fr')|split(' ')[0] %}
{% set month = date|format_date(locale='fr')|split(' ')[1]|capitalize %}
{% set year = date|format_date(locale='fr')|split(' ')[2] %}
<div class="agenda-date dflex fdc aic br6 fs20 lh20 corange shadow-small">
<span>{{ day }}</span>
<span>{{ month }}</span>
<span class="fs12 lh16 fw400">{{ year }}</span>
</div>
{% endif %}
{% if event_type is defined and event_type is not empty %}
{% set text = "" %}
{% if event_type == "presentiel" %}
{% set text = "Présentiel" %}
{% else %}
{% set text = "Distanciel" %}
{% endif %}
<div class="agenda-type lh20 fs14 shadow-small">{{ text }}</div>
{% endif %}
<div class="background-color-orange"></div>
</div>
<div class="preview-content cwhite">
<a href="{{ url }}" class="cblue nodeco dblock {{ title_lines }} ">
<div class="fw500 fs20 preview-h3 {{ title_lines }} lh28 cwhite">{{ title }}</div>
</a>
{% include "blocks/previews-from-controller/blocks/categories.html.twig" %}
{% include "blocks/previews-from-controller/blocks/place.html.twig" with { place_select: hit.place_select, place_link: hit.place_link, place_text: hit.place_text, color: "blue" } %}
{% if date is defined and date is not empty %}
<div class="date dflex aic">
{% set dateArray = date|format_datetime('full', 'full', locale='fr')|split(' ') %}
<img src="/resources/img/agenda/calendar-icon.svg" alt="Calendar" width="21" height="20">
{{ dateArray[0]|capitalize ~ " " ~ dateArray[1] ~ " " ~ dateArray[2]|capitalize ~ " " ~ dateArray[3] }}
</div>
{% endif %}
{% if time is defined and date is not empty %}
<div>
<span class="time diflex aic">
<img src="/resources/img/agenda/clock-icon.svg" alt="Agenda" width="17" height="16">
{{ time }}
</span>
{% if price is defined and price is not empty %}
<span class="price diflex aic"><img src="/resources/img/agenda/cash-icon.svg" alt="Prix" width="17" height="12">{{ price }}€</span>
{% endif %}
</div>
{% endif %}
{% if chapo is defined and chapo is not empty %}
<div class="lh24 preview-chapo {% if categories is defined and categories is not empty and categories|length == 2 %} threelines{% endif %}{% if categories is defined and categories is not empty and categories|length == 3 %} twolines{% endif %}">
{{ chapo|striptags|raw }}
</div>
{% if chapo|length > 200 %}
<a href="{{ sulu_content_path(url) }}" class="cwhite">Lire la suite</a>
{% endif %}
{% endif %}
</div>
</div>