{% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %}

{% block meta_title %}{{post.title}}{% endblock %}

{% block content %}
    <div class="h-block">
        <div class="h-block-header">
            <div class="icon"><span class="big-light-icon i-blog"></span></div>
            <h2>{{post.title|truncate(50)}}</h2>
            <p>{{post.created_at|bb_date}} {% trans 'by '%} {{ post.author.name }}</p>
        </div>
        <div class="block articles">
            <div class="article last">
                {{ post.content|bbmd }}
            </div>
        </div>
    </div>

    <p><a class="bb-button" href="{{ 'blog'|link }}"><span class="dark-icon i-arrow"></span> {% trans 'Back to list' %}</a></p>

{% endblock %}

{# block sidebar2 %}
<div class="box">
    <h2>{% trans 'Other recent posts' %}</h2>
    <div class="block" id="list-items">
        <ul class="menu">
            {% set posts = guest.news_get_list({"per_page": 5}) %}
            {% for i, post in posts.list %}
            <li>
                <a href="{{ '/blog'|link }}/{{post.slug}}">{{post.title|truncate(35)}}</a>
            </li>
            {% endfor %}
        </ul>
    </div>
</div>

{% endblock #}