Started working on leaderobard UI/API...

This commit is contained in:
BurnyLlama 2021-11-07 12:18:13 +01:00
parent c234becc46
commit f55af4fb6b
3 changed files with 34 additions and 1 deletions

View File

@ -49,6 +49,21 @@ routes.get(
}
)
routes.get(
'/leaderboards',
(req, res) => {
const leaderboards = {
points: wrapper.leaderboardPoints("points", 1, 10),
pointsRank: wrapper.leaderboardPoints("pointsRank", 1, 10),
pointsTeam: wrapper.leaderboardPoints("pointsTeam", 1, 10),
pointsThisWeek: wrapper.leaderboardPoints("pointsThisWeek", 1, 10),
pointsThisMonth: wrapper.leaderboardPoints("pointsThisMonth", 1, 10)
}
tx(req, res)('pages/maps.njk', { leaderboards }, true, { currentSection: "maps" })
}
)
routes.get(
'/status',
(req, res) => {

View File

@ -0,0 +1,17 @@
{% extends "../templates/base.njk" %}
{% set leaderboards = data.leaderboards %}
{% block head %}
<title> DDStats - Leaderboards</ttile>
{% endblock %}
{% block body %}
<main class="flex-container">
<div class="leaderboard">
{% for rank in sequence %}
{{ rank }}
{% endfor %}
</div>
</main>
{% endblock %}

View File

@ -5,8 +5,9 @@
{% set raceLeaderboard = data.raceLeaderboard %}
{% set teamLeaderboard = data.teamLeaderboard %}
{% set graphMap = data.graphMap %}
{% block head %}
<title>DDStats - Maps!</title>
<title>DDStats - {{ map.map }}</title>
<link rel="stylesheet" type="text/css" href="/assets/css/maps.css">
<script src="/assets/scripts/lazyLoadImages.js" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js"></script>