summaryrefslogtreecommitdiff
path: root/views/forum_thread.ejs
blob: 7232bce05379ead94c3f142db10487ecb4e32a99 (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
<%- include('header', { title: thread.subject }) %>
<style>
table .author { border-right: none; }
table .time { border-left: none; font-weight: normal; }
table .edit { text-align: right; 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="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><%
}
%>