summaryrefslogtreecommitdiff
path: root/views/message_read.ejs
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2021-11-09 21:26:10 +0100
committerTor Andersson <tor@ccxvii.net>2021-11-09 22:59:49 +0100
commit86ee8f02d4230199378eb055a5a89c15844208c9 (patch)
treeb994aa12092c2993541bfcd787cf67ff80347a8e /views/message_read.ejs
parenteb12dd7700dfceff88d8d68acc720d86cdf90e05 (diff)
downloadserver-86ee8f02d4230199378eb055a5a89c15844208c9.tar.gz
Messages.
Diffstat (limited to 'views/message_read.ejs')
-rw-r--r--views/message_read.ejs27
1 files changed, 27 insertions, 0 deletions
diff --git a/views/message_read.ejs b/views/message_read.ejs
new file mode 100644
index 0000000..f4a791e
--- /dev/null
+++ b/views/message_read.ejs
@@ -0,0 +1,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>