{% extends "vellum/base_vellum.html" %}

{% load i18n vellum_tags %}

{% block title %}{{ post.title }}{% endblock %}
{% block body_class %}{{ block.super }} post_detail{% endblock %}
{% block body_id %}post_{{ post.id }}{% endblock %}

{% block content %}
    <article class="entry">
        <header>
            <h1 class="entry-title"><a href="{{ post.get_absolute_url }}" title="{% trans "Permalink to" %} {{ post.title }}">{{ post.title }}</a></h1>
            <time pubdate datetime="{{ post.publish|date:"c" }}">{{ post.publish|date }}</time>
            {% if perms.vellum.change_post %}
            <a title="{% trans "Edit" %} {{ post.title }}" class="edit" href="{% url admin:vellum_post_change post.id %}">Edit</a>
            {% endif %}
        </header>
        <div class="entry-content">
            {{ post.body_rendered|safe }}
        </div>
        <footer>
            <p class="meta">This was posted{% if post.author %} by {{ post.author }}{%endif %} on <time pubdate datetime="{{ post.publish|date:"c" }}">{{ post.publish|date }}</time>{% if post.categories.all %} in {% for category in post.categories.all%}<a href="{% url vellum_category_detail slug=category.slug %}">{{ category }}</a>{% if not forloop.last %}, {% endif %}{% endfor %}{% endif %}. {% if post.tags.all %}It was tagged with {% for tag in post.tags.all %}<a href="{% url vellum_tag_detail slug=tag.slug %}">{{ tag }}</a>{% if not forloop.last %}, {% endif %}{% endfor %}.{% endif %}</p>
        </footer>

        <div class="other_posts">
            {% if post.get_previous_post %}
            <a class="previous" href="{{ post.get_previous_post.get_absolute_url }}" title="{% trans "View previous post" %}">&laquo; {{ post.get_previous_post }}</a>
            {% endif %}
            {% if post.get_next_post %}
            <span class="separator">|</span> <a class="next" href="{{ post.get_next_post.get_absolute_url }}" title="{% trans "View next post" %}">{{ post.get_next_post }} &raquo;</a>
            {% endif %}
        </div>
    </article>

    {% include 'vellum/comments.html' %}

{% endblock %}
