templates/Events/viewdirectus.html.twig line 1

Open in your IDE?
  1. <div class="events-boxes row">
  2.     {% for event in events %}
  3.             <article class="events-box col-sm-4">
  4.                 <a href="{{ path('_slug') ~ '/' ~ slug ~ '/' ~ event.url }}">
  5.                     <div class="events-box__img">
  6.                         {% if event.header_img_url and event.header_img_url is not empty %}
  7.                             {% set img = event.header_img_url %}
  8.                         {% elseif event.background_img_url and event.background_img_url is not empty %}
  9.                             {% set img = event.background_img_url %}
  10.                         {% else %}
  11.                             {% set img = {
  12.                                 'cropping' : null,
  13.                                 'media' : {
  14.                                     'url' : get_default_article_image(),
  15.                                 },
  16.                                 'mediaAlt' : 'GdyƄskie Centrum Sportu'
  17.                             } %}
  18.                         {% endif %}
  19.                         {% set fullSrc = null %}
  20.                         {% set previewSrc = null %}
  21.                         {% if img is defined and img is iterable and img.media is defined and img.media is not empty %}
  22.                             {% set fullSrc = croppedImgSrc(img.media.url, img.cropping, { w: 450, h: 300, q: 80 }) %}
  23.                             {% set img = croppedImgSrc(img.media.url, img.cropping, jml_img_large.preview) %}
  24.                         {% endif %}
  25.                             <img class="lazy" src="{{ img }}" {% if fullSrc is not null %}data-src="{{ fullSrc }}"{% endif %}
  26.                                  alt="{% if event.header_img_alt %}{{ event.header_img_alt }}{% else %}{{ event.name | striptags }}{% endif %}"/>
  27.                     </div>
  28.                     <div class="events-box__description">
  29.                         <div class="events-box__caption">
  30.                             <h3 role="heading" aria-level="3">{{ event.name }}</h3>
  31.                         </div>
  32.                         <div class="events-box__place">
  33.                             {% for place in event.places %}
  34.                                 {% if place.name is defined and place.name is not empty %}
  35.                                     <p>
  36.                                         {{ place.name }}
  37.                                         {% if place.address is defined and place.address is not empty %} <span
  38.                                                 class="events-box__address">({{ place.address }})</span>{% endif %}
  39.                                     </p>
  40.                                 {% endif %}
  41.                             {% endfor %}
  42.                         </div>
  43.                     </div>
  44.                     <div class="events-box__date">
  45.                         <time datetime="{{ event.nearestDate | date("d.m.Y H:i") }}">{{ event.nearestDate | date("d.m.Y H:i") }}</time>
  46.                     </div>
  47.                 </a>
  48.             </article>
  49.     {% endfor %}
  50. </div>