diff --git a/src/frontend/src/routes/awards/[id]/+page.svelte b/src/frontend/src/routes/awards/[id]/+page.svelte index f80f9f3..9408263 100644 --- a/src/frontend/src/routes/awards/[id]/+page.svelte +++ b/src/frontend/src/routes/awards/[id]/+page.svelte @@ -164,6 +164,28 @@ applyFilter(); } + // Calculate band sums + $: bandSums = (() => { + const sums = new Map(); + const hasPoints = entities.length > 0 && entities[0].points !== undefined; + + bands.forEach(band => { + if (hasPoints) { + // Sum points for confirmed QSOs in this band + const sum = entities + .filter(e => e.band === band && e.confirmed) + .reduce((total, e) => total + (e.points || 0), 0); + sums.set(band, sum); + } else { + // Count confirmed QSOs in this band + const count = entities.filter(e => e.band === band && e.confirmed).length; + sums.set(band, count); + } + }); + + return sums; + })(); + // QSO Detail Modal Functions async function openQSODetailModal(qso) { loadingQSO = true; @@ -341,6 +363,19 @@ {/each} + + + + Sum + + {#each bands as band} + {@const sum = bandSums.get(band) ?? 0} + + {sum} + + {/each} + + {/if} @@ -559,6 +594,28 @@ padding: 0px 3px 0px 3px; } + .award-table tfoot { + background-color: #f5f5f5; + border-top: 2px solid #333; + } + + .sum-row td { + border: 1px solid #000; + padding: 8px 5px; + text-align: center; + background-color: #f5f5f5; + font-weight: 600; + } + + .sum-label { + text-align: left !important; + color: #333; + } + + .sum-cell { + color: #4a90e2; + } + .award-header { margin-bottom: 2rem; }