From c04946973e7cbb5f96b4f626458921ed713b2c48 Mon Sep 17 00:00:00 2001 From: Furkan Sahin Date: Tue, 26 Jul 2022 22:37:51 -0500 Subject: Editable PT name (wip), Download button for labs (doesn't function) --- src/components/Labs.svelte | 108 ++++++++++++++++++++----------------- src/components/PeerTeachers.svelte | 16 +++++- src/components/helpers/Icon.svelte | 17 +++--- src/models/Lab.ts | 2 +- 4 files changed, 82 insertions(+), 61 deletions(-) (limited to 'src') diff --git a/src/components/Labs.svelte b/src/components/Labs.svelte index fc5c0ae..465b87a 100644 --- a/src/components/Labs.svelte +++ b/src/components/Labs.svelte @@ -1,60 +1,70 @@
- - - - - {#each headers as header, i} - - {/each} - - - - {#each labsAndPts as l, i} - { - selected_lab = l.lab; - }} - class={selected_lab == l.lab ? "active" : "hover"} - > - - - - - - - + + + + {#each headers as header, i} + {#if i == 0} + - + {:else} + + {/if} {/each} - -
{i == 0 ? labs.length : header}
{i + 1}{l.lab?.course}{l.lab?.section}{l.lab?.time}{l.lab?.location}{l.pt?.name ?? "UNASSIGNED"}
+ {labs.length} +
{header}
-
- \ No newline at end of file + + + + {#each labsAndPts as l, i} + { + selected_lab = l.lab; + }} + class={selected_lab == l.lab ? "active" : "hover"} + > + {i + 1} + {l.lab?.course} + {l.lab?.section} + {l.lab?.time} + {l.lab?.location} + {l.pt?.name ?? "UNASSIGNED"} + + + {/each} + + + diff --git a/src/components/PeerTeachers.svelte b/src/components/PeerTeachers.svelte index 16ff449..f0d34de 100644 --- a/src/components/PeerTeachers.svelte +++ b/src/components/PeerTeachers.svelte @@ -3,6 +3,7 @@ import type PeerTeacher from "../models/PeerTeacher"; let selected_pt: PeerTeacher | undefined; + let editing: boolean = false; $: peerTeachers = [...$ptStore.values()].sort((a, b) => a.lastname.toUpperCase() === b.lastname.toUpperCase() @@ -49,7 +50,20 @@ class={selected_pt == pt ? "active" : "hover"} > {i + 1} - {pt.firstname} + + {#if editing && selected_pt == pt} + (editing = false)} + /> + {:else} +
(editing = true)}> + {pt.firstname} +
+ {/if} + {pt.lastname} {pt.id} {pt.email} diff --git a/src/components/helpers/Icon.svelte b/src/components/helpers/Icon.svelte index e7b68d6..5224421 100644 --- a/src/components/helpers/Icon.svelte +++ b/src/components/helpers/Icon.svelte @@ -10,11 +10,7 @@ { box: 24, name: "plus-circle", - path: ``, + path: ``, }, { box: 24, @@ -24,11 +20,12 @@ { name: "info", box: 24, - path: ``, + path: ``, + }, + { + name: "download", + box: 24, + path: ` e.name === name); diff --git a/src/models/Lab.ts b/src/models/Lab.ts index b9025fa..875bc7d 100644 --- a/src/models/Lab.ts +++ b/src/models/Lab.ts @@ -49,7 +49,7 @@ export default class Lab { } get location() { - return `${this.building}-${this.room}`; + return `${this.building} ${this.room}`; } get pay_hours() { -- cgit v1.2.3