/core/templates/category.html
http://github.com/plushcms/PlushCMS · HTML · 44 lines · 39 code · 5 blank · 0 comment · 0 complexity · 8c6dd455b221586f9d6d0dd7fb8d0119 MD5 · raw file
- {% extends "base.html" %}
- {% block content %}
- <h1>Category: {{ category.title }}</h1><br />
-
- {% if posts.object_list %}
- {% for news in posts.object_list %}
- <h1><a href="/{{ news.url }}">{{ news.title }}</a></h1>
- <h5><img src="img/images/ico.png" alt="" /> Date: {{ news.datetime|date:"Y.m.d" }}</h5>
-
- {% if news.text|safe|wordcount > 50 %}
- {{ news.text|safe|truncatewords_html:"50" }}
- <p class="right"><a href="/{{ news.url }}">More...</a></p><br /><br />
- {% else %}
- {{ news.text|safe }}
- {% endif %}
-
- <p>
- <strong>Categories:</strong>
- {% if news.category.all|length %}
- {% for category in news.category.all %}
- <a href="/category/{{ category.url }}/"><img src="/img/{{ category.icon }}" alt="{{ category.title }}" /> {{ category.title }}</a>{% if not forloop.last %},{% endif %}
- {% endfor %}
- {% else %}
- No category
- {% endif %}
- | <strong>Author: </strong>{{ news.author }}
- <span class="infocomments">
- <strong>Comments:</strong> (<a href="/{{ news.url }}">{{ news.comments_set.count }}</a>)
- </span>
- </p>
- {% endfor %}
-
- {% if posts.has_previous %}
- <div class="prev"><a href="/category/{{ category.url }}/{{ posts.previous_page_number }}/"><< Previous news</a></div>
- {% endif %}
-
- {% if posts.has_next %}
- <div class="next"><a href="/category/{{ category.url }}/{{ posts.next_page_number }}/">Next news >></a></div>
- {% endif %}
- {% else %}
- This category is empty.
- <p style="text-align: center; padding: 35px 0 0 0;">Return to <a href="/">homepage</a></p>
- {% endif %}
- {% endblock %}