view gpp/templates/forums/index.html @ 520:e94570675664

Created stats for users (number of users and list of newest users). Better separated the forums, who's online, and user stats. Use a Celery task to execute the new user stats processing. This addresses #194 and #238.
author Brian Neal <bgneal@gmail.com>
date Sat, 17 Dec 2011 23:19:15 +0000
parents a1b03de20345
children 82b97697312e
line wrap: on
line source
{% extends 'base.html' %}
{% load url from future %}
{% load accounts_tags %}
{% load cache %}
{% load forum_tags %}
{% load core_tags %}
{% block custom_head %}
{% for feed in feeds %}
<link rel="alternate" type="application/rss+xml" title="{{ feed.name }}" href="{{ feed.feed }}" />
{% endfor %}
{% include "forums/forum_query.js" %}
{% endblock %}
{% block title %}Forums{% endblock %}
{% block content %}
<h2>Forums <a href="/feeds/forums/"><img src="{{ STATIC_URL }}icons/feed.png" alt="Forums Feed" title="Forums Feed" /></a></h2>

{% include "forums/forum_query.html" %}

<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 %}
                  <a href="{{ forum.get_absolute_url }}"><img src="{{ STATIC_URL }}icons/new.png" alt="New Posts" title="New Posts" class="forums-topic-icon" /></a>
                  {% endif %}
                  <h4><a href="{{ forum.get_absolute_url }}">{{ forum.name }}</a></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 %}
<form action="{% url 'forums-catchup_all' %}" method="post">{% csrf_token %}
   <input type="submit" value="Mark All Forums Read" />
</form>
<br />
{% user_stats %}
{% cache 900 forum-stats-block %}
   {% forum_stats %}
{% endcache %}
{% cache 900 max-users-block %}
   {% max_users %}
{% endcache %}
{% whos_online %}
<p>{% current_forum_time user %}</p>
</div>
{% endblock %}