{% if articleContent.place_text is defined and articleContent.place_text is not empty %}
{% set place_text = articleContent.place_text %}
{% endif %}
{% if articleContent.place_link is defined and articleContent.place_link is not empty %}
{% set place_link = articleContent.place_link %}
{% endif %}
{% if articleContent.time is defined and articleContent.time is not empty %}
{% set heure = articleContent.time %}
{% endif %}
{% if articleContent.date is defined and articleContent.date is not empty %}
{% set date = articleContent.date %}
{% endif %}
{% if articleContent.endDate is defined and articleContent.endDate is not empty %}
{% set enddate = articleContent.endDate %}
{% endif %}
{% if articleContent.price is defined and articleContent.price is not empty %}
{% set price = articleContent.price %}
{% endif %}
{% if articleContent.event_type is defined and articleContent.event_type is not empty %}
{% set type = articleContent.event_type %}
{% endif %}
{% if articleContent.header_img is defined and articleContent.header_img is not empty %}
{% set img = articleContent.header_img %}
{% endif %}
{% if articleContent.chapo.value is defined and articleContent.chapo.value is not empty %}
{% set chapo = articleContent.chapo.value %}
{% endif %}
{% set color = "" %}
{% if color_agenda is defined and color_agenda == "to_be_white" %}{% set color = color_agenda %}{% endif %}
<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 type is defined and type is not empty %}
{% if type == "presentiel" %}
{% set typeString = "Présentiel" %}
{% else %}
{% set typeString = "Distanciel" %}
{% endif %}
<div class="agenda-type pabsolute fw400 fs14 lh20">
{{ typeString }}
</div>
{% endif %}
</div>
<div class="preview-content dflex fdc w100 {{ color }}">
{% include "blocks/previews-from-controller/blocks/categories.html.twig" %}
<a href="{{ sulu_content_path(routePath) }}" class="cblack nodeco {{ color }}">
<div class="fw500 fs20 preview-h3 lh28">{{ title }}</div>
</a>
{% if chapo is defined and chapo is not empty %}
<div class="lh24 preview-chapo">{{ chapo|striptags|raw }}</div>
{% endif %}
{% include "blocks/previews-from-controller/blocks/place.html.twig" with { placeholder: articleContent, api: true } %}
<div class="timeanddate dflex fwwrap">
{% if date is defined and date is not empty %}
<div class="time dflex">
<img src="/resources/img/aapami/calendar-icon.svg" alt="Date" width="16" height="16">
{{ date|format_datetime("full", "none")|capitalize }}{% if enddate is defined and enddate is not empty and enddate != date %} au {{ enddate|format_datetime("full", "none") }}{% endif %}
</div>
{% endif %}
{% if heure is defined and heure is not empty %}
<div class="time dflex"><img src="/resources/img/clock-icon.svg" alt="Heure" width="17" height="16">{{ heure }}</div>
{% endif %}
</div>
{% if price is defined and price is not empty %}
<div class="price dflex"><img src="/resources/img/cash-icon.svg" alt="Prix" width="17" height="12">{{ price > 0 ? price ~ ' €' : 'Gratuit' }}</div>
{% endif %}
</div>