From 652852e3104ce4020de53231ee7691a4970439d6 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 1 May 2021 00:48:35 +0200 Subject: Add server and lobby code. --- views/info.ejs | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 views/info.ejs (limited to 'views/info.ejs') diff --git a/views/info.ejs b/views/info.ejs new file mode 100644 index 0000000..27cb543 --- /dev/null +++ b/views/info.ejs @@ -0,0 +1,83 @@ +<%- include('header', { title: title.title_name, refresh: (user ? 300 : 0) }) %> + +<%- include('../public/' + title.title_id + '/about.html') %> +
+

+Read more about the game on +boardgamegeek.com. + +<% if (user) { %> + +

Open Games

+ + +
IDScenarioOwnerDescriptionCreated +<% if (open_games.length > 0) { %> +<% open_games.forEach((row) => { %> +
<%= row.game_id %> +<%= row.scenario %> +<%= row.owner_name %> +<%= row.description %> +<%= row.ctime %> +Join +<% }); } else { %> +
No open games. +<% } %> +
+ +

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

Active Games

+ + +
IDScenarioPlayersDescriptionChangedTurn +<% active_games.forEach((row) => { %> +
<%= row.game_id %> +<%= row.scenario %> +<%= row.players.join(", ") %> +<%= row.description %> +<%= row.mtime %> +<% + if (row.your_turn) { + %><%= row.active %><% + } 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<% + } +%> +<% }); %> +
+<% } %> + +<% if (finished_games.length > 0) { %> +

Finished Games

+ + +
IDScenarioPlayersDescriptionFinishedResult +<% finished_games.forEach((row) => { %> +
<%= row.game_id %> +<%= row.scenario %> +<%= row.players.join(", ") %> +<%= row.description %> +<%= row.mtime %> +<%= row.result %> +View +<% }); %> +
+<% } %> + +<% } else { %> + +

+Login to create or join a game. + +<% } %> -- cgit v1.2.3