From ede55b317dea7915f4ced8b628d2b31262dc2847 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 13 Oct 2024 19:59:20 +0200 Subject: Show active tournaments on main tournament page. --- server.js | 5 ++++- views/tm_list.pug | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index 5caf238..125d468 100644 --- a/server.js +++ b/server.js @@ -2750,6 +2750,8 @@ const TM_SEED_LIST_USER = SQL(` order by seed_name `) +const TM_POOL_LIST_ACTIVE = SQL("select * from tm_pool_active_view") + const TM_POOL_LIST_USER_ACTIVE = SQL(` select * from tm_pool_active_view where not is_finished and pool_id in ( @@ -2983,7 +2985,8 @@ const TM_SELECT_SEED_READY_MINI_CUP = SQL(` app.get("/tm/list", function (req, res) { let seeds = TM_SEED_LIST_ALL.all(req.user ? req.user.user_id : 0) let seeds_by_title = object_group_by(seeds, "title_id") - res.render("tm_list.pug", { user: req.user, seeds, seeds_by_title }) + let active_pools = TM_POOL_LIST_ACTIVE.all() + res.render("tm_list.pug", { user: req.user, seeds, seeds_by_title, active_pools }) }) app.get("/tm/seed/:seed_name", function (req, res) { diff --git a/views/tm_list.pug b/views/tm_list.pug index 41945fc..4f7c147 100644 --- a/views/tm_list.pug +++ b/views/tm_list.pug @@ -26,3 +26,5 @@ html +seedlist(seeds, TITLE_NAME[title_id]) if 1 +seedlist(seeds, "Mini Cup") + + +poollist(active_pools, "Active") -- cgit v1.2.3