44 lines
1.5 KiB
HTML
Raw Permalink Normal View History

<!--
marked parts of the template is external code
import from https://tutorial.djangogirls.org/en/template_extending/
-->
2018-10-30 18:43:30 +01:00
{% extends 'base.html' %}{% block content %}
{% load hitcount_tags %}
2018-11-17 19:57:10 +01:00
<div class="col-md-8">
<!-- imported start -->
2018-11-17 19:57:10 +01:00
<div class="post">
{% if post.published_date %}
<div class="date">
{{ post.published_date }}
</div>
{% else %}
<a class="btn btn-outline-dark" href="{% url 'post_publish' pk=post.pk %}">Publish</a>
2018-12-13 18:38:34 +01:00
<!-- imported end -->
2018-11-17 19:57:10 +01:00
{% endif %} {% if user.is_staff and user == post.author %}
<!-- imported start -->
2018-11-17 19:57:10 +01:00
<a class="btn btn-outline-dark" href="{% url 'post_edit' pk=post.pk %}">
<span class="glyphicon glyphicon-pencil">Bearbeiten</span>
</a>
<a class="btn btn-outline-dark" href="{% url 'post_remove' pk=post.pk %}">
<span class="glyphicon glyphicon-remove">Löschen</span>
</a>
{% endif %}
<h1>{{ post.title }}</h1>
<p>{{ post.text|linebreaksbr }}</p>
<!-- imported end -->
2018-12-13 18:38:34 +01:00
Tags: {% for tag in post.tags.all %}
<a href="{% url 'post_list_by_tag' tag.slug %}">{{ tag.name }}</a>
{% if not forloop.last %}, {% endif %} {% endfor %} <p>
{{ post.author }}
{% if user.is_staff %}
<p>
{% get_hit_count for post %} Benutzer haben diesen Post bereits gelesen!
</p>
{% endif %}
2018-11-17 19:57:10 +01:00
</p>
</div>
</div>
{% endblock %}