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!