summaryrefslogtreecommitdiff
path: root/views/games.ejs
blob: 90b2f68590292eaa9a6374f6082242211eff3c42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<%- include('header', { title: "All Public Games", refresh: (user ? 300 : 0) }) -%>

<h2>Open</h2>
<table>
<tr><th>ID<th>Title<th>Scenario<th>Players<th>Description<th>Created<th>
<% if (open_games.length > 0) { %>
<% open_games.forEach((row) => { %>
<tr>
<td><%= row.game_id %>
<td class="w"><a href="/info/<%= row.title_id %>"><%= row.title_name %></a>
<td class="w"><%= row.scenario %>
<td><%- row.player_names %>
<td><%= row.description %>
<td class="w"><%= row.ctime %>
<td class="command"><a href="/join/<%= row.game_id %>">Join</a>
<% }); } else { %>
<tr><td colspan="7">No open games.
<% } %>
</table>

<h2>Active</h2>
<table>
<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>
<td><%= row.game_id %>
<td class="w"><a href="/info/<%= row.title_id %>"><%= row.title_name %></a>
<td class="w"><%= row.scenario %>
<td><%- row.player_names %>
<td><%= row.description %>
<td class="w"><%= row.mtime %>
<% if (row.is_active) { %>
<td class="is_active"><%= row.active %>
<% } else { %>
<td><%= row.active %>
<% } %>
<% 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="8">No active games.
<% } %>
</table>