blob: 7c98e21414290614cee295e4db74735d6411ba9a (
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
<%- include('header', { title: title.title_name, refresh: (user ? 300 : 0) }) %>
<img class="logo" src="/<%= title.title_id %>/cover.jpg">
<%- include('../public/' + title.title_id + '/about.html') %>
<p>
Read more about the game on
<a href="https://boardgamegeek.com/boardgame/<%= title.bgg %>">boardgamegeek.com</a>.
<h2>Open Games</h2>
<table class="game">
<tr><th>ID<th>Scenario<th>Players<th>Description<th>Created<th>
<% if (open_games.length > 0) { %>
<% open_games.forEach((row) => { %>
<tr>
<td class="id"><%= row.game_id %>
<td><%= row.scenario %>
<td class="players"><%- row.player_names || `<a href="/user/${row.owner_name}">${row.owner_name}</a>` %>
<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="6">No open games.
<% } %>
</table>
<p>
<a href="/create/<%= title.title_id %>">Create a new game</a>.
<% if (active_games.length > 0) { %>
<h2>Active Games</h2>
<table class="game">
<tr><th>ID<th>Scenario<th>Players<th>Description<th>Changed<th>Turn<th>
<% active_games.forEach((row) => { %>
<tr>
<td class="id"><%= row.game_id %>
<td class="scenario"><%= row.scenario %>
<td class="players"><%- row.player_names %>
<td class="description"><%= row.description %>
<td class="time"><%= row.mtime %>
<td class="<%= row.is_active ? "role is_active" : "role" %>"><%= 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>
<% } %>
<% }); %>
</table>
<% } %>
<% if (finished_games.length > 0) { %>
<h2>Finished Games</h2>
<table class="game">
<tr><th>ID<th>Scenario<th>Players<th>Description<th>Finished<th>Result<th>
<% finished_games.forEach((row) => { %>
<tr>
<td class="id"><%= row.game_id %>
<td class="scenario"><%= row.scenario %>
<td class="players"><%- row.player_names %>
<td class="description"><%= row.description %>
<td class="time"><%= row.mtime %>
<td class="result"><%= row.result %>
<% 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>
<% } %>
<% }); %>
</table>
<% } %>
|