feat: add progressbar to upgrade page, text tweaks

This commit is contained in:
Ash Monty
2022-07-09 17:57:24 +02:00
parent 72b0a24734
commit 1feecdc4cc
6 changed files with 45 additions and 7 deletions

View File

@@ -137,6 +137,9 @@ async function updateStripeDonationCache() {
hasMore = has_more;
}
donationCache.goal_dollars = donationCache.goal / 100;
donationCache.total_dollars = donationCache.total / 100;
donationCache.completed_real = Math.floor((donationCache.total / donationCache.goal) * 100); // real completion amount
donationCache.completed_capped = Math.max(0, Math.min(donationCache.completed_real, 100)); // capped at 100

View File

@@ -23,7 +23,7 @@ router.get('/', async (request, response) => {
const trelloCache = await getTrelloCache();
renderData.progressLists = trelloCache;
const stripeDonationCache = await getStripeDonationCache();
renderData.donation = stripeDonationCache;
renderData.donationCache = stripeDonationCache;
response.render('progress', renderData);
});