summaryrefslogtreecommitdiff
path: root/views/message_read.ejs
blob: 28762cf1544d3a0f3c21f0e38cb475d5ce9f4409 (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
<%- include('header', { title: mail.subject }) %>
<style>
table { width: 100%; max-width: 50em; }
th { width: 5em; font-weight: normal; }
td.body { white-space: pre-wrap; padding: 10px 10px; }
td a { color: black; text-decoration: none; }
</style>
<script>
function delete_message(id) {
	let warning = "Are you sure you want to DELETE this message?";
	if (window.confirm(warning))
		window.location.href = "/message/delete/" + id;
}
function reply_message(id) {
	window.location.href = "/message/reply/" + id;
}
</script>
<table>
<tr><th>From:<td> <a href="/user/<%- mail.from_name %>"><%= mail.from_name %></a>
<tr><th>To:<td> <a href="/user/<%- mail.to_name %>"><%= mail.to_name %></a>
<tr><th>Date:<td> <%= mail.time %>
<tr><td colspan="2" class="body"><%= mail.body %></td>
</table>
<p>
<% if ( mail.from_id !== user.user_id ) { %>
<button onclick="reply_message(<%- mail.message_id %>)">Reply</button>
<% } %>
<button onclick="delete_message(<%- mail.message_id %>)">Delete</button>