Skip to content

Commit d28505a

Browse files
committed
fix: clarify amount of bonus points awarded per hour
1 parent 40b855b commit d28505a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/routes/home.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ export const setupHomeRoutes = function(app: Express, prisma: PrismaClient): voi
104104
total: number;
105105
awarded: number;
106106
remaining: number;
107+
perHour: number;
107108
} } = {};
108109
if (bonusPointsAwarding.startTime && bonusPointsAwarding.started) {
109110
// Calculate how many bonus points are left to award per ranking type
@@ -123,6 +124,7 @@ export const setupHomeRoutes = function(app: Express, prisma: PrismaClient): voi
123124
total: totalBonusPoints,
124125
awarded: Math.min(awardedBonusPoints, totalBonusPoints),
125126
remaining: Math.max(remainingBonusPoints, 0),
127+
perHour: bonusPointsPerHour,
126128
};
127129
}
128130
}
@@ -137,6 +139,7 @@ export const setupHomeRoutes = function(app: Express, prisma: PrismaClient): voi
137139
total: totalBonusPoints,
138140
awarded: 0,
139141
remaining: totalBonusPoints,
142+
perHour: Math.floor(totalBonusPoints / (7 * 24))
140143
};
141144
}
142145
}

templates/home.njk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@
6767
<div class="progress-bar" style="width: {{ (rankingBonusPoints[rankingType.type].awarded / rankingBonusPoints[rankingType.type].total) * 100 }}%; background-color: var(--bs-yellow);"></div>
6868
<div class="center-label">{{ rankingBonusPoints[rankingType.type].awarded | thousands }} / {{ rankingBonusPoints[rankingType.type].total | thousands }} points awarded</div>
6969
</div>
70-
<p class="mb-0 text-center"><b>Bonus points are being awarded!</b><br>Bonus points are awarded <i>every hour</i> during the final week of the season.</p>
70+
<p class="mb-0 text-center"><b>Bonus points are being awarded!</b><br>{{ rankingBonusPoints[rankingType.type].perHour | thousands }} bonus points are awarded to #1 <i>every hour</i> during the final week of the season.</p>
7171
</div>
7272
{% elif bonusPointsAwarding.startTime %}
73-
<p class="p-4 pt-0 mb-0"><small>{{ (rankingType.bonus_points / 168) | round(0, 'floor') }} bonus points will be awarded to #1 <i>every hour</i> during the <i>final week of the season {{ bonusPointAwarding.startTime | timeFromNow }}</i>!</small></p>
73+
<p class="p-4 pt-0 mb-0"><small>{{ rankingBonusPoints[rankingType.type].perHour | thousands }} bonus points will be awarded to #1 <i>every hour</i> during the <i>final week of the season {{ bonusPointAwarding.startTime | timeFromNow }}</i>!</small></p>
7474
{% endif %}
7575
<table class="table coalition-colored mb-0">
7676
<tbody>

0 commit comments

Comments
 (0)