diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2022-08-07 22:41:41 -0500 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2022-08-07 22:41:41 -0500 |
| commit | 1ef38ce38bc2823ad603fe42f4b918cfab04683c (patch) | |
| tree | b1b572e9a9c85bbd82be8a1b5824ed6ce949eabd /src/components/Labs.svelte | |
| parent | e5fbe70e25f5b5c40b335f4385d7351f2e52d944 (diff) | |
Display assigned PT's emails as well as output it to CSV
Diffstat (limited to 'src/components/Labs.svelte')
| -rw-r--r-- | src/components/Labs.svelte | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/components/Labs.svelte b/src/components/Labs.svelte index bddf607..680c6f1 100644 --- a/src/components/Labs.svelte +++ b/src/components/Labs.svelte @@ -14,6 +14,7 @@ "Location", "Instructor", "Assigned PT", + "PT Email", "", ]; @@ -43,13 +44,19 @@ } function download() { // prepare data in CSV format - let cols = headers.slice(1, -1); + let cols = headers.slice(1); let csv = cols.join(",") + "\n"; labsAndPts.forEach((row) => { let l = row.lab; - csv += `${l.course} - ${l.section},${l.time},${ - l.location - },${displayFaculty(l)},${row.pt?.name ?? "UNASSIGNED"}\n`; + csv += + [ + `${l.course} - ${l.section}`, + l.time, + l.location, + displayFaculty(l), + row.pt?.name ?? "UNASSIGNED", + row.pt?.email ?? "N/A", + ].join(",") + "\n"; }); const blob = new Blob([csv], { type: "text/csv" }); @@ -102,6 +109,7 @@ <td>{l.lab?.location}</td> <td>{displayFaculty(l.lab)}</td> <td>{l.pt?.name ?? "UNASSIGNED"}</td> + <td>{l.pt?.email ?? "N/A"}</td> <td><button class="btn btn-ghost btn-xs">Delete</button></td> </tr> {/each} |
