view gpp/templates/forums/index.html @ 197:2baadae33f2e

Got autocomplete working for the member search. Updated django and ran into a bug where url tags with comma separated kwargs starting consuming tons of CPU throughput. The work-around is to cut over to using spaces between arguments. This is now allowed to be consistent with other tags. Did some query optimization for the news app.
author Brian Neal <bgneal@gmail.com>
date Sat, 10 Apr 2010 04:32:24 +0000
parents 6f14970b103a
children 423c39ee44e0
line wrap: on
line source
{% extends 'base.html' %}
{% load cache %}
{% load forum_tags %}
{% block custom_head %}
{% for feed in feeds %}
<link rel="alternate" type="application/rss+xml" title="{{ feed.name }}" href="{{ feed.feed }}" />
{% endfor %}
{% endblock %}
{% block title %}Forums{% endblock %}
{% block content %}
<h2>Forums <a href="/feeds/forums/"><img src="{{ MEDIA_URL }}icons/feed.png" alt="Forums Feed" title="Forums Feed" /></a></h2>

<form action="." method="get" id="forum-query-form">
   <select name="query">
      <option value="unread">Show topics with unread posts</option>
      <option value="mine">Show my posts</option>
      <option value="unanswered">Show unanswered posts</option>
   </select><input type="submit" value="Go" />
</form>

<div class="forum-block">
{% for iter in cats %}
   <h3>{{ iter.cat }}</h3>
   <table class="forum-index-table">
      <thead>
         <tr>
            <th class="forum-title">Forum</th>
            <th class="forum-topics">Topics</th>
            <th class="forum-posts">Posts</th>
            <th class="forum-last_post">Last Post</th>
         </tr>
      </thead>
      <tbody>
         {% for forum in iter.forums %}
            <tr class="{% cycle 'odd' 'even' %}">
               <td>
                  {% if forum.has_unread %}
                  <img src="{{ MEDIA_URL }}icons/new.png" alt="New Posts" title="New Posts" class="forums-topic-icon" />
                  {% endif %}
                  <h4><a href="{{ forum.get_absolute_url }}">{{ forum.name }}</a>
                     {% if forum.has_feed %}
                     <a href="/feeds/forums/{{ forum.slug }}">
                        <img src="{{ MEDIA_URL }}icons/feed.png" alt="RSS Feed" title="Feed for this forum" /></a>
                     {% endif %}</h4>
                  <p>{{ forum.description }}</p></td>
               <td class="forum-topics">{{ forum.topic_count }}</td>
               <td class="forum-posts">{{ forum.post_count }}</td>
               <td class="forum-last_post">{% last_post_info forum.last_post %}</td>
            </tr>
         {% endfor %}
      </tbody>
   </table>
{% endfor %}
{% cache 900 forum-stats-block %}
{% forum_stats %}
{% endcache %}
{% whos_online %}
<p>{% current_forum_time user %}</p>
</div>
{% endblock %}