summaryrefslogtreecommitdiff
path: root/views/games.ejs
blob: 86a2502cbaac7c808cd69e9e41967f37830be469 (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
<%- include('header', { title: "All Public Games", refresh: (user ? 300 : 0) }) %>

<h2>Open</h2>
<table class="game">
<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="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="8">No open games.
<%_ } _%>
</table>

<h2>Active</h2>
<table class="game">
<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) {
		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>