diff options
author | Tor Andersson <tor@ccxvii.net> | 2022-07-24 12:27:25 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2022-07-24 13:05:31 +0200 |
commit | 007b4d1ce6c868bb2ea631b00839c2a4dce7906e (patch) | |
tree | d1aaa7bfa8f875420cae77aadfdc3d08930339fb | |
parent | 3e882f6480dd1c7e3148a1e6caf45d7c7568b75b (diff) | |
download | server-007b4d1ce6c868bb2ea631b00839c2a4dce7906e.tar.gz |
Add "create game" index page.
-rw-r--r-- | server.js | 4 | ||||
-rw-r--r-- | views/create-index.pug | 16 | ||||
-rw-r--r-- | views/games_active.pug | 3 | ||||
-rw-r--r-- | views/games_public.pug | 3 | ||||
-rw-r--r-- | views/index.pug | 1 |
5 files changed, 26 insertions, 1 deletions
@@ -359,6 +359,10 @@ app.get('/', function (req, res) { res.render('index.pug', { user: req.user, titles: TITLES }) }) +app.get('/create', must_be_logged_in, function (req, res) { + res.render('create-index.pug', { user: req.user, titles: TITLES }) +}) + app.get('/about', function (req, res) { res.render('about.pug', { user: req.user }) }) diff --git a/views/create-index.pug b/views/create-index.pug new file mode 100644 index 0000000..6c45961 --- /dev/null +++ b/views/create-index.pug @@ -0,0 +1,16 @@ +//- vim:ts=4:sw=4: +doctype html +html + head + include head + title= SITE_NAME + body + include header + article + h1 Create a new game + + ul + each title in titles + unless title.is_hidden + li + a(href="/create/"+title.title_id)= title.title_name diff --git a/views/games_active.pug b/views/games_active.pug index 66ee86c..9e4b909 100644 --- a/views/games_active.pug +++ b/views/games_active.pug @@ -18,6 +18,9 @@ html h2 Open +gamelist(open_games) + p + a(href="/create") Create a new game + if active_games.length > 0 h2 Active +gamelist(active_games) diff --git a/views/games_public.pug b/views/games_public.pug index a3b1407..e1a5387 100644 --- a/views/games_public.pug +++ b/views/games_public.pug @@ -21,6 +21,9 @@ html else p No open games. + p + a(href="/create") Create a new game + if replacement_games.length > 0 h2 Need replacement +gamelist(replacement_games) diff --git a/views/index.pug b/views/index.pug index 1b9ef21..2be79e9 100644 --- a/views/index.pug +++ b/views/index.pug @@ -36,7 +36,6 @@ html div.list each title in titles unless title.is_hidden - - let cover = "/" + title.title_id + "/cover" div.item div +gamecover(title.title_id) |