{% extends 'Layout/layout.html.twig' %}
{% block title %}
{{ event.name }} - {{ parent() }}
{% endblock %}
{% block content %}
<div class="events-overview events-page">
<div class="hidden message__no-items">
{{ 'events.message.no_items'|trans }}
</div>
<div class="page-header">
{% set img = (event.background_img_url) ? event.background_img_url | first : null %}
{% if img is null %}
{% set img = {
'cropping' : null,
'media' : {
'url' : get_default_article_image(),
},
'mediaAlt' : 'Gdyńskie Centrum Sportu'
}
%}
{% endif %}
{% if img is not null and img is not empty %}
{% set fullSrc = croppedImgSrc(event.background_img_url, { w: 1920, q: 80 }) %}
<img class="lazy"
src="{{ event.background_img_url }}"
{% if event.background_img_alt %} alt="{{ event.background_img_alt }}"{% endif %} />
{% endif %}
</div>
{# Breadcrumbs #}
<section class="content">
<nav class="breadcrumb">
<a href="/{{ lang }}" class="breadcrumb__item breadcrumb__item--home">
Start
</a>
<i class="fas fa-chevron-right"></i>
<a href="/{{ lang }}/{{ slug }}" class="breadcrumb__item">
Kalendarz
</a>
<i class="fas fa-chevron-right"></i>
<span class="breadcrumb__item breadcrumb__item--current">
{{ event.name }}
</span>
</nav>
</section>
<div class="content">
</div>
<div class="content row">
<article class="blog-item col-lg-9">
<header class="blog-item__head">
<h2 class="blog-item__head__title simple" role="heading" aria-level="2">
{{ event.name }}
</h2>
<time class="blog-item__head__meta">
{% if event.startDate is defined and event.startDate %}
{{ event.startDate | date("d.m.Y (H:i)")}}
{% endif %}
{% if event.endDate is defined and event.endDate and event.endDate != event.startDate %}
{% if event.startDate is defined and event.startDate %}
-
{% endif %}
{{ event.endDate | date("d.m.Y (H:i)")}}
; Najbliższe wydarzenie: {{ event.nearestDate | date("d.m.Y (H:i)") }}
{% endif %}
</time>
<div class="events-box__place">
{% for place in event.places %}
{% if place.name is defined and place.name is not empty %}
<p>
{{ place.name }}
{% if place.address is defined and place.address is not empty %} <span class="events-box__address">({{ place.address }})</span>{% endif %}
</p>
{% endif %}
{% endfor %}
</div>
</header>
{% if page.summary is defined and page.summary is not empty %}<p class="blog-item--summary">{{ page.summary }}</p>{% endif %}
{{ event.content | raw }}
{% if event.buttons is not empty %}
{% for button in event.buttons %}
<p class="btn-pp btn-pp--block">
<a href="{{ button.url }}" class="btn btn--primary btn--center"
{% if button.new_window == "1" %} target="_blank" rel="noopener"{% endif %}>
{{ button.label }}
</a>
</p>
{% endfor %}
{% endif %}
{% if event.youtubes is not empty %}
{% for youtube in event.youtubes %}
<div class="video-pp">
{% set videoImage = asset('frontend/img/general/video-pp--default.svg') %}
{% set imageType = 'jpg' %}
{% set videoEmbedUrl = "//www.youtube.com/embed/" ~ youtube.code %}
<div class="videolink">
<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">
<i class="videolink__video-link__icon icon icon--play"></i>
<img class="video-pp__link__img" src="{{ 'https://i.ytimg.com/vi/' ~ youtube.code ~ '/maxresdefault.jpg' }}" alt="">
</a>
<div class="js-videolink-container videolink__video-container"></div>
</div>
{% if youtube.description %}
<div class="video-pp__caption">
<p class="video-pp__caption__text">{{ youtube.description }}</p>
</div>
{% endif %}
</div>
{% endfor %}
{% endif %}
<a href="{{ path('gcs_api_directus_events_ics') }}?event_id={{ event.id }}" class="btn btn--secondary">{{ 'events.add-to-calendar'|trans }}</a>
<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 }}&src=sdkpreparse" class="fb-xfbml-parse-ignore">Udostępnij</a></div>
</article>
<div class="latest-news col-lg-3">
<h2 role="heading" aria-level="2">{{ 'events.latest_events.read-more' | trans }}</h2>
{{ render_esi(controller('App\\Controller\\EventsDirectusController:lastEvents', { 'limit' : 3, 'sports' : event.sportsIds, 'slug' : slug } )) }}
<div class="text--right">
{% set sportsList = "" %}
<a href="/{{ lang }}/{{ slug }}" class="btn btn--blue">{{ 'events.latest_events.read-more' | trans }}</a>
</div>
</div>
</div>
</div>
{% endblock %}