Started working on leaderobard UI/API...
This commit is contained in:
parent
c234becc46
commit
f55af4fb6b
|
@ -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(
|
routes.get(
|
||||||
'/status',
|
'/status',
|
||||||
(req, res) => {
|
(req, res) => {
|
||||||
|
|
17
views/pages/leaderboards.njk
Normal file
17
views/pages/leaderboards.njk
Normal 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 %}
|
|
@ -5,8 +5,9 @@
|
||||||
{% set raceLeaderboard = data.raceLeaderboard %}
|
{% set raceLeaderboard = data.raceLeaderboard %}
|
||||||
{% set teamLeaderboard = data.teamLeaderboard %}
|
{% set teamLeaderboard = data.teamLeaderboard %}
|
||||||
{% set graphMap = data.graphMap %}
|
{% set graphMap = data.graphMap %}
|
||||||
|
|
||||||
{% block head %}
|
{% block head %}
|
||||||
<title>DDStats - Maps!</title>
|
<title>DDStats - {{ map.map }}</title>
|
||||||
<link rel="stylesheet" type="text/css" href="/assets/css/maps.css">
|
<link rel="stylesheet" type="text/css" href="/assets/css/maps.css">
|
||||||
<script src="/assets/scripts/lazyLoadImages.js" defer></script>
|
<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>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js"></script>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user