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_list.html 1.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. {% extends 'base.html' %} {% block content %}
  2. <div class="row">
  3. {% if tag %} <div class="mx-auto">
  4. <h2> Artikel mit dem Tag "{{ tag.name }}" </h2>
  5. </div>{% endif %}
  6. </div>
  7. <div class="row">
  8. <div class="mx-auto">
  9. <h1> Artikleübersicht </h1>
  10. </div>
  11. </div>
  12. </div>
  13. <div class="row">
  14. <div class="col-md-8">
  15. {% if messages %} <div class="messages">
  16. {% for message in messages %}
  17. <p {% if message.tags %} class="{{ message.tags }}" {% endif %}>{{ message }}</p>
  18. {% endfor %}
  19. </div>
  20. {% endif %}
  21. {% for post in posts %}
  22. <div class="mt-5 post">
  23. <div class="date">
  24. {{ post.published_date }}
  25. </div>
  26. <h2>
  27. <a href="{% url 'post_detail' pk=post.pk %}">{{ post.title }}</a>
  28. </h2>
  29. <p>{{ post.text|linebreaks }}</p>
  30. Tags: {% for tag in post.tags.all %}
  31. <a href="{% url 'post_list_by_tag' tag.slug %}">{{ tag.name }}</a>
  32. {% if not forloop.last %}, {% endif %} {% endfor %} <p>
  33. {{ post.author }}
  34. </p>
  35. </div>
  36. {% endfor %}
  37. </div>
  38. </div>
  39. {% endblock %}