diff options
Diffstat (limited to 'views/message_outbox.ejs')
-rw-r--r-- | views/message_outbox.ejs | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/views/message_outbox.ejs b/views/message_outbox.ejs index c460bd3..e5c53e3 100644 --- a/views/message_outbox.ejs +++ b/views/message_outbox.ejs @@ -1,4 +1,11 @@ <%- 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; } @@ -6,18 +13,16 @@ td.to { width: 5em; } td.time { text-align: right; width: 5em; } td a { color:black; text-decoration: none; } </style> -<p> -» <a href="/message/send">Send message</a> -<br> -» <a href="/inbox">Inbox</a> <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"><%= row.to_name %> +<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> |