From 327acfe1124cdafc5eb460a039222a160f867ba3 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 17 Nov 2021 13:39:16 +0100 Subject: Simplify URL for playing games. --- views/profile.ejs | 55 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 23 deletions(-) (limited to 'views/profile.ejs') diff --git a/views/profile.ejs b/views/profile.ejs index 4d97486..a001e21 100644 --- a/views/profile.ejs +++ b/views/profile.ejs @@ -1,4 +1,4 @@ -<%- 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 %>! @@ -26,70 +26,79 @@ or profile text.
» Logout -<% if (open_games.length > 0) { %> +<%_ if (open_games.length > 0) { _%>

Open Games

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

Active Games

-
IDGameScenarioPlayersDescriptionChangedTurn -<% active_games.forEach((row) => { %> +
IDGameScenarioOptionsPlayersDescriptionChangedTurn +<%_ active_games.forEach((row) => { _%>
<%= 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) { - %>Enter<% + %>Play<% } else { - %>Play<% + %>Play<% } -%> -<% }); %> +_%> +<%_ }); _%>
-<% } %> +<%_ } _%> -<% if (finished_games.length > 0) { %> +<%_ if (finished_games.length > 0) { _%>

Finished Games

-
IDGameScenarioPlayersDescriptionFinishedResult -<% finished_games.forEach((row) => { %> +
IDGameScenarioOptionsPlayersDescriptionFinishedResult +<%_ finished_games.forEach((row) => { _%>
<%= row.game_id %> <%= row.title_name %> <%= row.scenario %> +<%- row.options %> <%- row.player_names %> <%= row.description %> <%= row.mtime %> <%= row.result %> -View -<% }); %> +<%_ + 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