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.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 %}
  16. <div class="messages">
  17. {% for message in messages %}
  18. <p {% if message.tags %} class="{{ message.tags }}" {% endif %}>{{ message }}</p>
  19. {% endfor %}
  20. </div>
  21. {% endif %}
  22. {% for post in posts %}
  23. <div class="mt-5 post">
  24. <div class="date">
  25. {{ post.published_date }}
  26. </div>
  27. <h2>
  28. <a href="{% url 'post_detail' pk=post.pk %}">{{ post.title }}</a>
  29. </h2>
  30. <p>{{ post.text|linebreaks }}</p>
  31. Tags: {% for tag in post.tags.all %}
  32. <a href="{% url 'post_list_by_tag' tag.slug %}">{{ tag.name }}</a>
  33. {% if not forloop.last %}, {% endif %} {% endfor %} <p>
  34. {{ post.author }}
  35. </p>
  36. </div>
  37. {% endfor %}
  38. </div>
  39. </div>
  40. {% endblock %}