templates/blocks/previews-from-controller/preview-agenda-logic.html.twig line 1

Open in your IDE?
  1. <div class="preview-container br8 dflex fdc agenda">
  2.     <div class="preview-header">
  3.         {% if img is defined and img is not empty %}
  4.             {% include "blocks/previews/img/image.html.twig" %}
  5.         {% else %}
  6.             {% include "blocks/previews/img/default-image.html.twig" %}
  7.         {% endif %}
  8.         {% if date is defined and date is not empty %}
  9.             {% set day = date|format_date(locale='fr')|split(' ')[0] %}
  10.             {% set month = date|format_date(locale='fr')|split(' ')[1]|capitalize %}
  11.             {% set year = date|format_date(locale='fr')|split(' ')[2] %}
  12.             <div class="agenda-date dflex fdc aic br6 fs20 lh20 corange shadow-small">
  13.                 <span>{{ day }}</span>
  14.                 <span>{{ month }}</span>
  15.                 <span class="fs12 lh16 fw400">{{ year }}</span>
  16.             </div>
  17.         {% endif %}
  18.         {% if event_type is defined and event_type is not empty %}
  19.             {% set text = "" %}
  20.             {% if event_type == "presentiel" %}
  21.                 {% set text = "PrĂ©sentiel" %}
  22.             {% else %}
  23.                 {% set text = "Distanciel" %}
  24.             {% endif %}
  25.             <div class="agenda-type lh20 fs14 shadow-small">{{ text }}</div>
  26.         {% endif %}
  27.         <div class="background-color-orange"></div>
  28.     </div>
  29.     <div class="preview-content cwhite">
  30.         <a href="{{ url }}" class="cblue nodeco dblock {{ title_lines }} ">
  31.             <div class="fw500 fs20 preview-h3 {{ title_lines }} lh28 cwhite">{{ title }}</div>
  32.         </a>
  33.         {% include "blocks/previews-from-controller/blocks/categories.html.twig" %}
  34.         {% 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" } %}
  35.         {% if date is defined and date is not empty %}
  36.             <div class="date dflex aic">
  37.                 {% set dateArray = date|format_datetime('full', 'full', locale='fr')|split(' ') %}
  38.                 <img src="/resources/img/agenda/calendar-icon.svg" alt="Calendar" width="21" height="20">
  39.                 {{ dateArray[0]|capitalize ~ " " ~ dateArray[1] ~ " " ~ dateArray[2]|capitalize ~ " " ~ dateArray[3] }}
  40.             </div>
  41.         {% endif %}
  42.         {% if time is defined and date is not empty %}
  43.             <div>
  44.                 <span class="time diflex aic">
  45.                     <img src="/resources/img/agenda/clock-icon.svg" alt="Agenda" width="17" height="16">
  46.                     {{ time }}
  47.                 </span>
  48.                 {% if price is defined and price is not empty %}
  49.                     <span class="price diflex aic"><img src="/resources/img/agenda/cash-icon.svg" alt="Prix" width="17" height="12">{{ price }}€</span>
  50.                 {% endif %}
  51.             </div>
  52.         {% endif %}
  53.         {% if chapo is defined and chapo is not empty %}
  54.             <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 %}">
  55.                 {{ chapo|striptags|raw }}
  56.             </div>
  57.             {% if chapo|length > 200 %}
  58.                 <a href="{{ sulu_content_path(url) }}" class="cwhite">Lire la suite</a>
  59.             {% endif %}
  60.         {% endif %}
  61.     </div>
  62. </div>