annotate gpp/templates/forums/forum_index.html @ 161:445e1466a98d

Implement #47; add goto page links on topics in the forum index view.
author Brian Neal <bgneal@gmail.com>
date Tue, 22 Dec 2009 03:31:43 +0000
parents f8f4514b806a
children cf9f9d4c4d54
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@161 38 <h4><a href="{{ topic.get_absolute_url }}">{{ topic.name }}</a></h4>
bgneal@161 39 {% if topic.page_range %}
bgneal@161 40 <span class="small">Goto page: [
bgneal@161 41 {% for n in topic.page_range %}
bgneal@161 42 {% if n %}
bgneal@161 43 <a href="{{ topic.get_absolute_url }}?page={{ n }}">{{ n }}</a>
bgneal@161 44 {% else %}
bgneal@161 45 &hellip;
bgneal@161 46 {% endif %}
bgneal@161 47 {% endfor %}
bgneal@161 48 ]</span>
bgneal@161 49 {% endif %}
bgneal@161 50 </td>
bgneal@83 51 <td class="forum-index_replies">{{ topic.reply_count }}</td>
bgneal@85 52 <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 53 <td class="forum-index_views">{{ topic.view_count }}</td>
bgneal@82 54 <td class="forum-index_last_post">
bgneal@120 55 {% last_post_info topic.last_post %}
bgneal@82 56 </td>
bgneal@82 57 </tr>
bgneal@82 58 {% empty %}
bgneal@82 59 <tr>
bgneal@111 60 <td colspan="5">
bgneal@82 61 <i>No topics available.</i>
bgneal@82 62 </td>
bgneal@82 63 </tr>
bgneal@82 64 {% endfor %}
bgneal@82 65 </tbody>
bgneal@82 66 </table>
bgneal@97 67 {{ page_nav }}
bgneal@113 68 {% if user.is_authenticated %}
bgneal@113 69 <a href="{% url forums-new_topic slug=forum.slug %}">New Topic</a> &bull;
bgneal@113 70 <form action="{% url forums-catchup slug=forum.slug %}" method="post" style="display:inline">
bgneal@113 71 <input type="submit" value="Mark All Topics Read" />
bgneal@113 72 </form>
bgneal@113 73 {% endif %}
bgneal@113 74 {% if can_moderate %}
bgneal@111 75 <p><a href="{% url forums-mod_forum slug=forum.slug %}">Moderate this forum</a></p>
bgneal@113 76 {% endif %}
bgneal@120 77 {% current_forum_time user %}
bgneal@82 78 </div>
bgneal@82 79 {% endblock %}