From 9bf432691830a7e15520a3df716dba51efdcdbbf Mon Sep 17 00:00:00 2001 From: BurnyLlama Date: Thu, 4 Nov 2021 23:20:41 +0100 Subject: [PATCH] Added leaderboard vars... --- routes/routes.js | 4 +++- views/pages/mapSingle.njk | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/routes/routes.js b/routes/routes.js index 56e7c63..4bcd1e7 100644 --- a/routes/routes.js +++ b/routes/routes.js @@ -23,7 +23,9 @@ routes.get( '/maps/:map', (req, res) => { const map = wrapper.map(req.params.map) - tx(req, res)('pages/mapSingle.njk', { map }, { currentSection: "maps" }) + const raceLeaderboard = wrapper.leaderboardRace(req.params.map, 1, 10) + const teamLeaderboard = wrapper.leaderboardTeamrace(req.params.map, 1, 10) + tx(req, res)('pages/mapSingle.njk', { map, raceLeaderboard, teamLeaderboard }, { currentSection: "maps" }) } ) diff --git a/views/pages/mapSingle.njk b/views/pages/mapSingle.njk index 819aa49..e585751 100644 --- a/views/pages/mapSingle.njk +++ b/views/pages/mapSingle.njk @@ -1,6 +1,8 @@ {% extends "../templates/basic.njk" %} {% import "../components/_map.njk" as mapComponent %} {% set map = data.map %} +{% set raceLeaderboard = data.raceLeaderboard %} +{% set teamLeaderboard = data.teamLeaderboard %} {% block head %} DDStats - Maps!