1 <%inherit file="/base.mako" />
2 <%namespace name="forumlib" file="/forum/lib.mako" />
3 <%namespace name="userlib" file="/users/lib.mako" />
5 <%def name="title()">Forums</%def>
8 <table class="forum-list striped-rows">
10 <tr class="header-row">
12 <img src="${h.static_uri('spline', 'icons/folders-stack.png')}" alt="">
15 <th class="last-post">Last post</th>
16 <th class="stats">Volume</th>
17 <th class="stats">Activity</th>
21 % for forum in c.forums:
24 <a href="${url(controller='forum', action='threads', forum_id=forum.id)}">${forum.name}</a>
25 ${forumlib.forum_access_level(forum)}
26 % if forum.description:
27 <div class="forum-description">
33 <td class="last-post">
34 <% last_post = c.last_post.get(forum.id, None) %> \
36 ## XXX should do direct post link
37 <a href="${url(controller='forum', action='posts', forum_id=forum.id, thread_id=last_post.thread_id)}">${last_post.posted_time}</a>
38 <br> in <a href="${url(controller='forum', action='posts', forum_id=forum.id, thread_id=last_post.thread_id)}">${last_post.thread.subject}</a>
39 <br> by <a href="${url(controller='users', action='profile', id=last_post.author.id, name=last_post.author.name)}">${userlib.color_bar(last_post.author)} ${last_post.author.name}</a>
45 <% relative_volume = c.forum_volume[forum.id] / c.max_volume %>\
47 % if relative_volume < 0.1:
49 % elif relative_volume < 0.33:
51 % elif relative_volume < 0.5:
53 % elif relative_volume < 0.67:
55 % elif relative_volume < 0.9:
61 ${"{0:3.1f}".format(c.forum_volume[forum.id] * 100)}%
63 <% activity = c.forum_activity[forum.id] %>\
67 % elif activity < 0.5:
69 % elif activity < 1.0:
71 % elif activity < 2.0:
73 % elif activity < 4.0:
79 ${"{0:0.3f}".format(activity)}