+
+
+ Temp
+
+ Groep
+
+ lichtingen
+ diff --git a/README.md b/README.md index 536792da..ed90b0fb 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Invictus Bier Systeem is _het_ websysteem voor O.D.D. Invictus. ## Ontwikkelen -IBS3 gebruikt node 22.4.0 +IBS3 gebruikt node 22.11.0 Om te beginnen met ontwikkelen moet je eerst de repository clonen met diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 818c0a37..1f0548e0 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -96,6 +96,8 @@ model User { File File[] AccessToken AccessToken[] Activity Activity[] + + FrontPageItem FrontPageItem[] } model Account { @@ -915,6 +917,8 @@ model File { Photo Photo[] Journal Journal? @relation(fields: [journalId], references: [id]) journalId Int? + + FrontPageImage FrontPageItem[] } // @@ -933,3 +937,31 @@ model Job { completedAt DateTime? result String? } + +// +// Dit moet natuurlijk in de database +// +model FrontPageItem { + id Int @id @default(autoincrement()) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + + // HTML ID waar deze foto komt + key String + // Titel (staat bij een foto) + // bijv. Lichting 1 + title String + // Bijbehordende beschrijving + description String + visible Boolean @default(false) + + // verwijst dit item naar een andere pagina? + link String? + + changedBy User? @relation(fields: [userId], references: [id], onDelete: NoAction) + userId Int? + + // Photo + file File @relation(fields: [fileId], references: [id], onDelete: Cascade) + fileId String +} diff --git a/src/lib/server/auth/authorization.ts b/src/lib/server/auth/authorization.ts index 6e69448e..6d5c4631 100644 --- a/src/lib/server/auth/authorization.ts +++ b/src/lib/server/auth/authorization.ts @@ -38,11 +38,11 @@ const handleAuthorization = (async ({ event, resolve }) => { if (event.route.id?.includes('(public)')) { // Resolve normally return await resolve(event) - } else if (!url.startsWith('/auth')) { + } else if (!url.startsWith('/home') || !url.startsWith('/auth')) { // If the path is something other than /auth, check if the user is logged in if (!user) { - return redirect(303, '/auth') + return redirect(303, '/home') } if (user.accessDisabled) { diff --git a/src/lib/server/auth/index.ts b/src/lib/server/auth/index.ts index 04c43783..b9a7a884 100644 --- a/src/lib/server/auth/index.ts +++ b/src/lib/server/auth/index.ts @@ -32,11 +32,8 @@ const { }, callbacks: { async redirect({ url, baseUrl }) { - if (url.startsWith('/auth')) { - throw redirect(303, '/') - } - - return baseUrl + // Redirect to / after signin + return '/' }, }, }) diff --git a/src/lib/server/settings/settings.ts b/src/lib/server/settings/settings.ts index 735a58e3..a9515f7c 100644 --- a/src/lib/server/settings/settings.ts +++ b/src/lib/server/settings/settings.ts @@ -25,6 +25,7 @@ export enum Setting { DEFAULT_SALE_FOOD_LEDGER = 'DEFAULT_SALE_FOOD_LEDGER', DEFAULT_SALE_OTHER_LEDGER = 'DEFAULT_SALE_OTHER_LEDGER', STRAFBAKKEN_VERDUBBELAAR_ENABLED = 'STRAFBAKKEN_VERDUBBELAAR_ENABLED', + DESCRIPTION_INVICTUS = 'DESCRIPTION_INVICTUS', } export const settings = { diff --git a/src/routes/(app)/activiteit/nieuw/+page.server.ts b/src/routes/(app)/activiteit/nieuw/+page.server.ts index 2ca23600..3cf2c55a 100644 --- a/src/routes/(app)/activiteit/nieuw/+page.server.ts +++ b/src/routes/(app)/activiteit/nieuw/+page.server.ts @@ -239,23 +239,6 @@ export const actions = { if (image.size > 0) { const filename = await uploadPhoto(image, event.locals.user, false) - // const buf = Buffer.from(await image.arrayBuffer()) - - // const photo = await uploadPhoto( - // { - // creator, - // uploader: event.locals.user, - // runProcessingJob: false, - // additionalName: 'Activiteit', - // invisible: true, - // upload: { - // buf, - // filename: image.name, - // }, - // }, - // tx, - // ) - await tx.activity.update({ where: { id: activity.id, diff --git a/src/routes/(app)/admin/+page.svelte b/src/routes/(app)/admin/+page.svelte index a8d33e2f..7bd8f8fb 100644 --- a/src/routes/(app)/admin/+page.svelte +++ b/src/routes/(app)/admin/+page.svelte @@ -9,6 +9,7 @@ import TablerFiles from '~icons/tabler/files' import TablerAdjustmentsCog from '~icons/tabler/adjustments-cog' import TablerListNumbers from '~icons/tabler/list-numbers' + import TablerHome from '~icons/tabler/home' import TablerBeer from '~icons/tabler/beer' import TablerBackhoe from '~icons/tabler/backhoe' import { toast } from '$lib/notification' @@ -53,6 +54,16 @@ +
+
+
+ Temp
+
+ Groep
+
+ lichtingen
+