From 1a71184bcbf714d266e80d186fd666d393ed5981 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 19 Nov 2021 02:45:51 +0100 Subject: Clean up stylesheets. Don't show options in game lists. --- views/change_about.ejs | 6 ++- views/chat.ejs | 2 +- views/create.ejs | 4 ++ views/forum_edit.ejs | 5 +- views/forum_post.ejs | 2 +- views/forum_reply.ejs | 6 ++- views/forum_thread.ejs | 17 +++--- views/forum_view.ejs | 61 ++++++++++----------- views/games.ejs | 83 +++++++++++++++-------------- views/header.ejs | 61 ++++++++++----------- views/info.ejs | 120 ++++++++++++++++++++--------------------- views/join.ejs | 25 +++++---- views/message_inbox.ejs | 17 ++++-- views/message_outbox.ejs | 17 ++++-- views/message_read.ejs | 11 ++-- views/message_send.ejs | 2 +- views/profile.ejs | 136 +++++++++++++++++++++++------------------------ 17 files changed, 297 insertions(+), 278 deletions(-) (limited to 'views') diff --git a/views/change_about.ejs b/views/change_about.ejs index c87fc55..cbea0c5 100644 --- a/views/change_about.ejs +++ b/views/change_about.ejs @@ -1,9 +1,11 @@ -<%- include('header', { title: "Change profile text" }) %> +<%- include('header', { title: "Change profile text" }) -%>
- +

+

diff --git a/views/chat.ejs b/views/chat.ejs index 81697ee..d217857 100644 --- a/views/chat.ejs +++ b/views/chat.ejs @@ -1,4 +1,4 @@ -<%- include('header', { title: "Chat Log" }) %> +<%- include('header', { title: "Chat Log" }) -%>

- +

diff --git a/views/forum_post.ejs b/views/forum_post.ejs index aa24455..98d667c 100644 --- a/views/forum_post.ejs +++ b/views/forum_post.ejs @@ -1,4 +1,4 @@ -<%- include('header', { title: "New Thread" }) %> +<%- include('header', { title: "New Thread" }) -%> diff --git a/views/forum_reply.ejs b/views/forum_reply.ejs index 3e87ddd..db777b6 100644 --- a/views/forum_reply.ejs +++ b/views/forum_reply.ejs @@ -1,13 +1,15 @@ -<%- include('header', { title: thread.subject }) %> +<%- include('header', { title: thread.subject }) -%>
<%= post.author_name %> -<%= post.ctime %> <%= post.edited ? "(edited " + post.mtime + ")" : "" %> +<%= post.ctime %> <%= post.edited ? "(edited " + post.mtime + ")" : "" %>
<%- post.body %>
diff --git a/views/forum_thread.ejs b/views/forum_thread.ejs index 7232bce..5c76704 100644 --- a/views/forum_thread.ejs +++ b/views/forum_thread.ejs @@ -1,21 +1,22 @@ -<%- include('header', { title: thread.subject }) %> +<%- include('header', { title: thread.subject }) -%> <% posts.forEach((row) => { %>

<% if (user) { %> -
<%= row.author_name %> -<%= row.ctime %> +<%= row.ctime %> <%= row.edited ? "(edited " + row.mtime + ")" : "" %>
<%- row.body %>
+ <% if (row.author_id === user.user_id) { %> Edit <% } %> @@ -23,8 +24,6 @@ table .edit { text-align: right; border: none; } <% } %>
<% }); %> -<% -if (user) { - %>

Reply<% -} -%> +<% if (user) { %> +

Reply +<% } %> diff --git a/views/forum_view.ejs b/views/forum_view.ejs index 6838803..d5ebd46 100644 --- a/views/forum_view.ejs +++ b/views/forum_view.ejs @@ -1,40 +1,37 @@ -<%- include('header', { title: "Forum", refresh: 900 }) %> - - +<%- include('header', { title: "Forum", refresh: 900 }) -%> + +
- -
Subject -Author -Replies -Time - +Subject +Author +Replies +Time <% threads.forEach((row) => { %>
<%= row.subject %> -<%= row.author_name %> -<%= row.replies %> -<%= row.mtime %> +<%= row.subject %> +<%= row.author_name %> +<%= row.replies %> +<%= row.mtime %> <% }); %>
-<% -if (current_page > 1) { - %> <% -} -for (let p = 1; p <= page_count && p <= 30; ++p) { - if (p === current_page) { - %>(<%= p %>) <% - } else { - %><%= p %> <% - } -} -if (current_page < page_count) { - %> <% -} -%> +<% if (current_page > 1) { %> + +<% } %> +<% for (let p = 1; p <= page_count && p <= 30; ++p) { %> +<% if (p === current_page) { %> +(<%- p %>) +<% } else { %> +<%- p %> +<% } %> +<% } %> +<% if (current_page < page_count) { %> + +<% } %>
-<% -if (user) { - %>

New thread<% -} -%> +<% if (user) { %> +

New thread +<% } %> diff --git a/views/games.ejs b/views/games.ejs index 86a2502..90b2f68 100644 --- a/views/games.ejs +++ b/views/games.ejs @@ -1,50 +1,51 @@ -<%- include('header', { title: "All Public Games", refresh: (user ? 300 : 0) }) %> +<%- include('header', { title: "All Public Games", refresh: (user ? 300 : 0) }) -%>

Open

- -
IDTitleScenarioOptionsPlayersDescriptionCreated -<%_ if (open_games.length > 0) { _%> -<%_ open_games.forEach((row) => { _%> + + -
IDTitleScenarioPlayersDescriptionCreated +<% if (open_games.length > 0) { %> +<% open_games.forEach((row) => { %>
<%= row.game_id %> -<%= row.title_name %> -<%= row.scenario %> -<%- row.options %> -<%- row.player_names %> -<%= row.description %> -<%= row.ctime %> +<%= row.game_id %> +<%= row.title_name %> +<%= row.scenario %> +<%- row.player_names %> +<%= row.description %> +<%= row.ctime %> Join -<%_ }); } else { _%> -
No open games. -<%_ } _%> +<% }); } else { %> +
No open games. +<% } %>

Active

- -
IDTitleScenarioOptionsPlayersDescriptionChangedActive -<%_ if (active_games.length > 0) { _%> -<%_ active_games.forEach((row) => { _%> + + -
IDTitleScenarioPlayersDescriptionChangedActive +<% if (active_games.length > 0) { %> +<% active_games.forEach((row) => { %>
<%= row.game_id %> -<%= row.title_name %> -<%= row.scenario %> -<%- row.options %> -<%- row.player_names %> -<%= row.description %> -<%= row.mtime %> -"><%= row.active %> -<%_ - if (row.is_yours) { - if (row.is_shared) { - %>View<% - } else { - %>View<% - } - } else { - %>View<% - } -_%> -<%_ }); } else { _%> -
No active games. -<%_ } _%> +<%= row.game_id %> +<%= row.title_name %> +<%= row.scenario %> +<%- row.player_names %> +<%= row.description %> +<%= row.mtime %> +<% if (row.is_active) { %> +<%= row.active %> +<% } else { %> +<%= row.active %> +<% } %> +<% if (row.is_yours) { %> +<% if (row.is_shared) { %> +View +<% } else { %> +View +<% } %> +<% } else { %> +View +<% } %> +<% }); %> +<% } else { %> +
No active games. +<% } %>
diff --git a/views/header.ejs b/views/header.ejs index c8337fc..2628f8d 100644 --- a/views/header.ejs +++ b/views/header.ejs @@ -2,40 +2,35 @@ -<% if (typeof refresh !== 'undefined' && refresh > 0) { %><% } %> - +<% if (typeof refresh !== 'undefined' && refresh > 0) { _%> + +<% } _%> <%= title %> - + + + -
-
-
-About -Forum -<% - if (user) { - let unread = user.unread | 0; - if (unread > 0) { - %>Inbox (<%= unread %>)<% - } else { - %>Inbox<% - } - %>Profile (<%= user.name %>)<% - } else { - %>Signup<% - %>Login<% - } -%> -
-
-
+
+ + +
+

<%= title %>

-<% - if (typeof flash !== 'undefined' && flash.length > 0) { - %>

<%= Array.isArray(flash) ? flash.join("\n") : flash %>

<% - } -%> +<%_ if (typeof flash !== 'undefined' && flash.length > 0) { _%> +

<%= flash %>

+<%_ } _%> diff --git a/views/info.ejs b/views/info.ejs index 4a515ff..49625ed 100644 --- a/views/info.ejs +++ b/views/info.ejs @@ -1,84 +1,80 @@ -<%- include('header', { title: title.title_name, refresh: (user ? 300 : 0) }) _%> +<%- include('header', { title: title.title_name, refresh: (user ? 300 : 0) }) -%> -<%- include('../public/' + title.title_id + '/about.html') %> +<%- include('../public/' + title.title_id + '/about.html') -%>

Read more about the game on boardgamegeek.com.

Open Games

- -
IDScenarioOptionsPlayersDescriptionCreated -<%_ if (open_games.length > 0) { _%> -<%_ open_games.forEach((row) => { _%> + + -
IDScenarioPlayersDescriptionCreated +<% if (open_games.length > 0) { -%> +<% open_games.forEach((row) => { %>
<%= row.game_id %> -<%= row.scenario %> -<%- row.options %> -<%- row.player_names %> -<%= row.description %> -<%= row.ctime %> +<%= row.game_id %> +<%= row.scenario %> +<%- row.player_names %> +<%= row.description %> +<%= row.ctime %> Join -<%_ }); } else { _%> -
No open games. -<%_ } _%> +<% }); } else { %> +
No open games. +<% } %>

Create a new game. -<%_ if (active_games.length > 0) { _%> +<% if (active_games.length > 0) { %>

Active Games

- -
IDScenarioOptionsPlayersDescriptionChangedTurn -<%_ active_games.forEach((row) => { _%> +
IDScenarioPlayersDescriptionChangedTurn +<% active_games.forEach((row) => { %>
<%= row.game_id %> -<%= row.scenario %> -<%- row.options %> -<%- row.player_names %> -<%= row.description %> -<%= row.mtime %> -"><%= row.active %> -<%_ - if (row.is_yours) { - if (row.is_shared) { - %>Play<% - } else { - %>Play<% - } - } else { - %>View<% - - } -_%> -<%_ }); _%> +<%= row.game_id %> +<%= row.scenario %> +<%- row.player_names %> +<%= row.description %> +<%= row.mtime %> +<% if (row.is_active) { %> +<%= row.active %> +<% } else { %> +<%= row.active %> +<% } %> +<% if (row.is_yours) { %> +<% if (row.is_shared) { %> +Play +<% } else { %> +Play +<% } %> +<% } else { %> +View +<% } %> +<% }); %>
-<%_ } _%> +<% } %> -<%_ if (finished_games.length > 0) { _%> +<% if (finished_games.length > 0) { %>

Finished Games

- -
IDScenarioOptionsPlayersDescriptionFinishedResult -<%_ finished_games.forEach((row) => { _%> +
IDScenarioPlayersDescriptionFinishedResult +<% finished_games.forEach((row) => { %>
<%= row.game_id %> -<%= row.scenario %> -<%- row.options %> -<%- row.player_names %> -<%= row.description %> -<%= row.mtime %> -<%= row.result %> -<%_ - if (row.is_yours) { - if (row.is_shared) { - %>View<% - } else { - %>View<% - } - } else { - %>View<% - } -_%> -<%_ }); _%> +<%= row.game_id %> +<%= row.scenario %> +<%- row.player_names %> +<%= row.description %> +<%= row.mtime %> +<%= row.result %> +<% if (row.is_yours) { %> +<% if (row.is_shared) { %> +View +<% } else { %> +View +<% } %> +<% } else { %> +View +<% } %> +<% }); %>
-<%_ } _%> +<% } %> diff --git a/views/join.ejs b/views/join.ejs index 6558745..b4e4718 100644 --- a/views/join.ejs +++ b/views/join.ejs @@ -1,7 +1,8 @@ <%- include('header', { title: game.title_name }) -%> @@ -20,24 +21,30 @@ let ready = <%- ready %>;

Owner: <%= game.owner_name %> -
-Private: <%= game.private ? "yes" : "no" %> +<% if (game.private) { %> +(private) +<% } %>
Scenario: <%= game.scenario %>
Options: <%= game.options %> -
-Description: <%= game.description || "No description." %> + +

+<%= game.description || "No description." %>
-<% roles.forEach((role) => { %><% }); %> +<% roles.forEach((role) => { %> + +<% }); %> -<% roles.forEach((role) => { %><% }); %> +<% roles.forEach((role) => { %> + +<% }); %> - +
<%= role %><%= role %>
--
--

diff --git a/views/message_inbox.ejs b/views/message_inbox.ejs index e70e156..626662d 100644 --- a/views/message_inbox.ejs +++ b/views/message_inbox.ejs @@ -1,12 +1,19 @@ -<%- include('header', { title: "Inbox" }) %> +<%- include('header', { title: "Inbox" }) -%> +

Send message "> - +<% } else {%> + +<% } %> + <% } %> diff --git a/views/message_outbox.ejs b/views/message_outbox.ejs index c7ff379..a5d1abd 100644 --- a/views/message_outbox.ejs +++ b/views/message_outbox.ejs @@ -1,4 +1,7 @@ -<%- include('header', { title: "Outbox" }) %> +<%- include('header', { title: "Outbox" }) -%> + -
FromSubjectDate <% if (messages.length > 0) { messages.forEach((row) => { %> -
<%= row.from_name %> -<%= row.subject %> -<%= row.time %> +<% if (row.read) { %> +
<%= row.from_name %> +<%= row.subject %> +<%= row.time %> <% }); } else { %>
No messages
-
From: <%= message.from_name %> -
To: <%= message.to_name %> -
Date: <%= message.time %> + +
From:<%= message.from_name %> +
To:<%= message.to_name %> +
Date:<%= message.time %>
<%- message.body %>

diff --git a/views/message_send.ejs b/views/message_send.ejs index 4dafa3a..cea21e3 100644 --- a/views/message_send.ejs +++ b/views/message_send.ejs @@ -1,4 +1,4 @@ -<%- include('header', { title: "Send Message" }) %> +<%- include('header', { title: "Send Message" }) -%> diff --git a/views/profile.ejs b/views/profile.ejs index a001e21..a4a23fc 100644 --- a/views/profile.ejs +++ b/views/profile.ejs @@ -1,5 +1,5 @@ -<%- include('header', { title: "Rally the Troops!", refresh: (active_games.length > 0 ? 300 : 0) }) _%> - +<%- include('header', { title: "Rally the Troops!", refresh: (active_games.length > 0 ? 300 : 0) }) -%> +

Welcome, <%= user.name %>!

@@ -8,13 +8,11 @@ Your mail address is <%= user.mail %>.

» -<% - if (user.notify) { - %>Disable mail notifications<% - } else { - %>Enable mail notifications<% - } -%> +<% if (user.notify) { %> +Disable mail notifications +<% } else { %> +Enable mail notifications +<% } %>
» Change password, @@ -26,79 +24,79 @@ or profile text.
» Logout -<%_ if (open_games.length > 0) { _%> +<% if (open_games.length > 0) { %>

Open Games

- -
IDGameScenarioOptionsPlayersDescriptionCreated -<%_ open_games.forEach((row) => { _%> + + + +<% open_games.forEach((row) => { %> -
IDGameScenarioPlayersDescriptionCreated +
<%= row.game_id %> -<%= row.title_name %> -<%= row.scenario %> -<%- row.options %> -<%- row.player_names %> -<%= row.description %> -<%= row.ctime %> +<%= row.game_id %> +<%= row.title_name %> +<%= row.scenario %> +<%- row.player_names %> +<%= row.description %> +<%= row.ctime %> Join -<%_ }); _%> +<% }); %>
-<%_ } _%> +<% } %> -<%_ if (active_games.length > 0) { _%> +<% if (active_games.length > 0) { %>

Active Games

- + +<% active_games.forEach((row) => { %> -
IDGameScenarioOptionsPlayersDescriptionChangedTurn -<%_ active_games.forEach((row) => { _%> +
IDGameScenarioPlayersDescriptionChangedTurn +
<%= row.game_id %> -<%= row.title_name %> -<%= row.scenario %> -<%- row.options %> -<%- row.player_names %> -<%= row.description %> -<%= row.mtime %> -<%_ - if (row.is_active) { - %><%= row.active %><% - } else { - %><%= row.active %><% - } - if (row.is_shared) { - %>Play<% - } else { - %>Play<% - } -_%> -<%_ }); _%> +<%= row.game_id %> +<%= row.title_name %> +<%= row.scenario %> +<%- row.player_names %> +<%= row.description %> +<%= row.mtime %> +<% if (row.is_active) { %> +<%= row.active %> +<% } else { %> +<%= row.active %> +<% } %> +<% if (row.is_shared) { %> +Play +<% } else { %> +Play +<% } %> +<% }); %>
-<%_ } _%> +<% } %> -<%_ if (finished_games.length > 0) { _%> +<% if (finished_games.length > 0) { %>

Finished Games

- -
IDGameScenarioOptionsPlayersDescriptionFinishedResult -<%_ finished_games.forEach((row) => { _%> + + + +<% finished_games.forEach((row) => { %> -
IDGameScenarioPlayersDescriptionFinishedResult +
<%= row.game_id %> -<%= row.title_name %> -<%= row.scenario %> -<%- row.options %> -<%- row.player_names %> -<%= row.description %> -<%= row.mtime %> -<%= row.result %> -<%_ - if (row.is_shared) { - %>View<% - } else { - %>View<% - } -_%> -<%_ }); _%> +<%= row.game_id %> +<%= row.title_name %> +<%= row.scenario %> +<%- row.player_names %> +<%= row.description %> +<%= row.mtime %> +<%= row.result %> +<% if (row.is_shared) { %> +View +<% } else { %> +View +<% } %> +<% }); %>
-<%_ } _%> +<% } %> -<%_ if (open_games.length === 0 && active_games.length === 0 && finished_games.length === 0) { _%> +<% if (open_games.length === 0 && active_games.length === 0 && finished_games.length === 0) { %>

You don't have any current or finished games. -<%_ } _%> +<% } %> -- cgit v1.2.3