change register button text if registration is closed (#31)
This commit is contained in:
9
src/routes/+page.server.ts
Normal file
9
src/routes/+page.server.ts
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import type { PageServerLoad } from './$types';
|
||||||
|
import { Settings } from '$lib/server/database';
|
||||||
|
|
||||||
|
export const load: PageServerLoad = async () => {
|
||||||
|
return {
|
||||||
|
register_enabled:
|
||||||
|
(await Settings.findOne({ where: { key: 'register.enabled' } }))?.value ?? true
|
||||||
|
};
|
||||||
|
};
|
@ -4,6 +4,7 @@
|
|||||||
import { Clock, User, WrenchScrewdriver } from 'svelte-heros-v2';
|
import { Clock, User, WrenchScrewdriver } from 'svelte-heros-v2';
|
||||||
import Crosshairs from '$lib/components/CustomIcons/Crosshairs.svelte';
|
import Crosshairs from '$lib/components/CustomIcons/Crosshairs.svelte';
|
||||||
import Skull from '$lib/components/CustomIcons/Skull.svelte';
|
import Skull from '$lib/components/CustomIcons/Skull.svelte';
|
||||||
|
import type { PageData } from '../../.svelte-kit/types/src/routes/register/$types';
|
||||||
|
|
||||||
let information = [
|
let information = [
|
||||||
{
|
{
|
||||||
@ -22,6 +23,8 @@
|
|||||||
'Jeder ist willkommen und kann mitspielen. Dazu benötigst Du nur einen Minecraft-Account und schon bist Du Teil unser Community :)'
|
'Jeder ist willkommen und kann mitspielen. Dazu benötigst Du nur einen Minecraft-Account und schon bist Du Teil unser Community :)'
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export let data: PageData;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
@ -48,7 +51,8 @@
|
|||||||
<div class="flex justify-center">
|
<div class="flex justify-center">
|
||||||
<a
|
<a
|
||||||
class="btn btn-outline btn-accent hover:bg-white"
|
class="btn btn-outline btn-accent hover:bg-white"
|
||||||
href="{env.PUBLIC_BASE_PATH}/register">Jetzt registrieren</a
|
href="{env.PUBLIC_BASE_PATH}/register"
|
||||||
|
>{data.register_enabled ? 'Jetzt registrieren' : 'Infos zur Anmeldung'}</a
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user