{% set currentUrl = app.request.attributes.get('_nodeTranslation').url %}
{% set baseRoute = '_slug' ~ (app.request.attributes.get('preview') ? '_preview' : '') %}
{% set basePath = path(baseRoute, { 'url': currentUrl, '_locale': app.request.locale }) %}
{% set categoryContext = get_article_categories(app.request, 'App:NewsCategory') %}{% set tagContext = get_article_tags(app.request, 'App:NewsTag') %}
<div class="news-overview news-page">
{# Page Header #}
{% include 'Layout/_page-header.html.twig' with { 'page' : page } %}
{# Breadcrumbs #}
{% block breadcrumbs %}
{% include 'Layout/_breadcrumbs.html.twig' with { 'refererString' : app.request.get('path') } %}
{% endblock %}
<div class="content">
<h1 role="heading" aria-level="1">{{ page.pageTitle }}</h1>
<div class="blog-filter js-toggle-container">
<div class="blog-filter__top">
{# {% include 'Pages/NewsOverviewPage/_filter-tag.html.twig' with {'tags': tagContext.tags} %}#}
{# {% include 'Pages/NewsOverviewPage/_filter-category.html.twig' with {'categories': categoryContext.categories} %}#}
</div>
<div class="blog-filter__filters">
{% include 'Pages/NewsOverviewPage/_list-tag.html.twig' with {'tagContext': tagContext} %}
{# {% include 'Pages/NewsOverviewPage/_list-category.html.twig' with {'categoryContext': categoryContext} %}#}
</div>
</div>
</div>
<div class="content">
{% set count = 0 %}
{% if pagerfanta.nbResults > 0 %}
<div class="row">
{% for article in pagerfanta.currentPageResults %}
{% set articlenode = get_node_translation_for(article) %}
{% if article.listImage and article.listImage is not empty %}
{% set img = article.listImage | first %}
{% elseif article.headerImage and article.headerImage is not empty %}
{% set img = article.headerImage | first %}
{% else %}
{% set img = {
'cropping' : null,
'media' : {
'url' : get_default_article_image(),
},
'mediaAlt' : 'GdyĆskie Centrum Sportu'
} %}
{% endif %}
<article
class="news-box col-md-4{% for tag in article.tags %}{% if tag.id == 3 %} photo{% endif %}{% if tag.id == 2 %} video{% endif %}{% endfor %}">
<a href="{{ path('_slug', {'url': articlenode.url}) }}">
<div class="news-box__img">
{% if img is defined and img is not empty and img is not null %}
{% set fullSrc = croppedImgSrc(img.media.url, img.cropping, { w: 450, h: 300, q: 80, fit: 'crop' }) %}
<img src="{{ fullSrc }}" alt="{% if img.mediaAlt %}{{ img.mediaAlt }}{% else %}{{ article.title | striptags }}{% endif %}" />
{% else %}
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=="
alt="">
{% endif %}
<div class="news-box__read-more">
{{ 'news.read-more' | trans }}
</div>
</div>
<div class="news-box__caption">
<h3 role="heading" aria-level="3">{{ article.title }}</h3>
</div>
<div class="news-box__date">
<time datetime="{{ article.date | date("d.m.Y") }}">{{ article.date | date("d.m.Y") }}</time>
</div>
</a>
</article>
{% set count = count + 1 %}
{% set img = null %}
{% endfor %}
</div>
{% endif %}
{% if pagerfanta.haveToPaginate() %}
<div class="pagination">
{{ pagerfanta(pagerfanta, null, {
'pageParameter': '[page]',
'prev_message':'<i class="fas fa-chevron-left"></i>',
'next_message':'<i class="fas fa-chevron-right"></i>'
}) }}
</div>
{% endif %}
</div>
</div>