Skip to content

Commit 1b7d8e8

Browse files
committed
Updated for new goals. Added Webelos
1 parent 827999a commit 1b7d8e8

File tree

1 file changed

+12
-42
lines changed

1 file changed

+12
-42
lines changed

stats.html

Lines changed: 12 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -32,41 +32,9 @@ <h5 class="text-center text-uppercase fw-bold">2026 Resident Camp</h5>
3232
<tbody id="residentCamp"></tbody>
3333
</table>
3434
</div>
35-
<!-- <div class="col-12 col-md-6">
36-
<h5 class="text-center text-uppercase fw-bold">Paddlerama</h5>
37-
<table class="table text-center">
38-
<thead>
39-
<tr>
40-
<td scope="col" class="col-1">Session</td>
41-
<td scope="col" class="col-1">Youth</td>
42-
<td scope="col" class="col-1">Adult</td>
43-
<td scope="col" class="col-1">Total</td>
44-
<td scope="col" class="col-1">Goal</td>
45-
<td scope="col" class="col-1">Last Year</td>
46-
</tr>
47-
</thead>
48-
<tbody id="paddlerama"></tbody>
49-
</table>
50-
</div> -->
5135
</div>
52-
<!-- <div class="row mt-3">
53-
<div class="col-12 col-md-6">
54-
<h5 class="text-center text-uppercase fw-bold">Fawn Run</h5>
55-
<table class="table text-center">
56-
<thead>
57-
<tr>
58-
<td scope="col" class="col-1">Session</td>
59-
<td scope="col" class="col-1">Youth</td>
60-
<td scope="col" class="col-1">Adult</td>
61-
<td scope="col" class="col-1">Total</td>
62-
<td scope="col" class="col-1">Goal</td>
63-
<td scope="col" class="col-1">Last Year</td>
64-
</tr>
65-
</thead>
66-
<tbody id="fawnRun"></tbody>
67-
</table>
68-
</div>
69-
<div class="col-12 col-md-6">
36+
<div class="row mt-3">
37+
<div class="col-12 col-md-6 offset-md-3">
7038
<h5 class="text-center text-uppercase fw-bold">Webelos Week</h5>
7139
<table class="table text-center">
7240
<thead>
@@ -82,7 +50,7 @@ <h5 class="text-center text-uppercase fw-bold">Webelos Week</h5>
8250
<tbody id="webelosWeek"></tbody>
8351
</table>
8452
</div>
85-
</div> -->
53+
</div>
8654
</div>
8755

8856
<style>
@@ -129,7 +97,7 @@ <h5 class="text-center text-uppercase fw-bold">Webelos Week</h5>
12997
const sessionDetails = [
13098
{
13199
"sessionName": "Week 1",
132-
"goal": 250,
100+
"goal": 400,
133101
"previousYear": 405
134102
},
135103
{
@@ -149,12 +117,12 @@ <h5 class="text-center text-uppercase fw-bold">Webelos Week</h5>
149117
},
150118
{
151119
"sessionName": "Week 5",
152-
"goal": 500,
120+
"goal": 300,
153121
"previousYear": 322
154122
},
155123
{
156124
"sessionName": "Week 6",
157-
"goal": 250,
125+
"goal": 300,
158126
"previousYear": 297
159127
}
160128
]
@@ -169,11 +137,13 @@ <h5 class="text-center text-uppercase fw-bold">Webelos Week</h5>
169137
adultTotal = await _.sumBy(mergedData, function (o) { return parseInt(o.adults); });
170138
previousTotal = await _.sumBy(mergedData, function (o) { return parseInt(o.previousYear); });
171139
total = youthTotal + adultTotal
172-
mergedData.push({ "sessionName": "Total", "youth": youthTotal, "adults": adultTotal, "total": total, "goal": 2500, "previousYear": previousTotal })
140+
mergedData.push({ "sessionName": "Total", "youth": youthTotal, "adults": adultTotal, "total": total, "goal": 2450, "previousYear": previousTotal })
173141

174142
const table = document.querySelector("#residentCamp");
175143
for (session of mergedData) {
176-
let rowColorClass = session.youth / session.goal >= 1 ? 'table-success' : ''
144+
let rowColorClass = ''
145+
if (session.youth / session.goal >= 0.8) rowColorClass = 'table-warning'
146+
if (session.youth / session.goal >= 1) rowColorClass = 'table-success'
177147

178148
const tableRow = `<tr class='${rowColorClass}'><td>${session.sessionName}</td><td>${session.youth}</td><td>${session.adults}</td><td>${session.total}</td><td>${session.goal}</td><td>${session.previousYear}</td></tr>`
179149
table.insertAdjacentHTML('beforeend', tableRow)
@@ -295,7 +265,7 @@ <h5 class="text-center text-uppercase fw-bold">Webelos Week</h5>
295265
{
296266
"sessionName": "Week 6",
297267
"goal": 50,
298-
"previousYear": 53
268+
"previousYear": 46
299269
}
300270
]
301271

@@ -324,7 +294,7 @@ <h5 class="text-center text-uppercase fw-bold">Webelos Week</h5>
324294
await residentCamp('https://247scouting.com/api.php?o=BSA525&a=registration_count&v=102013');
325295
// await paddlerama('https://247scouting.com/api.php?o=BSA525&a=registration_count&v=80824');
326296
// await fawnRun('https://247scouting.com/api.php?o=BSA525&a=registration_count&v=80828');
327-
// await webelosWeek('https://247scouting.com/api.php?o=BSA525&a=registration_count&v=80830');
297+
await webelosWeek('https://247scouting.com/api.php?o=BSA525&a=registration_count&v=108997');
328298
}
329299

330300
main()

0 commit comments

Comments
 (0)