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

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. Tags: {% for tag in post.tags.all %}
  30. <a href="{% url 'post_list_by_tag' tag.slug %}">{{ tag.name }}</a>
  31. {% if not forloop.last %}, {% endif %} {% endfor %} <p>
  32. {{ post.author }}
  33. {% if user.is_staff %}
  34. <p>
  35. {% get_hit_count for post %} Benutzer haben diesen Post bereits gelesen!
  36. </p>
  37. {% endif %}
  38. </p>
  39. </div>
  40. </div>
  41. {% endblock %}