From 6412f46a45d3b66c85c0cc3952206ad9cca0a110 Mon Sep 17 00:00:00 2001
From: Linnnus <linnnus@users.noreply.github.com>
Date: Sat, 22 Feb 2025 06:50:02 +0100
Subject: Add watermarking service, fix everything

---
 app/src/routes/assignments/+page.svelte | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

(limited to 'app/src/routes/assignments/+page.svelte')

diff --git a/app/src/routes/assignments/+page.svelte b/app/src/routes/assignments/+page.svelte
index f43767d..5a3a4cb 100644
--- a/app/src/routes/assignments/+page.svelte
+++ b/app/src/routes/assignments/+page.svelte
@@ -1,15 +1,19 @@
 <!-- The /assignments index page gives an overview of assignments -->
 
 <script lang="ts">
+	import { canBeFinished } from "$lib/common/assignments";
 	import type { PageProps } from "./$types";
 
 	const { data }: PageProps = $props();
+	const unfinishedAssignments = $derived(data.assignments.filter(canBeFinished));
+	const finishedAssignments = $derived(data.assignments.filter((a) => !canBeFinished(a)));
 </script>
 
-<h1>Kommende opgaver for {data.user.firstName}</h1>
+<h1>{data.user.firstName}s opgaver</h1>
 
+<h2>Kommende opgaver</h2>
 <ol>
-	{#each data.assignments as assignment}
+	{#each unfinishedAssignments as assignment}
 		<li>
 			<span>{assignment.date}</span>
 			<a href={`/assignments/${assignment.id}`}>Mere info</a>
@@ -17,5 +21,12 @@
 	{/each}
 </ol>
 
-<style>
-</style>
+<h2>Færdiggjorte opgaver</h2>
+<ol>
+	{#each finishedAssignments as assignment}
+		<li>
+			<span>{assignment.date}</span>
+			<a href={`/assignments/${assignment.id}`}>Mere info</a>
+		</li>
+	{/each}
+</ol>
-- 
cgit v1.2.3

