From c948e2e2706465490908f0e8f4509e71005b0336 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Sun, 4 Jan 2026 02:53:17 -0800 Subject: [PATCH] add job creation page and navigation dropdown - new job page with form for job properties - nav dropdown with options for new job and new accessory --- src/lib/components/Navigation.svelte | 16 +- .../(app)/database/jobs/new/+page.server.ts | 16 + .../(app)/database/jobs/new/+page.svelte | 352 ++++++++++++++++++ 3 files changed, 381 insertions(+), 3 deletions(-) create mode 100644 src/routes/(app)/database/jobs/new/+page.server.ts create mode 100644 src/routes/(app)/database/jobs/new/+page.svelte diff --git a/src/lib/components/Navigation.svelte b/src/lib/components/Navigation.svelte index 76ca7e1d..9609d4d5 100644 --- a/src/lib/components/Navigation.svelte +++ b/src/lib/components/Navigation.svelte @@ -80,6 +80,7 @@ if (path.startsWith(databaseCharactersHref)) return 'character' if (path.startsWith(databaseWeaponsHref)) return 'weapon' if (path.startsWith(databaseSummonsHref)) return 'summon' + if (path.startsWith(databaseJobsHref)) return 'job' if (path.startsWith(databaseRaidsHref) || path.startsWith(databaseRaidGroupsHref)) return 'raid' return null }) @@ -92,9 +93,11 @@ ? 'weapon' : currentDatabaseEntity === 'summon' ? 'summon' - : currentDatabaseEntity === 'raid' - ? 'raid' - : null + : currentDatabaseEntity === 'job' + ? 'job' + : currentDatabaseEntity === 'raid' + ? 'raid' + : null ) const databaseNewHref = $derived( currentDatabaseEntity === 'character' @@ -373,6 +376,13 @@ New raid group + {:else if currentDatabaseEntity === 'job'} + + New job + + + New job accessory + {:else} {#if databaseNewHref} diff --git a/src/routes/(app)/database/jobs/new/+page.server.ts b/src/routes/(app)/database/jobs/new/+page.server.ts new file mode 100644 index 00000000..2fcdfe76 --- /dev/null +++ b/src/routes/(app)/database/jobs/new/+page.server.ts @@ -0,0 +1,16 @@ +import type { PageServerLoad } from './$types' +import { redirect } from '@sveltejs/kit' + +export const load: PageServerLoad = async ({ parent }) => { + // Get parent data to access role + const parentData = await parent() + + // Check if user has editor role + if (!parentData.role || parentData.role < 7) { + throw redirect(302, '/database/jobs') + } + + return { + role: parentData.role + } +} diff --git a/src/routes/(app)/database/jobs/new/+page.svelte b/src/routes/(app)/database/jobs/new/+page.svelte new file mode 100644 index 00000000..8d3585c0 --- /dev/null +++ b/src/routes/(app)/database/jobs/new/+page.svelte @@ -0,0 +1,352 @@ + + + + + + +
+
+
+ +

New Job

+
+
+ + +
+
+ + {#if saveError} +
{saveError}
+ {/if} + +
+ +
+ + +
+
+ + +
+
+ + +
+ + +

The unique game identifier for this job

+
+
+ + +

Display order within the job row

+
+
+ + +
+ + +
+
+ + +
+
+ + +
+
+ + +

For EX2 jobs, select the Row IV/V job they are based on

+
+
+ + +
+ +

Job has master levels

+
+
+ +

Job has ultimate mastery

+
+
+ +

Job supports accessories (shields/manatura)

+
+
+ +

Job supports auxiliary weapon slot

+
+
+
+
+ +