annotate gpp/templates/news/category_index.html @ 235:d302c498560e

Fix problem when deleting multiple topics from a forum in bulk. We getting a list of topics from the database, then deleting each topic. But after you delete a topic, the forum.last_post on the remaining non-deleted topics can be stale. This was causing a weird DoesNotExist. Now just get the topics one at a time from the database.
author Brian Neal <bgneal@gmail.com>
date Thu, 26 Aug 2010 04:01:58 +0000
parents b4305e18d3af
children 1246a4f1ab4f
rev   line source
gremmie@1 1 {% extends 'news/base.html' %}
gremmie@1 2 {% block title %}News: Categories{% endblock %}
gremmie@1 3 {% block categories-class %}class="active"{% endblock %}
gremmie@1 4 {% block news_content %}
gremmie@1 5 <h3>Categories</h3>
gremmie@1 6 <p>
gremmie@1 7 This page shows the list of news categories for the site. Under each category we show the
gremmie@1 8 latest ten stories. To see all the stories in a category, click the icon for that category.
gremmie@1 9 Each story is also <strong>tagged</strong> with a set of tags. You may also wish to
gremmie@1 10 <a href="{% url news-tag_index %}">view our stories by their tags</a>.
gremmie@1 11 </p>
gremmie@1 12
gremmie@1 13 {% for category, story_set in cat_list %}
gremmie@1 14 <h3>{{ category.title }}</h3>
bgneal@197 15 <p><a href="{% url news.views.category category=category.id page=1 %}">
gremmie@1 16 <img src="{{ category.icon.url }}" alt="{{ category.title }}" title="{{ category.title }}" />
gremmie@1 17 </a>
gremmie@1 18 </p>
gremmie@1 19 {% if story_set %}
gremmie@1 20 <ul>
gremmie@1 21 {% for story in story_set %}
gremmie@1 22 <li><a href="{{ story.get_absolute_url }}">{{ story.title }}</a>
bgneal@204 23 - {{ story.date_submitted|date:"F d, Y" }}</li>
gremmie@1 24 {% endfor %}
gremmie@1 25 </ul>
gremmie@1 26 {% else %}
gremmie@1 27 <p>No news at this time.</p>
gremmie@1 28 {% endif %}
gremmie@1 29 {% endfor %}
gremmie@1 30
gremmie@1 31 {% endblock %}