From 401a13ff9e7792f0e060ccfb15afdbd3bc5fc557 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 28 Jun 2021 12:38:42 +0200 Subject: Clean up SQL and use table views. --- views/info.ejs | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'views/info.ejs') diff --git a/views/info.ejs b/views/info.ejs index 55b8faa..02ce2dd 100644 --- a/views/info.ejs +++ b/views/info.ejs @@ -9,13 +9,13 @@ Read more about the game on

Open Games

-
IDScenarioOwnerDescriptionCreated +
IDScenarioPlayersDescriptionCreated <% if (open_games.length > 0) { %> <% open_games.forEach((row) => { %>
<%= row.game_id %> <%= row.scenario %> -<%= row.owner_name %> +<%= row.player_names || row.owner_name %> <%= row.description %> <%= row.ctime %> Join @@ -35,23 +35,16 @@ Read more about the game on
<%= row.game_id %> <%= row.scenario %> -<%= row.players.join(", ") %> +<%= row.player_names %> <%= row.description %> <%= row.mtime %> <% - if (row.your_turn) { - %><%= row.active %><% + if (row.is_your_turn) { + %><%= row.active_role %><% } else { - %><%= row.active %><% - } - let me = row.players.reduce((n,p) => n + (p === user.name ? 1 : 0), 0); - if (me == 1) { - %>Play<% - } else if (me > 1) { - %>Play<% - } else { - %>View<% + %><%= row.active_role %><% } + %>Enter<% %> <% }); %>
@@ -65,7 +58,7 @@ Read more about the game on <%= row.game_id %> <%= row.scenario %> -<%= row.players.join(", ") %> +<%= row.player_names %> <%= row.description %> <%= row.mtime %> <%= row.result %> -- cgit v1.2.3