diff options
Diffstat (limited to 'views')
-rw-r--r-- | views/forum_thread.ejs | 3 | ||||
-rw-r--r-- | views/forum_view.ejs | 9 | ||||
-rw-r--r-- | views/games.ejs | 4 | ||||
-rw-r--r-- | views/info.ejs | 9 | ||||
-rw-r--r-- | views/message_inbox.ejs | 10 | ||||
-rw-r--r-- | views/message_outbox.ejs | 15 | ||||
-rw-r--r-- | views/profile.ejs | 15 | ||||
-rw-r--r-- | views/users.ejs | 2 |
8 files changed, 39 insertions, 28 deletions
diff --git a/views/forum_thread.ejs b/views/forum_thread.ejs index fad8829..0041f20 100644 --- a/views/forum_thread.ejs +++ b/views/forum_thread.ejs @@ -2,6 +2,7 @@ <style> table { width: 100%; max-width: 50em; } td.body { white-space: pre-wrap; padding: 10px 10px; } +th a { color: black; text-decoration: none; } th.author { border-right: none; } th.time { text-align: right; border-left: none; font-weight: normal; } td.edit { text-align: right; border: none; } @@ -10,7 +11,7 @@ td.edit { text-align: right; border: none; } <p> <table> <tr> -<th class="nowrap author"><%= row.author_name %> +<th class="nowrap author"><a href="/user/<%- row.author_name %>"><%= row.author_name %></a> <th class="nowrap time"><%= row.ctime %> <%= row.edited ? "(edited " + row.mtime + ")" : "" %> <tr> diff --git a/views/forum_view.ejs b/views/forum_view.ejs index 7c3de75..5f04f3f 100644 --- a/views/forum_view.ejs +++ b/views/forum_view.ejs @@ -3,16 +3,19 @@ table { width: 100%; max-width: 60em; } td a { color: black; text-decoration: none; } tfoot td { background-color: gainsboro; } +th.replies { width: 3em; } +th.time { width: 5em; } +th.author { width: 10em; } </style> <table> <thead> -<tr><th>Subject<th>Author -<th>Replies<th>Time +<tr><th class="subject">Subject<th class="author">Author +<th class="replies">Replies<th class="time">Time </thead> <% threads.forEach((row) => { %> <tr> <td class="ellipsis"><a href="/forum/thread/<%- row.thread_id %>"><%= row.subject %></a> -<td class="nowrap"><%= row.author_name %> +<td class="nowrap"><a href="/user/<%- row.author_name %>"><%= row.author_name %></a> <td><%= row.reply_count %> <td class="nowrap"><%= row.mtime %> <% }); %> diff --git a/views/games.ejs b/views/games.ejs index e25df1f..b74dbba 100644 --- a/views/games.ejs +++ b/views/games.ejs @@ -12,7 +12,7 @@ td.nowrap a { color: black; text-decoration: none; } <td><%= row.game_id %> <td class="nowrap"><a href="/info/<%= row.title_id %>"><%= row.title_name %></a> <td><%= row.scenario %> -<td><%= row.player_names || row.owner_name %> +<td><%- row.player_names || row.owner_name %> <td><%= row.description %> <td class="nowrap"><%= row.ctime %> <td><a href="/join/<%= row.game_id %>">Join</a> @@ -30,7 +30,7 @@ td.nowrap a { color: black; text-decoration: none; } <td><%= row.game_id %> <td class="nowrap"><a href="/info/<%= row.title_id %>"><%= row.title_name %></a> <td><%= row.scenario %> -<td><%= row.player_names %> +<td><%- row.player_names %> <td><%= row.description %> <td class="nowrap"><%= row.mtime %> <td class="<%= row.is_your_turn ? "is_your_turn" : "" %>"><%= row.active_role %> diff --git a/views/info.ejs b/views/info.ejs index 778974e..159e732 100644 --- a/views/info.ejs +++ b/views/info.ejs @@ -1,4 +1,7 @@ <%- include('header', { title: title.title_name, refresh: (user ? 300 : 0) }) %> +<style> +td.names a { color: black; text-decoration: none; } +</style> <img class="logo" src="/<%= title.title_id %>/cover.jpg"> <%- include('../public/' + title.title_id + '/about.html') %> <p> @@ -15,7 +18,7 @@ Read more about the game on <tr> <td><%= row.game_id %> <td><%= row.scenario %> -<td><%= row.player_names || row.owner_name %> +<td class="names"><%- row.player_names || `<a href="/user/${row.owner_name}">${row.owner_name}</a>` %> <td><%= row.description %> <td class="nowrap"><%= row.ctime %> <td><a href="/join/<%= row.game_id %>">Join</a> @@ -35,7 +38,7 @@ Read more about the game on <tr> <td><%= row.game_id %> <td><%= row.scenario %> -<td><%= row.player_names %> +<td class="names"><%- row.player_names %> <td><%= row.description %> <td class="nowrap"><%= row.mtime %> <td class="<%= row.is_your_turn ? "is_your_turn" : "" %>"><%= row.active_role %> @@ -52,7 +55,7 @@ Read more about the game on <tr> <td><%= row.game_id %> <td><%= row.scenario %> -<td><%= row.player_names %> +<td class="names"><%- row.player_names %> <td><%= row.description %> <td class="nowrap"><%= row.mtime %> <td><%= row.result %> diff --git a/views/message_inbox.ejs b/views/message_inbox.ejs index 91490ac..16b0c46 100644 --- a/views/message_inbox.ejs +++ b/views/message_inbox.ejs @@ -1,23 +1,21 @@ <%- include('header', { title: "Inbox" }) %> <style> table { width: 100%; max-width: 50em; } -tr.unread { background-color: lemonchiffon; } +tr.unread { background-color: lightyellow; } td.from { 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="/outbox">Outbox</a> +<p><a href="/message/send">Send message</a> <table> <tr><th>From<th>Subject<th>Date <% if (messages.length > 0) { messages.forEach((row) => { %> <tr class="<%- row.read ? "read" : "unread" %>"> -<td class="nowrap from"><%= row.from_name %> +<td class="nowrap from"><a href="/user/<%- row.from_name %>"><%= row.from_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><a href="/outbox">Outbox</a> 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> diff --git a/views/profile.ejs b/views/profile.ejs index 8d03234..3c49014 100644 --- a/views/profile.ejs +++ b/views/profile.ejs @@ -1,6 +1,6 @@ <%- include('header', { title: "Rally the Troops!", refresh: (active_games.length > 0 ? 300 : 0) }) %> <style> -td.nowrap a { color: black; text-decoration: none; } +td.game a, td.names a { color: black; text-decoration: none; } .logo { width: 80px; height: 80px; } </style> @@ -23,6 +23,7 @@ Your mail address is <%= user.mail %>. <li><a href="/change_password">Change password</a> <li><a href="/change_mail">Change mail address</a> <li><a href="/change_name">Change name</a> +<li><a href="/change_about">Change profile text</a> <li><a href="/logout">Logout</a> </ul> @@ -33,9 +34,9 @@ Your mail address is <%= user.mail %>. <% open_games.forEach((row) => { %> <tr> <td><%= row.game_id %> -<td class="nowrap"><a href="/info/<%= row.title_id %>"><%= row.title_name %></a> +<td class="nowrap game"><a href="/info/<%= row.title_id %>"><%= row.title_name %></a> <td><%= row.scenario %> -<td><%= row.player_names %> +<td class="names"><%- row.player_names %> <td><%= row.description %> <td class="nowrap"><%= row.ctime %> <td><a href="/join/<%= row.game_id %>">Join</a> @@ -50,9 +51,9 @@ Your mail address is <%= user.mail %>. <% active_games.forEach((row) => { %> <tr> <td><%= row.game_id %> -<td class="nowrap"><a href="/info/<%= row.title_id %>"><%= row.title_name %></a> +<td class="nowrap game"><a href="/info/<%= row.title_id %>"><%= row.title_name %></a> <td><%= row.scenario %> -<td><%= row.player_names %> +<td class="names"><%- row.player_names %> <td><%= row.description %> <td class="nowrap"><%= row.mtime %> <% @@ -78,9 +79,9 @@ Your mail address is <%= user.mail %>. <% finished_games.forEach((row) => { %> <tr> <td><%= row.game_id %> -<td class="nowrap"><a href="/info/<%= row.title_id %>"><%= row.title_name %></a> +<td class="nowrap game"><a href="/info/<%= row.title_id %>"><%= row.title_name %></a> <td><%= row.scenario %> -<td><%= row.player_names %> +<td class="names"><%- row.player_names %> <td><%= row.description %> <td class="nowrap"><%= row.mtime %> <td><%= row.result %> diff --git a/views/users.ejs b/views/users.ejs index 526b722..d6e4d4a 100644 --- a/views/users.ejs +++ b/views/users.ejs @@ -10,7 +10,7 @@ td.avatar img{display:block;width:80px;height:80px;} <% userList.forEach((row) => { %> <tr> <td class="avatar"><img src="<%= row.avatar %>"> -<td><a href="/user/<%= row.user_id %>"><%= row.name %></a> +<td><a href="/user/<%= row.name %>"><%= row.name %></a> <td><%= row.ctime %> <td><%= row.atime %> <% }); %> |