summaryrefslogtreecommitdiff
path: root/views/forum_thread.ejs
blob: 5c7670437a724c6bca4e2634949fbe1459206949 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<%- include('header', { title: thread.subject }) -%>
<style>
table { max-width: 50em; }
table .author { border-right: none; }
table .time { border-left: none; font-weight: normal; }
table .command { border: none; }
</style>
<% posts.forEach((row) => { %>
<p>
<table class="post">
<tr>
<th class="author"><a href="/user/<%- row.author_name %>"><%= row.author_name %></a>
<th class="r time"><%= row.ctime %>
<%= row.edited ? "(edited " + row.mtime + ")" : "" %>
<tr>
<td class="body" colspan="2"><%- row.body %></td>
<% if (user) { %>
<tr>
<td class="r command" colspan=2>
<% if (row.author_id === user.user_id) { %>
<a href="/forum/edit/<%- row.post_id %>">Edit</a>
<% } %>
<a href="/forum/reply/<%- row.post_id %>">Reply</a>
<% } %>
</table>
<% }); %>
<% if (user) { %>
<p><a href="/forum/reply/<%- posts[0].post_id %>">Reply</a>
<% } %>