{% extends 'base.html' %}
{% load humanize %}
{% load i18n %}

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

{% block body %}
<h1>{{ post.title }}</h1>
<p><a class="btn btn-default btn-xs" href="{{ post.category.get_absolute_url }}">{{ post.category }}</a></p>
<p><em>{% trans 'Added on' %}</em> {{ post.created_at | naturaltime }} ({{ post.created_at | date }})</p>
<hr>
<p>
{{ post.content }}
</p>

{% if user.is_staff %}

<hr>

<a href="{% url 'post_update' pk=post.pk %}">
  <button class="btn btn-primary">
    {% trans 'Edit post '%}
  </button>
</a>

<a href="{% url 'post_delete' pk=post.pk %}">
  <button class="btn btn-warning">
    {% trans 'Delete post '%}
  </button>
</a>
{% endif %}

{% endblock %}
