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