summaryrefslogtreecommitdiff
path: root/views/message_outbox.ejs
blob: e5c53e3dadda371b3586df84ac53fcb466f09e5b (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: "Outbox" }) %>
<script>
function delete_all() {
	let warning = "Are you sure you want to delete ALL the messages?";
	if (window.confirm(warning))
		window.location.href = "/outbox/delete";
}
</script>
<style>
table { width: 100%; max-width: 50em; }
tr.unread { background-color: lemonchiffon; }
td.to { width: 5em; }
td.time { text-align: right; width: 5em; }
td a { color:black; text-decoration: none; }
</style>
<table>
<tr><th>To<th>Subject<th>Date
<% if (messages.length > 0) { messages.forEach((row) => { %>
<tr class="<%- row.read ? "read" : "unread" %>">
<td class="nowrap to"><a href="/user/<%- row.to_name %>"><%= row.to_name %></a>
<td class="subject"><a href="/message/read/<%- row.message_id %>"><%= row.subject %></a>
<td class="nowrap time"><%= row.time %>
<% }); } else { %>
<tr><td colspan="3">No messages</td>
<% } %>
</table>
<p>
<button onclick="delete_all()">Delete all</button>