summaryrefslogtreecommitdiff
path: root/views/forum_thread.ejs
blob: 0041f2083d1b78622e4399062c1a893a2b6d250f (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
30
31
32
33
<%- include('header', { title: thread.subject }) %>
<style>
table { width: 100%; max-width: 50em; }
td.body { white-space: pre-wrap; padding: 10px 10px; }
th a { color: black; text-decoration: none; }
th.author { border-right: none; }
th.time { text-align: right; border-left: none; font-weight: normal; }
td.edit { text-align: right; border: none; }
</style>
<% posts.forEach((row) => { %>
<p>
<table>
<tr>
<th class="nowrap author"><a href="/user/<%- row.author_name %>"><%= row.author_name %></a>
<th class="nowrap time"><%= row.ctime %>
<%= row.edited ? "(edited " + row.mtime + ")" : "" %>
<tr>
<td class="body" colspan="2"><%- row.body %></td>
<% if (user) { %>
<tr>
<td class="edit" 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><%
}
%>