-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Sofie Aasheim <[email protected]> Co-authored-by: Anton Lilleby <[email protected]>
- Loading branch information
1 parent
b88f89f
commit 433508b
Showing
26 changed files
with
5,716 additions
and
7,078 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,9 @@ | ||
<script lang="ts"> | ||
import { formatDateWithWeekDay, formatTime } from "$lib/utils/date.util"; | ||
import { Badge } from "flowbite-svelte"; | ||
export let deadline: string; | ||
</script> | ||
|
||
<div class="flex gap-1"> | ||
<p class="text-sm">Fristen for å melde seg på er</p> | ||
<Badge color="yellow" rounded class="h-5" | ||
>{formatDateWithWeekDay(deadline)} kl {formatTime(deadline)}</Badge | ||
> | ||
<p>Fristen for å melde seg på er</p> | ||
{formatDateWithWeekDay(deadline)} kl {formatTime(deadline)} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,53 @@ | ||
<script lang="ts"> | ||
import { Checkbox } from "flowbite-svelte"; | ||
import { Checkbox, Input } from "flowbite-svelte"; | ||
import { writable } from "svelte/store"; | ||
export let form; | ||
export let option; | ||
export let label; | ||
export let form = writable<{ | ||
customOptions: { | ||
value: string; | ||
option: string; | ||
}[]; | ||
}>(); | ||
export let option: string; | ||
export let type: string; | ||
function handleCheckboxChange(event: Event) { | ||
const target = event.target as HTMLInputElement; | ||
if (target) { | ||
handleValueChange(option, target.checked ? "Ja" : ""); | ||
} | ||
} | ||
function handleInputChange(event: Event) { | ||
const target = event.target as HTMLInputElement; | ||
if (target) { | ||
handleValueChange(option, target.value); | ||
} | ||
} | ||
function handleValueChange(option: string, value: string) { | ||
form.update((currentForm) => { | ||
const updatedOptions = currentForm.customOptions.filter( | ||
(customOption) => customOption.value && customOption.option !== option | ||
); | ||
if (value) { | ||
updatedOptions.push({ option, value }); | ||
} | ||
currentForm.customOptions = updatedOptions; | ||
return currentForm; | ||
}); | ||
} | ||
</script> | ||
|
||
<div class="flex flex-col gap-1"> | ||
<span class="block text-sm font-bold text-gray-900 rtl:text-right dark:text-gray-300" | ||
>{label}</span | ||
>{option}</span | ||
> | ||
<Checkbox value={option} name="customOptions" bind:group={$form.customOptions}>Ja</Checkbox> | ||
{#if type === "checkbox"} | ||
<Checkbox name="customOptions" on:change={handleCheckboxChange}>Ja!</Checkbox> | ||
{:else} | ||
<Input name="customOptions" on:input={handleInputChange} /> | ||
{/if} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.