annotate gpp/templates/forums/forum_index.html @ 114:535d02d1c017

Forums: Implemented unread status for topics and posts.
author Brian Neal <bgneal@gmail.com>
date Sun, 11 Oct 2009 20:27:07 +0000
parents d97ceb95ce02
children f8f4514b806a
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@114 34 {% if topic.has_unread %}<img src="{{ MEDIA_URL }}icons/new.png" alt="New Posts" title="New Posts" class="forums-topic-icon" />{% endif %}
bgneal@114 35 {% if topic.sticky %}<img src="{{ MEDIA_URL }}icons/asterisk_orange.png" alt="Sticky" title="Sticky" class="forums-topic-icon" />{% endif %}
bgneal@103 36 {% if topic.locked %}<img src="{{ MEDIA_URL }}icons/lock.png" alt="Locked" title="Locked"
bgneal@102 37 class="forums-topic-icon" />{% endif %}
bgneal@102 38 <h4><a href="{{ topic.get_absolute_url }}">{{ topic.name }}</a></h4></td>
bgneal@83 39 <td class="forum-index_replies">{{ topic.reply_count }}</td>
bgneal@85 40 <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 41 <td class="forum-index_views">{{ topic.view_count }}</td>
bgneal@82 42 <td class="forum-index_last_post">
bgneal@94 43 {% last_post_info topic.last_post MEDIA_URL %}
bgneal@82 44 </td>
bgneal@82 45 </tr>
bgneal@82 46 {% empty %}
bgneal@82 47 <tr>
bgneal@111 48 <td colspan="5">
bgneal@82 49 <i>No topics available.</i>
bgneal@82 50 </td>
bgneal@82 51 </tr>
bgneal@82 52 {% endfor %}
bgneal@82 53 </tbody>
bgneal@82 54 </table>
bgneal@97 55 {{ page_nav }}
bgneal@113 56 {% if user.is_authenticated %}
bgneal@113 57 <a href="{% url forums-new_topic slug=forum.slug %}">New Topic</a> &bull;
bgneal@113 58 <form action="{% url forums-catchup slug=forum.slug %}" method="post" style="display:inline">
bgneal@113 59 <input type="submit" value="Mark All Topics Read" />
bgneal@113 60 </form>
bgneal@113 61 {% endif %}
bgneal@113 62 {% if can_moderate %}
bgneal@111 63 <p><a href="{% url forums-mod_forum slug=forum.slug %}">Moderate this forum</a></p>
bgneal@113 64 {% endif %}
bgneal@82 65 </div>
bgneal@82 66 {% endblock %}