summaryrefslogtreecommitdiff
path: root/views/message_read.ejs
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2021-11-10 22:27:46 +0100
committerTor Andersson <tor@ccxvii.net>2021-11-13 18:38:17 +0100
commit0d0dab23fb0ecf16a2abf54295746d7dbd87c2d7 (patch)
tree84c1ba816d81659860630fa7eb5a798605425161 /views/message_read.ejs
parent66450e7666abdaced2347825a4b9e13bc0528251 (diff)
downloadserver-0d0dab23fb0ecf16a2abf54295746d7dbd87c2d7.tar.gz
Massive SQL cleanup.
Diffstat (limited to 'views/message_read.ejs')
-rw-r--r--views/message_read.ejs24
1 files changed, 9 insertions, 15 deletions
diff --git a/views/message_read.ejs b/views/message_read.ejs
index 28762cf..7b32eda 100644
--- a/views/message_read.ejs
+++ b/views/message_read.ejs
@@ -1,10 +1,4 @@
-<%- 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>
+<%- include('header', { title: message.subject }) %>
<script>
function delete_message(id) {
let warning = "Are you sure you want to DELETE this message?";
@@ -15,14 +9,14 @@ 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 class="post">
+<tr><th>From:<td> <a href="/user/<%- message.from_name %>"><%= message.from_name %></a>
+<tr><th>To:<td> <a href="/user/<%- message.to_name %>"><%= message.to_name %></a>
+<tr><th>Date:<td> <%= message.time %>
+<tr><td colspan="2" class="body"><%- message.body %></td>
</table>
<p>
-<% if ( mail.from_id !== user.user_id ) { %>
-<button onclick="reply_message(<%- mail.message_id %>)">Reply</button>
+<% if ( 1 || message.from_id !== user.user_id ) { %>
+<button onclick="reply_message(<%- message.message_id %>)">Reply</button>
<% } %>
-<button onclick="delete_message(<%- mail.message_id %>)">Delete</button>
+<button onclick="delete_message(<%- message.message_id %>)">Delete</button>