|
@@ -23,9 +23,6 @@
|
|
}
|
|
}
|
|
if (result.loggedIn) {
|
|
if (result.loggedIn) {
|
|
if (!path.startsWith("/rules")) {
|
|
if (!path.startsWith("/rules")) {
|
|
- if (result.moderator) {
|
|
|
|
- return this.redirect(302, "/rules/edit");
|
|
|
|
- }
|
|
|
|
return this.redirect(302, "/rules");
|
|
return this.redirect(302, "/rules");
|
|
}
|
|
}
|
|
if (!result.moderator && path != "/rules") {
|
|
if (!result.moderator && path != "/rules") {
|
|
@@ -41,6 +38,7 @@
|
|
const { page } = stores();
|
|
const { page } = stores();
|
|
|
|
|
|
export let loggedIn!: boolean;
|
|
export let loggedIn!: boolean;
|
|
|
|
+ export let moderator!: boolean;
|
|
let path: string;
|
|
let path: string;
|
|
$: path = $page.path.slice(1);
|
|
$: path = $page.path.slice(1);
|
|
</script>
|
|
</script>
|
|
@@ -55,7 +53,7 @@
|
|
}
|
|
}
|
|
|
|
|
|
nav {
|
|
nav {
|
|
- @apply fixed w-screen h-12 shadow-lg flex flex-row justify-end items-center px-4 z-10;
|
|
|
|
|
|
+ @apply fixed w-screen h-12 shadow-lg flex flex-row items-center px-4 z-10;
|
|
background-color: #0a0d13;
|
|
background-color: #0a0d13;
|
|
|
|
|
|
a {
|
|
a {
|
|
@@ -68,12 +66,16 @@
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|
|
|
|
|
|
-<svelte:head>
|
|
|
|
- <title>{path ? path.charAt(0).toUpperCase() + path.slice(1) : 'Index'}</title>
|
|
|
|
-</svelte:head>
|
|
|
|
|
|
|
|
{#if loggedIn}
|
|
{#if loggedIn}
|
|
- <nav><a href="/logout">Log out</a></nav>
|
|
|
|
|
|
+ <nav>
|
|
|
|
+ <a href="/rules">Rules</a>
|
|
|
|
+ {#if moderator}
|
|
|
|
+ <a href="/rules/edit">Edit rules</a>
|
|
|
|
+ {/if}
|
|
|
|
+ <span class="mx-auto"></span>
|
|
|
|
+ <a href="/logout">Log out</a>
|
|
|
|
+ </nav>
|
|
{/if}
|
|
{/if}
|
|
|
|
|
|
<div class="flex items-center justify-center bg-gray-900 h-screen w-screen">
|
|
<div class="flex items-center justify-center bg-gray-900 h-screen w-screen">
|