header: display custom title instead of user info when public

This commit is contained in:
axolotle 2024-01-19 13:36:45 +01:00
parent 35e4629c0a
commit 4ece760ab6

View file

@ -69,26 +69,31 @@ async function logout() {
</NuxtLink> </NuxtLink>
<div <div
class="flex min-[500px]:w-full max-[500px]:flex-col max-[500px]:ms-auto" class="flex flex-grow flex-wrap min-[500px]:w-full max-[500px]:flex-col max-[500px]:ms-auto"
> >
<!-- eslint-disable-next-line vuejs-accessibility/click-events-have-key-events vuejs-accessibility/no-static-element-interactions --> <!-- eslint-disable-next-line vuejs-accessibility/click-events-have-key-events vuejs-accessibility/no-static-element-interactions -->
<div class="profile cursor-pointer" @click="navigateTo('/edit')"> <div v-if="user" class="flex-grow">
<div> <div class="profile cursor-pointer flex flex-col" @click="navigateTo('/edit')">
<span>
<span <span
class="text-2xl font-extrabold tracking-tight leading-none" class="text-2xl font-extrabold tracking-tight leading-none"
> >
{{ user?.username || t('visitor') }} {{ user.username }}
</span> </span>
<YIcon v-if="user" name="pencil" size="1.25em" class="ms-2" /> <YIcon name="pencil" size="1.25em" class="ms-2" />
</div> </span>
<div v-if="user" class="leading-none">{{ user.fullname }}</div> <span class="leading-none">{{ user.fullname }}</span>
<div v-if="user" class="opacity-50">{{ user.mail }}</div> <span class="opacity-50">{{ user.mail }}</span>
<NuxtLink to="/edit" class="link sr-only focus:not-sr-only"> <NuxtLink to="/edit" class="link sr-only focus:not-sr-only">
{{ t('footerlink_edit') }} {{ t('footerlink_edit') }}
</NuxtLink> </NuxtLink>
</div> </div>
</div>
<p v-else-if="settings.portal_title" class="text-3xl font-bold flex-grow min-[800px]:text-center mb-3">
{{ settings.portal_title }}
</p>
<div class="min-[500px]:ms-auto max-[500px]:mt-2"> <div class="max-[500px]:mt-2">
<YButton <YButton
v-if="isLoggedIn" v-if="isLoggedIn"
icon="logout" icon="logout"
@ -109,12 +114,12 @@ async function logout() {
<footer <footer
v-if="isLoggedIn" v-if="isLoggedIn"
id="main-footer" id="main-footer"
class="mt-auto focus-target" class="mt-auto focus-target border-t border-gray-500"
tabindex="-1" tabindex="-1"
> >
<slot name="footer"> <slot name="footer">
<nav <nav
class="flex pt-2 flex-col border-t border-gray-500 flex-wrap text-center sm:space-x-5 sm:flex-row sm:inline-flex" class="flex pt-2 flex-col flex-wrap text-center sm:space-x-5 sm:flex-row sm:inline-flex"
> >
<NuxtLink <NuxtLink
v-for="link in footerLinks" v-for="link in footerLinks"