|
@@ -23,9 +23,6 @@
|
|
|
}
|
|
|
if (result.loggedIn) {
|
|
|
if (!path.startsWith("/rules")) {
|
|
|
- if (result.moderator) {
|
|
|
- return this.redirect(302, "/rules/edit");
|
|
|
- }
|
|
|
return this.redirect(302, "/rules");
|
|
|
}
|
|
|
if (!result.moderator && path != "/rules") {
|
|
@@ -41,6 +38,7 @@
|
|
|
const { page } = stores();
|
|
|
|
|
|
export let loggedIn!: boolean;
|
|
|
+ export let moderator!: boolean;
|
|
|
let path: string;
|
|
|
$: path = $page.path.slice(1);
|
|
|
</script>
|
|
@@ -55,7 +53,7 @@
|
|
|
}
|
|
|
|
|
|
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;
|
|
|
|
|
|
a {
|
|
@@ -68,12 +66,16 @@
|
|
|
}
|
|
|
</style>
|
|
|
|
|
|
-<svelte:head>
|
|
|
- <title>{path ? path.charAt(0).toUpperCase() + path.slice(1) : 'Index'}</title>
|
|
|
-</svelte:head>
|
|
|
|
|
|
{#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}
|
|
|
|
|
|
<div class="flex items-center justify-center bg-gray-900 h-screen w-screen">
|