Populate those empty "activity" and "volume" columns. Show last posts. #315
[zzz-spline-forum.git] / splinext / forum / templates / forum / threads.mako
index 7df962b..cf510e7 100644 (file)
@@ -1,5 +1,6 @@
 <%inherit file="/base.mako" />
 <%namespace name="forumlib" file="/forum/lib.mako" />
+<%namespace name="userlib" file="/users/lib.mako" />
 
 <%def name="title()">${c.forum.name} - Forums</%def>
 
@@ -20,6 +21,7 @@ ${forumlib.hierarchy(c.forum)}
             <img src="${h.static_uri('spline', 'icons/folder-open-document-text.png')}" alt="">
             Thread
         </th>
+        <th class="stats">Last post</th>
         <th class="stats">Posts</th>
     </tr>
 </thead>
@@ -27,6 +29,15 @@ ${forumlib.hierarchy(c.forum)}
     % for thread in c.threads:
     <tr>
         <td class="name"><a href="${url(controller='forum', action='posts', forum_id=c.forum.id, thread_id=thread.id)}">${thread.subject}</a></td>
+        <td class="last-post">
+            % if thread.last_post:
+            ## XXX should do direct post link
+            <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>
+            <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>
+            % else:
+            —
+            % endif
+        </td>
         <td class="stats">${thread.post_count}</td>
     </tr>
     % endfor