Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/lib/nta/NTACard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@
<div class="card bg-base-100 shadow-xl m-2">
<div class="card-body">
<div class="flex justify-between">
<span class="text-xl text-green-900">
{nta.nta.name} ({nta.nta.program} / {nta.nta.mtknr})
<span class="text-xl">
<span class="text-green-900">
{nta.nta.name} ({nta.nta.program} / {nta.nta.mtknr})<br />
<span class=" text-blue-900">
<a href="mailto:{nta.nta.email}">&lt;{nta.nta.email}&gt;</a>
</span>
</span>
</span>
{#if nta.nta.needsHardware}
<div class="badge badge-info">spezielle Hardware</div>
Expand Down
1 change: 1 addition & 0 deletions src/routes/nta/ntaWithRegs/+page.server.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export async function load({ params }) {
regs
nta {
name
email
mtknr
compensation
deltaDurationPercent
Expand Down
23 changes: 22 additions & 1 deletion src/routes/nta/ntaWithRegs/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
<script>
export let data;
import NtaCard from '$lib/nta/NTACard.svelte';

let showRoomAlone = false;
let showHardware = false;

$: filteredNtas =
data.ntasWithRegs?.filter((ntaWithReg) => {
if (showRoomAlone && !ntaWithReg.nta.needsRoomAlone) return false;
if (showHardware && !ntaWithReg.nta.needsHardware) return false;
return true;
}) || [];
</script>

<div class="text-center m-2">
Expand All @@ -9,11 +19,22 @@
</div>
</div>

<div class="flex justify-center gap-4 mb-4">
<label class="flex items-center">
<input type="checkbox" bind:checked={showRoomAlone} class="mr-2" />
Nur Einzelraum benötigt
</label>
<label class="flex items-center">
<input type="checkbox" bind:checked={showHardware} class="mr-2" />
Nur Hardware benötigt
</label>
</div>

{#if data.ntasWithRegs == null}
No NTA found in this semester.
{:else}
<div class="py-4 grid gap-4 grid-cols-3">
{#each data.ntasWithRegs as nta}
{#each filteredNtas as nta}
<NtaCard {nta} />
{/each}
</div>
Expand Down