<%- include('header', { title: "Rally the Troops!", refresh: (active_games.length > 0 ? 300 : 0) }) %>

Welcome, <%= user.name %>!

Your mail address is <%= user.mail %>.

Change password

Logout <% if (open_games.length > 0) { %>

Open Games

IDGameScenarioPlayersDescriptionCreated <% open_games.forEach((row) => { %>
<%= row.game_id %> <%= row.title_name %> <%= row.scenario %> <%= row.players.join(", ") %> <%= row.description %> <%= row.ctime %> Join <% }); %>
<% } %> <% if (active_games.length > 0) { %>

Active Games

IDGameScenarioPlayersDescriptionChangedTurn <% active_games.forEach((row) => { %>
<%= row.game_id %> <%= row.title_name %> <%= row.scenario %> <%= row.players.join(", ") %> <%= row.description %> <%= row.mtime %> <% if (row.your_turn) { %><%= row.active %><% } else { %><%= row.active %><% } if (row.players.reduce((n,p) => n + (p === user.name ? 1 : 0), 0) == 1) { %>Play<% } else { %>Play<% } %> <% }); %>
<% } %> <% if (finished_games.length > 0) { %>

Finished Games

IDGameScenarioPlayersDescriptionFinishedResult <% finished_games.forEach((row) => { %>
<%= row.game_id %> <%= row.title_name %> <%= row.scenario %> <%= row.players.join(", ") %> <%= row.description %> <%= row.mtime %> <%= row.result %> View <% }); %>
<% } %> <% if (open_games.length == 0 && active_games.length == 0 && finished_games.length == 0) { %>

You don't have any current or finished games. <% } %>