summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/forum_reply.ejs3
-rw-r--r--views/games.ejs4
-rw-r--r--views/info.ejs21
3 files changed, 15 insertions, 13 deletions
diff --git a/views/forum_reply.ejs b/views/forum_reply.ejs
index 85bafad..3e87ddd 100644
--- a/views/forum_reply.ejs
+++ b/views/forum_reply.ejs
@@ -15,8 +15,7 @@ table .time { border-left: none; font-weight: normal; }
<p>
Reply:
<br>
-<textarea name="body" rows="15" cols="80" maxlength="32000" required autofocus
- placeholder="Say something nice."></textarea>
+<textarea name="body" rows="15" cols="80" maxlength="32000" required autofocus></textarea>
<p>
<button type="submit">Submit</button>
</form>
diff --git a/views/games.ejs b/views/games.ejs
index acb94b6..3b3f485 100644
--- a/views/games.ejs
+++ b/views/games.ejs
@@ -31,7 +31,11 @@
<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.
<% } %>
diff --git a/views/info.ejs b/views/info.ejs
index f97b04e..7c98e21 100644
--- a/views/info.ejs
+++ b/views/info.ejs
@@ -5,8 +5,6 @@
Read more about the game on
<a href="https://boardgamegeek.com/boardgame/<%= title.bgg %>">boardgamegeek.com</a>.
-<% if (user) { %>
-
<h2>Open Games</h2>
<table class="game">
<tr><th>ID<th>Scenario<th>Players<th>Description<th>Created<th>
@@ -39,7 +37,11 @@ Read more about the game on
<td class="description"><%= row.description %>
<td class="time"><%= row.mtime %>
<td class="<%= row.is_active ? "role is_active" : "role" %>"><%= row.active %>
-<td class="command"><a href="/join/<%= row.game_id %>">Enter</a>
+<% 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>
<% } %>
@@ -56,14 +58,11 @@ Read more about the game on
<td class="description"><%= row.description %>
<td class="time"><%= row.mtime %>
<td class="result"><%= row.result %>
-<td class="command"><a href="/join/<%= row.game_id %>">View</a>
+<% 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>
<% } %>
-
-<% } else { %>
-
-<p>
-Login to create or join a game.
-
-<% } %>