{% extends 'base.html.twig' %}
{% block body_id 'blog_post_show' %}
{% block main %}
<h1>{{ post.title }}</h1>
<p class="post-metadata">
<span class="metadata"><i class="fa fa-calendar"></i> {{ post.publishedAt|format_datetime('long', 'medium', '', 'UTC') }}</span>
<span class="metadata"><i class="fa fa-user"></i> {{ post.author.fullName }}</span>
</p>
{{ post.content|markdown_to_html|sanitize_html }}
{% endblock %}
{% block sidebar %}
{% if is_granted('edit', post) %}
<div class="section">
<a class="btn btn-lg btn-block btn-success" href="{{ path('admin_post_edit', {id: post.id}) }}">
<i class="fa fa-edit" aria-hidden="true"></i> {{ 'action.edit_post'|trans }}
</a>
</div>
{% endif %}
{# the parent() function includes the contents defined by the parent template
('base.html.twig') for this block ('sidebar'). This is a very convenient way
to share common contents in different templates #}
{{ parent() }}
{% endblock %}