From bd387a85542f3a367fc665cff1850660337c6c04 Mon Sep 17 00:00:00 2001 From: Matty Widdop <18513864+MattyTheHacker@users.noreply.github.com> Date: Thu, 30 Apr 2026 12:14:44 +0000 Subject: [PATCH 1/3] Implement downloading of attendee names and IDs --- web/src/routes/users/+page.svelte | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/web/src/routes/users/+page.svelte b/web/src/routes/users/+page.svelte index 6120ca4..a682270 100644 --- a/web/src/routes/users/+page.svelte +++ b/web/src/routes/users/+page.svelte @@ -48,6 +48,23 @@ $fetching = false; }; + const downloadCSV = () => { + const headers = ["Student ID", "Name"]; + const rows = data.users.map((u) => `"${u.studentID}","${u.name.replace(/"/g, '""')}"`); + const csvContent = [headers.join(","), ...rows].join("\n"); + + const blob = new Blob([csvContent], { type: "text/csv;charset=utf-8;" }); + const url = URL.createObjectURL(blob); + const link = document.createElement("a"); + link.setAttribute("href", url); + link.setAttribute("download", "registered_users.csv"); + link.style.visibility = "hidden"; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + URL.revokeObjectURL(url); + }; + let restrictUserDialog: HTMLDialogElement; const confirmRestrictUser = (user: User) => { if (user.isRestricted) return toggleUserRestriction(user.studentID, user.isRestricted); @@ -86,6 +103,7 @@

Currently {data.users.length} users

+