annotate 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
rev   line source
bgneal@81 1 {% extends 'base.html' %}
bgneal@382 2 {% load url from future %}
bgneal@520 3 {% load accounts_tags %}
bgneal@164 4 {% load cache %}
bgneal@84 5 {% load forum_tags %}
bgneal@227 6 {% load core_tags %}
bgneal@170 7 {% block custom_head %}
bgneal@170 8 {% for feed in feeds %}
bgneal@170 9 <link rel="alternate" type="application/rss+xml" title="{{ feed.name }}" href="{{ feed.feed }}" />
bgneal@170 10 {% endfor %}
bgneal@280 11 {% include "forums/forum_query.js" %}
bgneal@170 12 {% endblock %}
bgneal@81 13 {% block title %}Forums{% endblock %}
bgneal@81 14 {% block content %}
bgneal@312 15 <h2>Forums <a href="/feeds/forums/"><img src="{{ STATIC_URL }}icons/feed.png" alt="Forums Feed" title="Forums Feed" /></a></h2>
bgneal@81 16
bgneal@280 17 {% include "forums/forum_query.html" %}
bgneal@167 18
bgneal@81 19 <div class="forum-block">
bgneal@81 20 {% for iter in cats %}
bgneal@81 21 <h3>{{ iter.cat }}</h3>
bgneal@81 22 <table class="forum-index-table">
bgneal@81 23 <thead>
bgneal@81 24 <tr>
bgneal@81 25 <th class="forum-title">Forum</th>
bgneal@81 26 <th class="forum-topics">Topics</th>
bgneal@81 27 <th class="forum-posts">Posts</th>
bgneal@81 28 <th class="forum-last_post">Last Post</th>
bgneal@81 29 </tr>
bgneal@81 30 </thead>
bgneal@81 31 <tbody>
bgneal@81 32 {% for forum in iter.forums %}
bgneal@94 33 <tr class="{% cycle 'odd' 'even' %}">
bgneal@113 34 <td>
bgneal@113 35 {% if forum.has_unread %}
bgneal@374 36 <a href="{{ forum.get_absolute_url }}"><img src="{{ STATIC_URL }}icons/new.png" alt="New Posts" title="New Posts" class="forums-topic-icon" /></a>
bgneal@113 37 {% endif %}
bgneal@263 38 <h4><a href="{{ forum.get_absolute_url }}">{{ forum.name }}</a></h4>
bgneal@263 39 <p>{{ forum.description }}</p>
bgneal@263 40 </td>
bgneal@81 41 <td class="forum-topics">{{ forum.topic_count }}</td>
bgneal@81 42 <td class="forum-posts">{{ forum.post_count }}</td>
bgneal@120 43 <td class="forum-last_post">{% last_post_info forum.last_post %}</td>
bgneal@81 44 </tr>
bgneal@81 45 {% endfor %}
bgneal@81 46 </tbody>
bgneal@81 47 </table>
bgneal@81 48 {% endfor %}
bgneal@382 49 <form action="{% url 'forums-catchup_all' %}" method="post">{% csrf_token %}
bgneal@382 50 <input type="submit" value="Mark All Forums Read" />
bgneal@382 51 </form>
bgneal@382 52 <br />
bgneal@520 53 {% user_stats %}
bgneal@164 54 {% cache 900 forum-stats-block %}
bgneal@520 55 {% forum_stats %}
bgneal@520 56 {% endcache %}
bgneal@520 57 {% cache 900 max-users-block %}
bgneal@520 58 {% max_users %}
bgneal@164 59 {% endcache %}
bgneal@160 60 {% whos_online %}
bgneal@120 61 <p>{% current_forum_time user %}</p>
bgneal@81 62 </div>
bgneal@81 63 {% endblock %}