/core/templates/category.html

http://github.com/plushcms/PlushCMS · HTML · 44 lines · 39 code · 5 blank · 0 comment · 0 complexity · 8c6dd455b221586f9d6d0dd7fb8d0119 MD5 · raw file

  1. {% extends "base.html" %}
  2. {% block content %}
  3. <h1>Category: {{ category.title }}</h1><br />
  4. {% if posts.object_list %}
  5. {% for news in posts.object_list %}
  6. <h1><a href="/{{ news.url }}">{{ news.title }}</a></h1>
  7. <h5><img src="img/images/ico.png" alt="" /> Date: {{ news.datetime|date:"Y.m.d" }}</h5>
  8. {% if news.text|safe|wordcount > 50 %}
  9. {{ news.text|safe|truncatewords_html:"50" }}
  10. <p class="right"><a href="/{{ news.url }}">More...</a></p><br /><br />
  11. {% else %}
  12. {{ news.text|safe }}
  13. {% endif %}
  14. <p>
  15. <strong>Categories:</strong>
  16. {% if news.category.all|length %}
  17. {% for category in news.category.all %}
  18. <a href="/category/{{ category.url }}/"><img src="/img/{{ category.icon }}" alt="{{ category.title }}" /> {{ category.title }}</a>{% if not forloop.last %},{% endif %}
  19. {% endfor %}
  20. {% else %}
  21. No category
  22. {% endif %}
  23. | <strong>Author: </strong>{{ news.author }}
  24. <span class="infocomments">
  25. <strong>Comments:</strong> (<a href="/{{ news.url }}">{{ news.comments_set.count }}</a>)
  26. </span>
  27. </p>
  28. {% endfor %}
  29. {% if posts.has_previous %}
  30. <div class="prev"><a href="/category/{{ category.url }}/{{ posts.previous_page_number }}/"><< Previous news</a></div>
  31. {% endif %}
  32. {% if posts.has_next %}
  33. <div class="next"><a href="/category/{{ category.url }}/{{ posts.next_page_number }}/">Next news >></a></div>
  34. {% endif %}
  35. {% else %}
  36. This category is empty.
  37. <p style="text-align: center; padding: 35px 0 0 0;">Return to <a href="/">homepage</a></p>
  38. {% endif %}
  39. {% endblock %}