templates/Pages/EventsDirectusPage/page.html.twig line 1

Open in your IDE?
  1. {% extends 'Layout/layout.html.twig' %}
  2. {% block title %}
  3.     {{ event.name }} - {{ parent() }}
  4. {% endblock %}
  5. {% block content %}
  6. <div class="events-overview events-page">
  7.     <div class="hidden message__no-items">
  8.         {{ 'events.message.no_items'|trans }}
  9.     </div>
  10.     <div class="page-header">
  11.         {% set img = (event.background_img_url) ? event.background_img_url | first : null %}
  12.         {% if img is null %}
  13.             {% set img = {
  14.                 'cropping' : null,
  15.                 'media' : {
  16.                     'url' : get_default_article_image(),
  17.                 },
  18.                 'mediaAlt' : 'Gdyńskie Centrum Sportu'
  19.             }
  20.             %}
  21.         {% endif %}
  22.         {% if img is not null and img is not empty %}
  23.             {% set fullSrc = croppedImgSrc(event.background_img_url, { w: 1920, q: 80 }) %}
  24.             <img class="lazy"
  25.                  src="{{ event.background_img_url }}"
  26.                  {% if event.background_img_alt %} alt="{{ event.background_img_alt }}"{% endif %} />
  27.         {% endif %}
  28.     </div>
  29.     {# Breadcrumbs #}
  30.     <section class="content">
  31.         <nav class="breadcrumb">
  32.             <a href="/{{ lang }}" class="breadcrumb__item breadcrumb__item--home">
  33.                 Start
  34.             </a>
  35.             <i class="fas fa-chevron-right"></i>
  36.             <a href="/{{ lang }}/{{ slug }}" class="breadcrumb__item">
  37.                 Kalendarz
  38.             </a>
  39.             <i class="fas fa-chevron-right"></i>
  40.             <span class="breadcrumb__item breadcrumb__item--current">
  41.                {{ event.name }}
  42.             </span>
  43.         </nav>
  44.     </section>
  45.     <div class="content">
  46.     </div>
  47.     <div class="content row">
  48.         <article class="blog-item col-lg-9">
  49.             <header class="blog-item__head">
  50.                 <h2 class="blog-item__head__title simple" role="heading" aria-level="2">
  51.                     {{ event.name }}
  52.                 </h2>
  53.                 <time class="blog-item__head__meta">
  54.                     {% if event.startDate is defined and event.startDate %}
  55.                         {{ event.startDate | date("d.m.Y (H:i)")}}
  56.                     {% endif %}
  57.                     {% if event.endDate is defined and event.endDate and event.endDate != event.startDate %}
  58.                         {% if event.startDate is defined and event.startDate %}
  59.                             -
  60.                         {% endif %}
  61.                         {{ event.endDate | date("d.m.Y (H:i)")}}
  62.                         ; Najbliższe wydarzenie: {{ event.nearestDate | date("d.m.Y (H:i)") }}
  63.                     {% endif %}
  64.                 </time>
  65.                 <div class="events-box__place">
  66.                     {% for place in event.places %}
  67.                         {% if place.name is defined and place.name is not empty %}
  68.                             <p>
  69.                                 {{ place.name }}
  70.                                 {% if place.address is defined and place.address is not empty %} <span class="events-box__address">({{ place.address }})</span>{% endif %}
  71.                             </p>
  72.                         {% endif %}
  73.                     {% endfor %}
  74.                 </div>
  75.             </header>
  76.             {% if page.summary is defined and page.summary is not empty %}<p class="blog-item--summary">{{ page.summary }}</p>{% endif %}
  77.             {{ event.content | raw }}
  78.             {% if event.buttons is not empty %}
  79.                 {% for button in event.buttons %}
  80.                     <p class="btn-pp btn-pp--block">
  81.                         <a href="{{ button.url }}" class="btn btn--primary btn--center"
  82.                                 {% if button.new_window == "1" %} target="_blank" rel="noopener"{% endif %}>
  83.                             {{ button.label }}
  84.                         </a>
  85.                     </p>
  86.                 {% endfor %}
  87.             {% endif %}
  88.             {% if event.youtubes is not empty %}
  89.                 {% for youtube in event.youtubes %}
  90.                     <div class="video-pp">
  91.                         {% set videoImage = asset('frontend/img/general/video-pp--default.svg') %}
  92.                         {% set imageType = 'jpg' %}
  93.                         {% set videoEmbedUrl = "//www.youtube.com/embed/" ~ youtube.code %}
  94.                         <div class="videolink">
  95.                             <a href="{{ videoEmbedUrl }}" target="_blank" rel="noopener" class="js-videolink-play-link videolink__video-link" data-video-provider="youtube" data-video-id="{{ youtube.code }}" data-make-fluid="true">
  96.                                 <i class="videolink__video-link__icon icon icon--play"></i>
  97.                                 <img class="video-pp__link__img" src="{{ 'https://i.ytimg.com/vi/' ~ youtube.code ~ '/maxresdefault.jpg' }}" alt="">
  98.                             </a>
  99.                             <div class="js-videolink-container videolink__video-container"></div>
  100.                         </div>
  101.                         {% if youtube.description %}
  102.                             <div class="video-pp__caption">
  103.                                 <p class="video-pp__caption__text">{{ youtube.description }}</p>
  104.                             </div>
  105.                         {% endif %}
  106.                     </div>
  107.                 {% endfor %}
  108.             {% endif %}
  109.             <a href="{{ path('gcs_api_directus_events_ics') }}?event_id={{ event.id }}" class="btn btn--secondary">{{ 'events.add-to-calendar'|trans }}</a>
  110.             <div class="fb-share-button" data-href="{{ app.request.uri }}" data-layout="button" data-size="large"><a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u={{ app.request.uri }}&amp;src=sdkpreparse" class="fb-xfbml-parse-ignore">Udostępnij</a></div>
  111.         </article>
  112.         <div class="latest-news col-lg-3">
  113.             <h2 role="heading" aria-level="2">{{ 'events.latest_events.read-more' | trans }}</h2>
  114.             {{ render_esi(controller('App\\Controller\\EventsDirectusController:lastEvents', { 'limit' :  3, 'sports' : event.sportsIds, 'slug' : slug } )) }}
  115.             <div class="text--right">
  116.                 {% set sportsList = "" %}
  117.                 <a href="/{{ lang }}/{{ slug }}" class="btn btn--blue">{{ 'events.latest_events.read-more' | trans }}</a>
  118.             </div>
  119.         </div>
  120.     </div>
  121. </div>
  122. {% endblock %}