summaryrefslogtreecommitdiff
path: root/views/games.ejs
diff options
context:
space:
mode:
Diffstat (limited to 'views/games.ejs')
-rw-r--r--views/games.ejs44
1 files changed, 26 insertions, 18 deletions
diff --git a/views/games.ejs b/views/games.ejs
index 3b3f485..86a2502 100644
--- a/views/games.ejs
+++ b/views/games.ejs
@@ -2,41 +2,49 @@
<h2>Open</h2>
<table class="game">
-<tr><th>ID<th>Title<th>Scenario<th>Players<th>Description<th>Created<th>
-<% if (open_games.length > 0) { %>
-<% open_games.forEach((row) => { %>
+<tr><th>ID<th>Title<th>Scenario<th>Options<th>Players<th>Description<th>Created<th>
+<%_ if (open_games.length > 0) { _%>
+<%_ open_games.forEach((row) => { _%>
<tr>
<td class="id"><%= row.game_id %>
<td class="title"><a href="/info/<%= row.title_id %>"><%= row.title_name %></a>
<td class="scenario"><%= row.scenario %>
-<td class="players"><%- row.player_names || row.owner_name %>
+<td class="options"><%- row.options %>
+<td class="players"><%- row.player_names %>
<td class="description"><%= row.description %>
<td class="time"><%= row.ctime %>
<td class="command"><a href="/join/<%= row.game_id %>">Join</a>
-<% }); } else { %>
-<tr><td colspan="7">No open games.
-<% } %>
+<%_ }); } else { _%>
+<tr><td colspan="8">No open games.
+<%_ } _%>
</table>
<h2>Active</h2>
<table class="game">
-<tr><th>ID<th>Title<th>Scenario<th>Players<th>Description<th>Changed<th>Active<th>
-<% if (active_games.length > 0) { %>
-<% active_games.forEach((row) => { %>
+<tr><th>ID<th>Title<th>Scenario<th>Options<th>Players<th>Description<th>Changed<th>Active<th>
+<%_ if (active_games.length > 0) { _%>
+<%_ active_games.forEach((row) => { _%>
<tr>
<td class="id"><%= row.game_id %>
<td class="title"><a href="/info/<%= row.title_id %>"><%= row.title_name %></a>
<td class="scenario"><%= row.scenario %>
+<td class="options"><%- row.options %>
<td class="players"><%- row.player_names %>
<td class="description"><%= row.description %>
<td class="time"><%= row.mtime %>
<td class="role <%= row.is_active ? "is_active" : "" %>"><%= row.active %>
-<% if (row.is_yours) { %>
-<td class="command"><a href="/join/<%= row.game_id %>">Enter</a>
-<% } else { %>
-<td class="command"><a href="/play/<%- row.game_id %>/Observer">View</a>
-<% } %>
-<% }); } else { %>
-<tr><td colspan="8">No active games.
-<% } %>
+<%_
+ if (row.is_yours) {
+ if (row.is_shared) {
+ %><td class="command"><a href="/join/<%= row.game_id %>">View</a><%
+ } else {
+ %><td class="command"><a href="/<%- row.title_id %>/play:<%- row.game_id %>:<%- row.your_role %>">View</a><%
+ }
+ } else {
+ %><td class="command"><a href="/<%- row.title_id %>/play:<%- row.game_id %>">View</a><%
+ }
+_%>
+<%_ }); } else { _%>
+<tr><td colspan="9">No active games.
+<%_ } _%>
</table>