summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2021-11-14 17:17:49 +0100
committerTor Andersson <tor@ccxvii.net>2021-11-20 13:14:24 +0100
commitd1318d147297161691f5048e1f2cb4e516159144 (patch)
treef8858e16eece0e4a1bf8deb29548c6421b54df03 /views
parentf02fb77b1cb34b4622f2c90597ff616d4de65fc5 (diff)
downloadserver-d1318d147297161691f5048e1f2cb4e516159144.tar.gz
Add 'hidden' column to titles for beta-testing games.
Diffstat (limited to 'views')
-rw-r--r--views/header.ejs20
-rw-r--r--views/index.ejs23
-rw-r--r--views/stats.ejs2
3 files changed, 24 insertions, 21 deletions
diff --git a/views/header.ejs b/views/header.ejs
index 2628f8d..66f0f2e 100644
--- a/views/header.ejs
+++ b/views/header.ejs
@@ -2,9 +2,9 @@
<html>
<head>
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1">
-<% if (typeof refresh !== 'undefined' && refresh > 0) { _%>
+<% if (typeof refresh !== 'undefined' && refresh > 0) { -%>
<meta http-equiv="refresh" content="<%= refresh %>">
-<% } _%>
+<% } -%>
<title><%= title %></title>
<link rel="icon" href="/favicon.svg">
<link rel="stylesheet" href="/fonts/fonts.css">
@@ -16,21 +16,21 @@
<nav>
<a href="/about">About</a>
<a href="/forum">Forum</a>
-<%_ if (user) { _%>
-<%_ if (user.unread > 0) { _%>
+<% if (user) { -%>
+<% if (user.unread > 0) { -%>
<a href="/inbox">Inbox (<%= unread %>)</a>
-<%_ } else { _%>
+<% } else { -%>
<a href="/inbox">Inbox</a>
-<%_ } _%>
+<% } -%>
<a href="/profile">Profile (<%= user.name %>)</a>
-<%_ } else { _%>
+<% } else { -%>
<a href="/signup">Signup</a>
<a href="/login">Login</a>
-<%_ } _%>
+<% } -%>
</nav>
</header>
<article>
<h1><%= title %></h1>
-<%_ if (typeof flash !== 'undefined' && flash.length > 0) { _%>
+<% if (typeof flash !== 'undefined' && flash.length > 0) { -%>
<p class="error"><%= flash %></p>
-<%_ } _%>
+<% } -%>
diff --git a/views/index.ejs b/views/index.ejs
index 0b3180f..1f23381 100644
--- a/views/index.ejs
+++ b/views/index.ejs
@@ -1,6 +1,6 @@
-<%- include('header', { title: "Rally the Troops!" }) %>
+<%- include('header', { title: "Rally the Troops!" }) _%>
<style>
-.list { display: flex; flex-wrap: wrap; justify-content: left; }
+.list { display: flex; flex-wrap: wrap; justify-content: left; max-width: 800px; }
.list a { margin: 1em; display: block; }
.list img { box-shadow: 2px 2px 4px 0px rgba(0,0,0,0.5); height: 200px; }
</style>
@@ -13,15 +13,16 @@ players.
Registration and use is free, and there are no ads.
<div class="list">
-<a href="/info/crusader-rex"><img src="/crusader-rex/cover.jpg"></a>
-<a href="/info/hammer-of-the-scots"><img src="/hammer-of-the-scots/cover.jpg"></a>
-<a href="/info/julius-caesar"><img src="/julius-caesar/cover.jpg"></a>
-<a href="/info/richard-iii"><img src="/richard-iii/cover.jpg"></a>
-</div>
-
-<div class="list">
-<a href="/info/300-earth-and-water"><img src="/300-earth-and-water/cover.jpg"></a>
-<a href="/info/shores-of-tripoli"><img src="/shores-of-tripoli/cover.jpg"></a>
+<%
+ for (let t in titles) {
+ let title = titles[t];
+ if (!title.hidden) {
+_%>
+<a href="/info/<%- title.title_id %>"><img src="/<%- title.title_id %>/cover.jpg"></a>
+<%
+ }
+ }
+_%>
</div>
<p>
diff --git a/views/stats.ejs b/views/stats.ejs
index 9e07aaf..95b52d2 100644
--- a/views/stats.ejs
+++ b/views/stats.ejs
@@ -15,6 +15,8 @@
return info ? info.count : 0;
}
for (let title_id in title_name_map) {
+ if (title_name_map[title_id].hidden)
+ continue;
let scenarios = title_rule_map[title_id].scenarios;
let roles = title_role_map[title_id].concat(['Draw']);
%><tr><th><%= title_name_map[title_id].title_name %><%