{% extends 'main/_tpl.html.twig' %}
{% block javascripts_body %}
{{ parent() }}
{{ encore_entry_script_tags('blog') }}
{{ encore_entry_link_tags('blog') }}
{% endblock %}
{% block content %}
<div class="blog blog-page">
<div class="block block_padding_top">
<div class="page-head">
<ul class="breadcrumbs">
<li class="breadcrumbs__entry"><a class="breadcrumbs__lnk" href="{{ path('home') }}">Главная</a></li>
<li class="breadcrumbs__entry"><a class="breadcrumbs__lnk" href="{{ path('blog_index.ru') }}">Блог</a>
<li class="breadcrumbs__entry"><a class="breadcrumbs__lnk" href="{{ path('blog_post', {slug:post.slug}) }}">{{ post.title }}</a></li>
</ul>
</div>
<div class="colgroup">
<div class="col col_left col_body">
<img class="blog-page__main-img" src="{{ vich_uploader_asset(post, 'posterImageFile') }}" alt="{{ post.title }}">
<h1>{{post.title}}</h1>
{% if post.description %}
<p>{{ post.description }}</p>
{% endif %}
<div class="entry__top">
<div class="entry__tags">
{% for tag in post.tags %}
<a href="{{ path('blog_tag', {slug: tag.slug}) }}" class="tags__lnk">#{{ tag.name }}</a>
{% endfor %}
</div>
<div class="entry__date">{{ post.createdAt|date('d.m.Y') }}</div>
</div>
{% for contentBlock in post.blogContents %}
<div>
<h2>{{ contentBlock.title }}</h2>
{{ contentBlock.text|raw }}
<img src="{{ vich_uploader_asset(contentBlock, 'imageFile') }}" alt="">
</div>
{% if contentBlock.videoLink|length %}
<div class="blog__video">
<iframe src="{{ contentBlock.videoLink }}" frameborder="0" allowfullscreen></iframe>
</div>
{% endif %}
{% endfor %}
{% if post.buttonText and post.buttonLink %}
<div class="btn-container">
<a href="{{ post.buttonLink }}" class="btn btn_blue">{{ post.buttonText }}</a>
</div>
{% endif %}
</div>
<div class="col col_right col_aside">
{% if similar|length %}
<div class="blog-more">
<div class="blog-more__title">Больше интересного:</div>
<div class="blog__list">
{% for p in similar %}
<div class="blog__entry">
<a href="{{ path('blog_post', {slug: p.slug}) }}" class="entry__lnk"></a>
<img class="entry__photo" src="{{ vich_uploader_asset(p, 'posterImageFile') }}" alt="{{ post.title }}">
<div class="entry__top">
<div class="entry__date">{{ p.createdAt|date('d.m.Y') }}</div>
<div class="entry__tags">
{% for tag in p.tags %}
<a href="{{ path('blog_tag', {slug: tag.slug}) }}" class="tags__lnk">#{{ tag.name }}</a>
{% endfor %}
</div>
</div>
<div class="entry__title">{{ p.title }}</div>
</div>
{% endfor %}
</div>
</div>
{% endif %}
<div class="tags">
{% for tag in tags %}
<a href="{{ path('blog_tag', {slug: tag.slug}) }}" class="tags__lnk">#{{ tag.name }}</a>
{% endfor %}
</div>
</div>
</div>
</div>
<div class="block block_padding_bottom">
<div class="tgbanner">
<div class="tgbanner__title">Подпишитесь на наш
<nobr>Telegram-канал,</nobr>
</div>
<p>чтобы быть в курсе новостей GetMeBack раньше всех</p>
<div class="tgbanner__btn-container">
<a href="https://t.me/getmeback_russia" target="_blank" class="btn btn_white">Подписаться</a>
</div>
</div>
</div>
</div>
{% endblock %}