annotate gpp/templates/forums/forum_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 445e1466a98d
children 6a5549c2efb5
rev   line source
bgneal@82 1 {% extends 'base.html' %}
bgneal@84 2 {% load forum_tags %}
bgneal@82 3 {% block title %}Forums: {{ forum.name }}{% endblock %}
bgneal@82 4 {% block content %}
bgneal@82 5 <h2>Forums: {{ forum.name }}</h2>
bgneal@82 6
bgneal@82 7 <h3>
bgneal@82 8 <a href="{% url forums-index %}">SurfGuitar101 Forum Index</a> &raquo;
bgneal@82 9 <a href="{% url forums-forum_index slug=forum.slug %}">{{ forum.name }}</a>
bgneal@82 10 </h3>
bgneal@82 11
bgneal@82 12 <div class="forum-block">
bgneal@113 13 {% if user.is_authenticated %}
bgneal@113 14 <a href="{% url forums-new_topic slug=forum.slug %}">New Topic</a> &bull;
bgneal@113 15 <form action="{% url forums-catchup slug=forum.slug %}" method="post" style="display:inline">
bgneal@113 16 <input type="submit" value="Mark All Topics Read" />
bgneal@113 17 </form>
bgneal@113 18 {% endif %}
bgneal@97 19 {{ page_nav }}
bgneal@82 20 <table class="forum-index-table">
bgneal@82 21 <thead>
bgneal@82 22 <tr>
bgneal@82 23 <th class="forum-index_title">Topics</th>
bgneal@82 24 <th class="forum-index_replies">Replies</th>
bgneal@82 25 <th class="forum-index_author">Author</th>
bgneal@82 26 <th class="forum-index_views">Views</th>
bgneal@82 27 <th class="forum-index_last_post">Last Post</th>
bgneal@82 28 </tr>
bgneal@82 29 </thead>
bgneal@82 30 <tbody>
bgneal@93 31 {% for topic in page.object_list %}
bgneal@93 32 <tr class="{% cycle 'odd' 'even' %}">
bgneal@114 33 <td>
bgneal@167 34 {% topic_icons topic %}
bgneal@161 35 <h4><a href="{{ topic.get_absolute_url }}">{{ topic.name }}</a></h4>
bgneal@161 36 {% if topic.page_range %}
bgneal@167 37 {% topic_page_range topic %}
bgneal@161 38 {% endif %}
bgneal@161 39 </td>
bgneal@83 40 <td class="forum-index_replies">{{ topic.reply_count }}</td>
bgneal@85 41 <td class="forum-index_author"><a href="{% url bio-view_profile username=topic.user.username %}" title="View profile for {{ topic.user.username }}">{{ topic.user.username }}</a></td>
bgneal@82 42 <td class="forum-index_views">{{ topic.view_count }}</td>
bgneal@82 43 <td class="forum-index_last_post">
bgneal@120 44 {% last_post_info topic.last_post %}
bgneal@82 45 </td>
bgneal@82 46 </tr>
bgneal@82 47 {% empty %}
bgneal@82 48 <tr>
bgneal@111 49 <td colspan="5">
bgneal@82 50 <i>No topics available.</i>
bgneal@82 51 </td>
bgneal@82 52 </tr>
bgneal@82 53 {% endfor %}
bgneal@82 54 </tbody>
bgneal@82 55 </table>
bgneal@97 56 {{ page_nav }}
bgneal@113 57 {% if user.is_authenticated %}
bgneal@113 58 <a href="{% url forums-new_topic slug=forum.slug %}">New Topic</a> &bull;
bgneal@113 59 <form action="{% url forums-catchup slug=forum.slug %}" method="post" style="display:inline">
bgneal@113 60 <input type="submit" value="Mark All Topics Read" />
bgneal@113 61 </form>
bgneal@113 62 {% endif %}
bgneal@113 63 {% if can_moderate %}
bgneal@111 64 <p><a href="{% url forums-mod_forum slug=forum.slug %}">Moderate this forum</a></p>
bgneal@113 65 {% endif %}
bgneal@120 66 {% current_forum_time user %}
bgneal@82 67 </div>
bgneal@82 68 {% endblock %}