Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closes #130 #131

Merged
merged 1 commit into from
Sep 27, 2024
Merged
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
33 changes: 16 additions & 17 deletions src/routes/signup/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<script lang="ts">
import { applyAction, enhance } from '$app/forms';
import { page } from '$app/stores';
import { applyAction, enhance } from '$app/forms';
import { page } from '$app/stores';
export let form: HTMLFormElement;
export let form: HTMLFormElement;
</script>

<div class="w-full mt-24">
<div class="mt-24 w-full">
{#if $page.data.signupDisabled}
<div class="flex flex-col items-center justify-center gap-4 p-4 mx-auto">
<div class="mx-auto flex flex-col items-center justify-center gap-4 p-4">
<h1 class="text-2xl font-bold">Sign up</h1>
<p class="text-gray-500">
Sign up is currently disabled. Please contact the administrator if you want to sign up.
Expand All @@ -20,8 +20,7 @@
return async ({ result }) => {
await applyAction(result);
};
}}
>
}}>
<div class="form-control mx-auto max-w-xs gap-4">
<div>
<label class="label" for="username">
Expand All @@ -32,10 +31,10 @@
type="text"
name="username"
placeholder="Type here"
required
class={`input input-bordered w-full max-w-xs ${
form?.missing && form?.username ? 'input-error' : ''
}`}
/>
}`} />
{#if (form?.missing && form?.username) || (form?.invalid && form?.username)}
<p class="text-error">
{form?.missing ? 'This field is required.' : form?.username?.message}
Expand All @@ -50,19 +49,19 @@
type="text"
name="name"
placeholder="Type here"
class="input input-bordered w-full max-w-xs"
/>
class="input input-bordered w-full max-w-xs" />
</div>
<div>
<label class="label" for="email">
<span class="label-text">Email</span>
<span class="label-text-alt"> (required)</span>
</label>
<input
type="email"
name="email"
required
placeholder="Type here"
class="input input-bordered w-full max-w-xs"
/>
class="input input-bordered w-full max-w-xs" />
</div>
<div>
<label class="label" for="password">
Expand All @@ -72,13 +71,13 @@
<input
type="password"
name="password"
required
placeholder="Type here"
class={`input input-bordered w-full max-w-xs ${
(form?.missing && form?.password) || (form?.invalid && form?.password)
? 'input-error'
: ''
}`}
/>
}`} />
{#if (form?.missing && form?.password) || (form?.invalid && form?.password)}
<p class="text-error">
{form?.missing ? 'This field is required.' : form?.password?.message}
Expand All @@ -94,12 +93,12 @@
type="password"
name="passwordConfirm"
placeholder="Type here"
required
class={`input input-bordered w-full max-w-xs ${
(form?.missing && form?.passwordConfirm) || (form?.invalid && form?.password)
? 'input-error'
: ''
}`}
/>
}`} />
{#if (form?.missing && form?.passwordConfirm) || (form?.invalid && (form?.passwordConfirm || form?.password))}
<p class="text-error">
{form?.missing
Expand Down