mirror of
https://github.com/thiloho/archtika.git
synced 2025-11-22 19:01:35 +01:00
Add disable attribute for no permission buttons and shorten query param names
This commit is contained in:
@@ -10,7 +10,7 @@ import { join } from "node:path";
|
||||
import { render } from "svelte/server";
|
||||
import type { Actions, PageServerLoad } from "./$types";
|
||||
|
||||
export const load: PageServerLoad = async ({ params, fetch }) => {
|
||||
export const load: PageServerLoad = async ({ params, fetch, parent }) => {
|
||||
const websiteOverview: WebsiteOverview = (
|
||||
await apiRequest(
|
||||
fetch,
|
||||
@@ -27,10 +27,13 @@ export const load: PageServerLoad = async ({ params, fetch }) => {
|
||||
|
||||
const { websitePreviewUrl, websiteProdUrl } = await generateStaticFiles(websiteOverview);
|
||||
|
||||
const { permissionLevel } = await parent();
|
||||
|
||||
return {
|
||||
websiteOverview,
|
||||
websitePreviewUrl,
|
||||
websiteProdUrl
|
||||
websiteProdUrl,
|
||||
permissionLevel
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
be published on the Internet.
|
||||
</p>
|
||||
<form method="POST" action="?/publishWebsite" use:enhance={enhanceForm()}>
|
||||
<button type="submit">Publish</button>
|
||||
<button type="submit" disabled={[10, 20].includes(data.permissionLevel)}>Publish</button>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
required
|
||||
/>
|
||||
</label>
|
||||
<button type="submit">Submit</button>
|
||||
<button type="submit" disabled={[10, 20].includes(data.permissionLevel)}>Submit</button>
|
||||
</form>
|
||||
{#if data.websiteOverview.domain_prefix?.prefix}
|
||||
<Modal id="delete-domain-prefix" text="Delete">
|
||||
@@ -87,7 +87,9 @@
|
||||
<strong>Caution!</strong>
|
||||
This action will remove the domain prefix and reset it to its initial value.
|
||||
</p>
|
||||
<button type="submit">Delete domain prefix</button>
|
||||
<button type="submit" disabled={[10, 20].includes(data.permissionLevel)}
|
||||
>Delete domain prefix</button
|
||||
>
|
||||
</form>
|
||||
</Modal>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user