From 6561771c435f9d9bed1589b5ed13d17aee0b7873 Mon Sep 17 00:00:00 2001 From: ivarlovlie Date: Sun, 11 Dec 2022 20:46:58 +0100 Subject: feat: Add frontpage --- code/app/src/routes/(main)/(app)/+layout.svelte | 210 +++++++++++---------- code/app/src/routes/(main)/(public)/+layout.svelte | 10 +- .../(main)/(public)/reset-password/+page.svelte | 32 ++-- .../routes/(main)/(public)/reset-password/+page.ts | 11 ++ .../(main)/(public)/reset-password/[id]/+page.ts | 11 ++ .../routes/(main)/(public)/sign-in/+page.svelte | 86 +++++---- .../src/routes/(main)/(public)/sign-in/+page.ts | 11 ++ .../routes/(main)/(public)/sign-up/+page.svelte | 44 ++--- .../src/routes/(main)/(public)/sign-up/+page.ts | 11 ++ code/app/src/routes/(main)/+layout.server.ts | 17 +- code/app/src/routes/(main)/+layout.svelte | 16 +- code/app/src/routes/(main)/+layout.ts | 12 +- 12 files changed, 264 insertions(+), 207 deletions(-) create mode 100644 code/app/src/routes/(main)/(public)/reset-password/+page.ts create mode 100644 code/app/src/routes/(main)/(public)/reset-password/[id]/+page.ts create mode 100644 code/app/src/routes/(main)/(public)/sign-in/+page.ts create mode 100644 code/app/src/routes/(main)/(public)/sign-up/+page.ts (limited to 'code/app/src/routes') diff --git a/code/app/src/routes/(main)/(app)/+layout.svelte b/code/app/src/routes/(main)/(app)/+layout.svelte index 6cb70ef..e57bc3b 100644 --- a/code/app/src/routes/(main)/(app)/+layout.svelte +++ b/code/app/src/routes/(main)/(app)/+layout.svelte @@ -10,7 +10,7 @@ QueueListIcon, CalendarIcon, } from "$components/icons"; - import {AccountService} from "$services/account-service"; + import { AccountService } from "$services/account-service"; import { Dialog, Menu, @@ -21,11 +21,11 @@ TransitionChild, TransitionRoot, } from "@rgossiaux/svelte-headlessui"; - import {DialogPanel} from "@developermuch/dev-svelte-headlessui"; - import {Input} from "$components"; - import {goto} from "$app/navigation"; - import {page} from "$app/stores"; - + import { DialogPanel } from "@developermuch/dev-svelte-headlessui"; + import { Input } from "$components"; + import { goto } from "$app/navigation"; + import { page } from "$app/stores"; + const accountService = new AccountService(); const session = { @@ -76,45 +76,45 @@ (sidebarOpen = false)}> -
+
@@ -124,15 +124,17 @@ {#each navigationItems as item} {@const current = $page.url.pathname.startsWith(item.href)} @@ -155,52 +157,52 @@ - - - - - {session.profile.username} - - {session.profile.displayName} - - - + + + + + {session.profile.username} + + {session.profile.displayName} + + +
- sign_out()} - class="text-gray-700 block px-4 py-2 text-sm hover:bg-red-200 hover:text-red-900 cursor-pointer" - > - Sign out - + sign_out()} + class="text-gray-700 block px-4 py-2 text-sm hover:bg-red-200 hover:text-red-900 cursor-pointer" + > + Sign out +
@@ -210,8 +212,7 @@ @@ -220,15 +221,15 @@ {#each navigationItems as item} {@const current = $page.url.pathname.startsWith(item.href)} @@ -243,12 +244,12 @@
@@ -256,12 +257,12 @@
@@ -271,35 +272,38 @@
Open user menu
- View - profile + View profile - - Settings + + Settings +
- sign_out()} - class="text-gray-700 block px-4 py-2 text-sm"> Sign out + sign_out()} class="text-gray-700 block px-4 py-2 text-sm"> + Sign out +
@@ -310,7 +314,7 @@
- +
diff --git a/code/app/src/routes/(main)/(public)/+layout.svelte b/code/app/src/routes/(main)/(public)/+layout.svelte index 0d84f9a..6da653c 100644 --- a/code/app/src/routes/(main)/(public)/+layout.svelte +++ b/code/app/src/routes/(main)/(public)/+layout.svelte @@ -1,18 +1,18 @@ - - + + diff --git a/code/app/src/routes/(main)/(public)/reset-password/+page.svelte b/code/app/src/routes/(main)/(public)/reset-password/+page.svelte index 34dabae..55859f6 100644 --- a/code/app/src/routes/(main)/(public)/reset-password/+page.svelte +++ b/code/app/src/routes/(main)/(public)/reset-password/+page.svelte @@ -1,8 +1,8 @@ + + Reset password - Greatoffice + +

@@ -61,21 +65,21 @@
{#if showErrorAlert} - + {:else if showSuccessAlert} - + {/if} -

diff --git a/code/app/src/routes/(main)/(public)/reset-password/+page.ts b/code/app/src/routes/(main)/(public)/reset-password/+page.ts new file mode 100644 index 0000000..c0859e0 --- /dev/null +++ b/code/app/src/routes/(main)/(public)/reset-password/+page.ts @@ -0,0 +1,11 @@ +import LL from '$i18n/i18n-svelte'; +import { get } from 'svelte/store'; +import type { PageLoad } from './$types'; + +const l = get(LL); + +export const load: PageLoad = async () => { + return { + title: l.resetPasswordPage.title(), + }; +}; \ No newline at end of file diff --git a/code/app/src/routes/(main)/(public)/reset-password/[id]/+page.ts b/code/app/src/routes/(main)/(public)/reset-password/[id]/+page.ts new file mode 100644 index 0000000..3252b7a --- /dev/null +++ b/code/app/src/routes/(main)/(public)/reset-password/[id]/+page.ts @@ -0,0 +1,11 @@ +import LL from '$i18n/i18n-svelte'; +import { get } from 'svelte/store'; +import type { PageLoad } from './$types'; + +const l = get(LL); + +export const load: PageLoad = async () => { + return { + title: l.resetPasswordPage.fulfillTitle(), + }; +}; \ No newline at end of file diff --git a/code/app/src/routes/(main)/(public)/sign-in/+page.svelte b/code/app/src/routes/(main)/(public)/sign-in/+page.svelte index e862050..c4ecb1a 100644 --- a/code/app/src/routes/(main)/(public)/sign-in/+page.svelte +++ b/code/app/src/routes/(main)/(public)/sign-in/+page.svelte @@ -1,13 +1,13 @@ - + + + {$page.data.title ? $page.data.title + " - Greatoffice" : "Greatoffice"} + {#if !online}
- +

You seem to be offline, please check your internet connection.

@@ -24,4 +28,4 @@
{/if} - + diff --git a/code/app/src/routes/(main)/+layout.ts b/code/app/src/routes/(main)/+layout.ts index 0509aaf..3893260 100644 --- a/code/app/src/routes/(main)/+layout.ts +++ b/code/app/src/routes/(main)/+layout.ts @@ -1,10 +1,10 @@ -import type {LayoutLoad} from "./$types"; -import type {Locales} from "$i18n/i18n-types"; -import {loadLocaleAsync} from "$i18n/i18n-util.async"; -import {setLocale} from "$i18n/i18n-svelte"; +import type { LayoutLoad } from "./$types"; +import type { Locales } from "$i18n/i18n-types"; +import { loadLocaleAsync } from "$i18n/i18n-util.async"; +import { setLocale } from "$i18n/i18n-svelte"; -export const load: LayoutLoad<{ locale: Locales }> = async ({data: {locale}}) => { +export const load: LayoutLoad<{ locale: Locales }> = async ({ data: { locale } }) => { await loadLocaleAsync(locale); setLocale(locale); - return {locale}; + return { locale }; }; \ No newline at end of file -- cgit v1.3