Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

post_detail.html 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <!--
  2. marked parts of the template is external code
  3. import from https://tutorial.djangogirls.org/en/template_extending/
  4. -->
  5. {% extends 'base.html' %}{% block content %}
  6. {% load hitcount_tags %}
  7. <div class="col-md-8">
  8. <!-- imported start -->
  9. <div class="post">
  10. {% if post.published_date %}
  11. <div class="date">
  12. {{ post.published_date }}
  13. </div>
  14. {% else %}
  15. <a class="btn btn-outline-dark" href="{% url 'post_publish' pk=post.pk %}">Publish</a>
  16. <!-- imported end -->
  17. {% endif %} {% if user.is_staff and user == post.author %}
  18. <!-- imported start -->
  19. <a class="btn btn-outline-dark" href="{% url 'post_edit' pk=post.pk %}">
  20. <span class="glyphicon glyphicon-pencil">Bearbeiten</span>
  21. </a>
  22. <a class="btn btn-outline-dark" href="{% url 'post_remove' pk=post.pk %}">
  23. <span class="glyphicon glyphicon-remove">Löschen</span>
  24. </a>
  25. {% endif %}
  26. <h1>{{ post.title }}</h1>
  27. <p>{{ post.text|linebreaksbr }}</p>
  28. <!-- imported end -->
  29. <p>
  30. Tags:
  31. {% for tag in post.tags.all %}
  32. <a href="{% url 'search_add' %}">{{ tag.name }} </a>
  33. {% if not forloop.last %}, {% endif %}
  34. {% endfor %}
  35. </p>
  36. <p>
  37. Autor: {{ post.author }}
  38. </p>
  39. {% if user.is_staff %}
  40. <p>
  41. {% get_hit_count for post %} Benutzer haben diesen Post bereits gelesen!
  42. </p>
  43. {% endif %}
  44. </div>
  45. </div>
  46. {% endblock %}