2025-06-30 18:58:24 +02:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: © 2025 Hornwitser <code@hornwitser.no>
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
-->
|
2025-03-07 12:41:57 +01:00
|
|
|
<template>
|
|
|
|
<header>
|
|
|
|
<nav>
|
|
|
|
<ul>
|
2025-03-09 22:21:13 +01:00
|
|
|
<li>
|
|
|
|
<NuxtLink to="/">Home</NuxtLink>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<NuxtLink to="/schedule">Schedule</NuxtLink>
|
|
|
|
</li>
|
2025-05-24 20:01:23 +02:00
|
|
|
<li v-if="accountStore.canEdit">
|
2025-03-09 22:21:13 +01:00
|
|
|
<NuxtLink to="/edit">Edit</NuxtLink>
|
2025-06-23 00:20:33 +02:00
|
|
|
</li>
|
|
|
|
<li v-if="accountStore.isAdmin">
|
|
|
|
<NuxtLink to="/admin">Admin</NuxtLink>
|
2025-06-24 15:58:34 +02:00
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<NuxtLink to="/about">About</NuxtLink>
|
2025-03-09 22:21:13 +01:00
|
|
|
</li>
|
2025-03-07 12:41:57 +01:00
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
<div class="account">
|
2025-05-24 20:01:23 +02:00
|
|
|
<template v-if="accountStore.valid">
|
|
|
|
{{ accountStore.name }}
|
|
|
|
(s:{{ sessionStore.id }} a:{{ accountStore.id }}{{ sessionStore.push ? " push" : null }})
|
|
|
|
{{ accountStore.type }}
|
2025-03-07 18:43:24 +01:00
|
|
|
<NuxtLink to="/account/settings">Settings</NuxtLink>
|
2025-06-17 22:29:16 +02:00
|
|
|
<ButtonLogOut v-if="accountStore.type !== 'anonymous'"/>
|
2025-03-07 12:41:57 +01:00
|
|
|
</template>
|
|
|
|
<template v-else>
|
|
|
|
<NuxtLink to="/login">Log In</NuxtLink>
|
|
|
|
</template>
|
|
|
|
</div>
|
|
|
|
</header>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
2025-05-24 20:01:23 +02:00
|
|
|
const accountStore = useAccountStore();
|
2025-05-24 17:53:33 +02:00
|
|
|
const sessionStore = useSessionStore();
|
2025-03-07 12:41:57 +01:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
header {
|
|
|
|
line-height: 1.5; /* Prevent layout shift from log out button */
|
|
|
|
display: flex;
|
|
|
|
column-gap: 1em;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
border-bottom: 1px solid var(--foreground);
|
|
|
|
margin-block-start: 1rem;
|
|
|
|
}
|
|
|
|
.account {
|
|
|
|
display: flex;
|
|
|
|
justify-content: end;
|
|
|
|
flex-grow: 1;
|
|
|
|
column-gap: 0.5em;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
}
|
|
|
|
nav ul {
|
|
|
|
padding: 0;
|
|
|
|
display: flex;
|
|
|
|
column-gap: 0.5em;
|
2025-03-09 22:21:13 +01:00
|
|
|
list-style: none;
|
2025-03-07 12:41:57 +01:00
|
|
|
}
|
|
|
|
</style>
|