summaryrefslogtreecommitdiff
path: root/views/message_read.ejs
blob: f4a791ebf71de3e5a2b5f57fff94bca9b3556e15 (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
<%- 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; }
</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> <%= mail.from_name %>
<tr><th>To:<td> <%= mail.to_name %>
<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>