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.

blog_search_list_view.html 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. {% extends "base.html" %} {% block content %}
  2. {% load taggit_templatetags2_tags %}
  3. {% get_tagcloud as tags for 'application' %}
  4. {% include_tagcloud 'application.Post' %}
  5. <div>
  6. <form class="post-form" method="post">
  7. {% csrf_token %} {{form.as_p}}
  8. <button type="submit" class="save btn btn-outline-dark">Save</button>
  9. </form>
  10. {% if messages %}
  11. {% for message in messages %}
  12. <div {% if message.tags %} class="{{ message.tags }}" {% endif %}>{{ message }}</div>
  13. {% endfor %}
  14. {% endif %}
  15. <form type="get" action="." style="margin: 0">
  16. <input id="search_box" type="text" name="search_box" placeholder="Search..."></br>
  17. <button id="search_submit" type="submit" class="btn btn-outline-dark">Suchen</button>
  18. </form>
  19. <div>
  20. {% for post in posts %}
  21. <div class="post">
  22. <div class="date">
  23. {{ post.published_date }}
  24. </div>
  25. <h1>
  26. <a href="{% url 'post_detail' pk=post.pk %}">{{ post.title }}</a>
  27. </h1>
  28. <p>{{ post.text|linebreaks }}</p>
  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. </p>
  34. </div>
  35. {% endfor %}
  36. </div>
  37. {% endblock %}