diff options
author | Tor Andersson <tor@ccxvii.net> | 2022-04-15 14:34:49 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2022-04-15 14:34:49 +0200 |
commit | 8eb1b2f8c4565be28531a057a747cda14512f444 (patch) | |
tree | 7fd4cb45adbc35fb3214284791ce6b646f324e83 /views | |
parent | dadc4ca510d5e45e270faa04775f377d8ff40412 (diff) | |
download | server-8eb1b2f8c4565be28531a057a747cda14512f444.tar.gz |
Separate profile and active game list pages.
Also show number of games where it is your turn in the header.
Only show finished games from last week on active games page.
Add separate finished games page to see all of them.
# Conflicts:
# views/tournament-games.pug
Diffstat (limited to 'views')
-rw-r--r-- | views/games_active.pug | 33 | ||||
-rw-r--r-- | views/games_finished.pug | 15 | ||||
-rw-r--r-- | views/games_public.pug (renamed from views/games.pug) | 4 | ||||
-rw-r--r-- | views/header.pug | 4 | ||||
-rw-r--r-- | views/index.pug | 2 | ||||
-rw-r--r-- | views/info.pug | 2 | ||||
-rw-r--r-- | views/profile.pug | 21 |
7 files changed, 56 insertions, 25 deletions
diff --git a/views/games_active.pug b/views/games_active.pug new file mode 100644 index 0000000..768a92d --- /dev/null +++ b/views/games_active.pug @@ -0,0 +1,33 @@ +//- vim:ts=4:sw=4: +doctype html +html + head + include head + title= title + if active_games.length > 0 + meta(http-equiv="refresh" content=300) + body + include header + article + h1= title + + if ready_games.length > 0 + h2 Ready to start + +gametable(0,ready_games) + + if open_games.length > 0 + h2 Open + +gametable(0,open_games) + + if active_games.length > 0 + h2 Active + +gametable(1,active_games) + + if finished_games.length > 0 + h2 Recently finished + +gametable(2,finished_games) + + p <a href="/games/finished">All finished games</a> + + if open_games.length === 0 && ready_games.length === 0 && active_games.length === 0 && finished_games.length === 0 + p Nothing here. diff --git a/views/games_finished.pug b/views/games_finished.pug new file mode 100644 index 0000000..9ae27c4 --- /dev/null +++ b/views/games_finished.pug @@ -0,0 +1,15 @@ +//- vim:ts=4:sw=4: +doctype html +html + head + include head + title= title + body + include header + article + h1= title + + if finished_games.length > 0 + +gametable(2,finished_games) + else + p Nothing here. diff --git a/views/games.pug b/views/games_public.pug index 14ea168..267c8f7 100644 --- a/views/games.pug +++ b/views/games_public.pug @@ -5,11 +5,11 @@ html include head title= SITE_NAME if user - meta(http-equiv="refresh" content=300) + meta(http-equiv="refresh" content=600) body include header article - h1= SITE_NAME + h1 All Public Games h2 Open +gametable(0, open_games) diff --git a/views/header.pug b/views/header.pug index 7eb357b..9d869f0 100644 --- a/views/header.pug +++ b/views/header.pug @@ -5,6 +5,10 @@ header a(href="/about") About a(href="/forum") Forum if user + if user.active > 0 + a(href="/games/active") Games (#{user.active}) + else + a(href="/games/active") Games if user.unread > 0 a(href="/inbox") Inbox (#{user.unread}) else diff --git a/views/index.pug b/views/index.pug index ec07e03..acfcbc2 100644 --- a/views/index.pug +++ b/views/index.pug @@ -45,6 +45,6 @@ html +gamecover(title.title_id) | #{title.title_name} - p: a(href="/games") List of all open and active games. + p: a(href="/games/public") List of all open and active games. p!= process.env.SITE_INVITE diff --git a/views/info.pug b/views/info.pug index 7c84dca..47367ab 100644 --- a/views/info.pug +++ b/views/info.pug @@ -6,7 +6,7 @@ html +social(title.title_name, "Play " + title.title_name + " on the web.", title.title_id) title= title.title_name if user - meta(http-equiv="refresh" content=300) + meta(http-equiv="refresh" content=600) body include header article diff --git a/views/profile.pug b/views/profile.pug index 5c98743..fc9b36b 100644 --- a/views/profile.pug +++ b/views/profile.pug @@ -4,8 +4,6 @@ html head include head title= SITE_NAME - if active_games.length > 0 - meta(http-equiv="refresh" content=300) body include header article @@ -32,22 +30,3 @@ html | » <a href="/chat">Chat log</a> br | » <a href="/logout">Logout</a> - - if ready_games.length > 0 - h2 Ready to start - +gametable(0,ready_games) - - if open_games.length > 0 - h2 Open games - +gametable(0,open_games) - - if active_games.length > 0 - h2 Active games - +gametable(1,active_games) - - if finished_games.length > 0 - h2 Finished games - +gametable(2,finished_games) - - if open_games.length === 0 && ready_games.length === 0 && active_games.length === 0 && finished_games.length === 0 - p You don't have any current or finished games. |