templates_common/newsview.html.twig line 1
{% extends 'layout.html.twig' %}{% block title %}{{ post.title }}{% endblock title %}{% block content %}{% include 'blocks/breadcrumbs.html.twig' with{items: [[post.title|striptags|u.truncate(100, '...')|raw],]} %}<main><div class="container px-4"><div class="w-[100%] mx-auto"><h1 class="text-center font-extrabold text-[24px] leading-[36px] lg:text-[36px] lg:leading-[62.4px]">{{ post.title }}</h1><articleclass="{% if post.type == 'post' %}lg:border lg:border-gray-200 lg:rounded-lg lg:shadow-md my-6{% endif %}">{% if post.type == 'post' %}<div class="lg:max-w-[70%] mx-auto my-2 lg:my-6 text-[14px]"><time class="text-[#999fab] leading-[150%]" datetime="">{% block time %}{{ post.publishedAt ? post.publishedAt|date('d.m.Y') : '' }}{% endblock time %}</time></div>{% endif %}{# @TODO move to templates #}{% if post.id == 52 or post.id == 67 %}<div class="max-lg:px-4 lg:max-w-[85%] mx-auto my-2 lg:my-6 text-[14px]">{% else %}<div class="lg:max-w-[70%] mx-auto my-2 lg:my-6">{% endif %}{% if post.type == 'post' or post.isSliderActive == true %}{% block slider %}<div class="relative mb-6">{% if post.attachments|length > 1 %}<div id="news_slider_controls"><button class="w-[100px] h-[100px] absolute top-[calc(50%-50px)] z-10"><img class="w-[32px] mx-auto"src="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z'/%3e%3c/svg%3e"alt=""></button><button class="w-[100px] h-[100px] absolute top-[calc(50%-50px)] right-0 z-10"><img class="w-[32px] mx-auto rotate-180"src="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z'/%3e%3c/svg%3e"alt=""></button></div><div id="news_slider">{% for image in post.attachments %}{% if image.path is not empty %}<imgsrcset="{{ asset(image.path) | imagine_filter('slider_photo_mobile') }} 480w, {{ asset(image.path) | imagine_filter('slider_photo') }} 1280w"sizes="(max-width: 600px) 480px, 1280px"src="{{ asset(image.path) | imagine_filter('slider_photo') }}"alt="{{ post.title }} ">{% else %}{% if image.imageName matches '/\.(mp4|avi|webm|flv)$/' %}<div><video class="myVideo"src="/images/attachments/{{ image.imageName }}"style="display: inline-block;" controlsmuted></video></div>{% else %}<imgsrcset="{{ asset('/images/attachments/' ~ image.imageName) | imagine_filter('slider_photo_mobile') }} 480w, {{ asset('/images/attachments/' ~ image.imageName) | imagine_filter('slider_photo') }} 1280w"sizes="(max-width: 600px) 480px, 1280px"src="{{ asset('/images/attachments/' ~ image.imageName) | imagine_filter('slider_photo') }}"alt="{{ post.title }} ">{% endif %}{% endif %}{% endfor %}</div>{% elseif post.attachments|length == 1 %}{% if post.attachments|first.imageName matches '/\.(mp4|avi|webm|flv)$/' %}<video class="myVideo"src="/images/attachments/{{ post.attachments|first.imageName }}"style="display: inline-block;" controls muted></video>{% else %}{% if post.attachments|first.path is not empty %}<img class="mx-auto"src="{{ asset( post.attachments|first.path) }}"alt="{{ post.title }}">{% else %}<img class="mx-auto"src="{{ asset('/images/attachments/' ~ post.attachments|first.imageName) }}"alt="{{ post.title }}">{% endif %}{% endif %}{% endif %}</div>{% endblock slider %}{% endif %}{% block article %}{{ post.content|raw }}{% endblock article %}</div></article>{% if post.type == 'post' %}<div class="text-center my-12"><a class="inline-block mx-auto text-[#cda062] rounded-[28px] px-6 py-3 border-2 border-[#cda062] font-bold hover:bg-[rgba(254,197,12,.16)]"href="{{ path('app_post_index', {'type': post.type}) }}">{{ 'Back to news'|trans }}<img class="inline rotate-[90deg] ml-4" src="/img/arrow-small-down.svg" alt=""></a></div>{% endif %}</div></div></main>{% endblock content %}