annotate gpp/templates/forums/index.html @ 167:cf9f9d4c4d54

Adding a query to the forums to get all the topics with unread posts. This is for ticket #54.
author Brian Neal <bgneal@gmail.com>
date Sun, 24 Jan 2010 22:33:11 +0000
parents f7a6b8fe4556
children 6f14970b103a
rev   line source
bgneal@81 1 {% extends 'base.html' %}
bgneal@164 2 {% load cache %}
bgneal@84 3 {% load forum_tags %}
bgneal@81 4 {% block title %}Forums{% endblock %}
bgneal@81 5 {% block content %}
bgneal@81 6 <h2>Forums</h2>
bgneal@81 7
bgneal@167 8 <form action="." method="get" id="forum-query-form">
bgneal@167 9 <select name="query">
bgneal@167 10 <option value="unread">Show topics with unread posts</option>
bgneal@167 11 <option value="mine">Show my posts</option>
bgneal@167 12 <option value="unanswered">Show unanswered posts</option>
bgneal@167 13 </select><input type="submit" value="Go" />
bgneal@167 14 </form>
bgneal@167 15
bgneal@81 16 <div class="forum-block">
bgneal@81 17 {% for iter in cats %}
bgneal@81 18 <h3>{{ iter.cat }}</h3>
bgneal@81 19 <table class="forum-index-table">
bgneal@81 20 <thead>
bgneal@81 21 <tr>
bgneal@81 22 <th class="forum-title">Forum</th>
bgneal@81 23 <th class="forum-topics">Topics</th>
bgneal@81 24 <th class="forum-posts">Posts</th>
bgneal@81 25 <th class="forum-last_post">Last Post</th>
bgneal@81 26 </tr>
bgneal@81 27 </thead>
bgneal@81 28 <tbody>
bgneal@81 29 {% for forum in iter.forums %}
bgneal@94 30 <tr class="{% cycle 'odd' 'even' %}">
bgneal@113 31 <td>
bgneal@113 32 {% if forum.has_unread %}
bgneal@113 33 <img src="{{ MEDIA_URL }}icons/new.png" alt="New Posts" title="New Posts" class="forums-topic-icon" />
bgneal@113 34 {% endif %}
bgneal@113 35 <h4><a href="{{ forum.get_absolute_url }}">{{ forum.name }}</a></h4>
bgneal@81 36 <p>{{ forum.description }}</p></td>
bgneal@81 37 <td class="forum-topics">{{ forum.topic_count }}</td>
bgneal@81 38 <td class="forum-posts">{{ forum.post_count }}</td>
bgneal@120 39 <td class="forum-last_post">{% last_post_info forum.last_post %}</td>
bgneal@81 40 </tr>
bgneal@81 41 {% endfor %}
bgneal@81 42 </tbody>
bgneal@81 43 </table>
bgneal@81 44 {% endfor %}
bgneal@164 45 {% cache 900 forum-stats-block %}
bgneal@164 46 {% forum_stats %}
bgneal@164 47 {% endcache %}
bgneal@160 48 {% whos_online %}
bgneal@120 49 <p>{% current_forum_time user %}</p>
bgneal@81 50 </div>
bgneal@81 51 {% endblock %}