<%- include('header', { title: game.title_name, refresh: game.status == 0 ? 15 : 0 }) %>

Owner: <%= game.owner_name %>
Private: <%= game.private ? "yes" : "no" %>
Scenario: <%= game.scenario %>
Description: <%= game.description || "No description." %>

<% roles.forEach((role) => { %> <% roles.forEach((role) => { if (game.active == role || game.active == "Both" || game.active == "All") { %>
<%= role %><% }); %>
<% } else { %><% } let p = players.find(p => p.role == role); if (game.status == 0) { if (p) { if ((p.user_id == user.user_id) || (game.owner_id == user.user_id)) { %> <% %><%= p.name %><% } else { %><%= p.name %><% } } else { %>Join<% } } else { if (p) { if (p.user_id == user.user_id) { %>Play<% } else { %><%= p.name %><% } } else { %>Empty<% } } }); if (game.status > 0 && !players.some(p => p.user_id == user.user_id)) { %>
View <% } %>

<% if (game.status == 0) { if (players.length == roles.length) { if (game.owner_id == user.user_id) { %>

<% } else { %>Waiting for <%= game.owner_name %> to start the game.<% } } else { %>Waiting for players to join the game.<% } } if (game.status == 2 && players.some(p => p.user_id == user.user_id)) { %>
<% } if (game.owner_id == user.user_id && (game.status == 0 || solo)) { %>


<% } %>