aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2022-07-30 17:21:29 -0500
committerFurkan Sahin <furkan-dev@proton.me>2022-07-30 17:21:29 -0500
commita19894369bc759c31cde45493f1c41548c0e55d8 (patch)
tree6cec8f874ad838e864aaacafae2bd235684c3cbd /src/components
parent09bbabb765d9e8c64b9455394295b5732622d3c3 (diff)
parsing labs for faculty information, begin displaying lab's faculuty information (in Labs page for example)
Diffstat (limited to 'src/components')
-rw-r--r--src/components/Labs.svelte23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/components/Labs.svelte b/src/components/Labs.svelte
index 9f6e781..4df2184 100644
--- a/src/components/Labs.svelte
+++ b/src/components/Labs.svelte
@@ -7,7 +7,16 @@
$: labs = [...$labStore.values()].sort((a, b) => a.id - b.id);
- let headers = ["", "Course", "Sec", "Time", "Location", "Assigned PT", ""];
+ let headers = [
+ "",
+ "Course",
+ "Sec",
+ "Time",
+ "Location",
+ "Instructor",
+ "Assigned PT",
+ "",
+ ];
$: pts = [...$ptStore.values()];
@@ -23,6 +32,17 @@
];
});
+ function displayFaculty(lab: Lab): string {
+ if (lab.faculty.length > 0) {
+ let s: string[] = [];
+ lab.faculty.forEach((f) => {
+ s.push(f.displayName);
+ });
+ return s.join(",");
+ } else {
+ return "N/A";
+ }
+ }
function download() {
// prepare data in CSV format
let cols = headers.slice(1, -1);
@@ -78,6 +98,7 @@
<th>{l.lab?.section}</th>
<th>{l.lab?.time}</th>
<th>{l.lab?.location}</th>
+ <th>{displayFaculty(l.lab)}</th>
<th>{l.pt?.name ?? "UNASSIGNED"}</th>
<th><button class="btn btn-ghost btn-xs">Delete</button></th>
</tr>