diff --git a/frontend/src/Components/Events/CustomizableEventConsole.svelte b/frontend/src/Components/Events/CustomizableEventConsole.svelte index 645ef385..47deda2c 100644 --- a/frontend/src/Components/Events/CustomizableEventConsole.svelte +++ b/frontend/src/Components/Events/CustomizableEventConsole.svelte @@ -13,6 +13,7 @@ export let event; let eventid = event.pk; let emailsCheckedOff = []; + let emailsRsvp = []; async function checkAdmin() { let response = await fetch(`/api/permissions/`).then(value => value.json()); @@ -34,6 +35,31 @@ } } + async function copyToClipboard(text, sign_tab) { + if(text.length == 0){ + alert("No checked off attendees!"); + }else{ + if(sign_tab){ + try { + await navigator.clipboard.writeText(text); + alert("Checked-Off attendee's email copied to clipboard!"); + } catch (err) { + console.error("Failed to copy:", err); + alert("Failed to copy text to clipboard."); + } + }else{ + try { + await navigator.clipboard.writeText(text); + alert("RSVP'd attendee's email copied to clipboard!"); + } catch (err) { + console.error("Failed to copy:", err); + alert("Failed to copy text to clipboard."); + } + } + + } + } + // This variable is used by the EditPointsModal to select a particular user // and edit that user's points. It is set to one of the rows of the table // during the Edit Points button on:click event. @@ -87,6 +113,7 @@ }); rows.forEach((row) => { + emailsRsvp.push(row["Email"]); if (row["Check Off Id"] !== undefined) { emailsCheckedOff.push(row["Email"]); } @@ -128,20 +155,6 @@ return rows; } - async function copyToClipboard(text) { - if(text.length == 0){ - alert("No checked off attendees!"); - }else{ - try { - await navigator.clipboard.writeText(text); - alert("Text copied to clipboard!"); - } catch (err) { - console.error("Failed to copy:", err); - alert("Failed to copy text to clipboard."); - } - } - } - // Filter Table let generateTablePromise = generateTable(); let indexedRows = new Map(); @@ -245,7 +258,37 @@ }}> RSVP List - + +