cf510e770338599c71ca57e6f903e94cae46c5ac
[zzz-spline-forum.git] / splinext / forum / templates / forum / threads.mako
1 <%inherit file="/base.mako" />
2 <%namespace name="forumlib" file="/forum/lib.mako" />
3 <%namespace name="userlib" file="/users/lib.mako" />
4
5 <%def name="title()">${c.forum.name} - Forums</%def>
6
7 <%def name="title_in_page()">
8 <ul id="breadcrumbs">
9     <li><a href="${url(controller='forum', action='forums')}">Forums</a></li>
10     <li>${c.forum.name}</li>
11 </ul>
12 </%def>
13
14 <h1>Threads</h1>
15 ${forumlib.hierarchy(c.forum)}
16
17 <table class="forum-list striped-rows">
18 <thead>
19     <tr class="header-row">
20         <th class="name">
21             <img src="${h.static_uri('spline', 'icons/folder-open-document-text.png')}" alt="">
22             Thread
23         </th>
24         <th class="stats">Last post</th>
25         <th class="stats">Posts</th>
26     </tr>
27 </thead>
28 <tbody>
29     % for thread in c.threads:
30     <tr>
31         <td class="name"><a href="${url(controller='forum', action='posts', forum_id=c.forum.id, thread_id=thread.id)}">${thread.subject}</a></td>
32         <td class="last-post">
33             % if thread.last_post:
34             ## XXX should do direct post link
35             <a href="${url(controller='forum', action='posts', forum_id=c.forum.id, thread_id=thread.last_post.thread_id)}">${thread.last_post.posted_time}</a>
36             <br> by <a href="${url(controller='users', action='profile', id=thread.last_post.author.id, name=thread.last_post.author.name)}">${userlib.color_bar(thread.last_post.author)} ${thread.last_post.author.name}</a>
37             % else:
38             —
39             % endif
40         </td>
41         <td class="stats">${thread.post_count}</td>
42     </tr>
43     % endfor
44 </tbody>
45 </table>
46
47 ${forumlib.write_thread_form(c.forum)}