Compare commits

..

No commits in common. "71aabfb9ba145951c4e47c154de13222d0b0e53e" and "022d727394dece36c1e13e48b8f8f461a7568260" have entirely different histories.

5 changed files with 23 additions and 32 deletions

View File

@ -1,12 +1,11 @@
<script lang="ts"> <script lang="ts">
import { onMount } from "svelte"; import { onMount } from "svelte";
export let user; export let username;
function toggle_options(){ function toggle_options(){
const el = document.querySelector("#options") const el = document.querySelector("#options")
el.hidden = !el.hidden el.hidden = !el.hidden
} }
let src="https://bocken.org/static/user/thumb/" + username + ".webp"
onMount( () => { onMount( () => {
document.addEventListener("click", (e) => { document.addEventListener("click", (e) => {
const el = document.querySelector("#button") const el = document.querySelector("#button")
@ -102,12 +101,6 @@
/* (B2) BOTTOM "CALLOUT TAIL" */ /* (B2) BOTTOM "CALLOUT TAIL" */
h2{ h2{
margin-block: 0; margin-block: 0;
font-size: 1.2rem;
}
h2 + p{
padding-top: 0;
margin-top: 0;
font-size: 1.2rem;
} }
@media screen and (max-width: 800px){ @media screen and (max-width: 800px){
#options{ #options{
@ -132,11 +125,10 @@ h2 + p{
} }
</style> </style>
{#if user} {#if username}
<button on:click={toggle_options} style="background-image: url(https://bocken.org/static/user/thumb/{user.nickname}.webp)" id=button> <button on:click={toggle_options} style="background-image: url({src})" id=button>
<div id=options class="speech top" hidden> <div id=options class="speech top" hidden>
<h2>{user.name}</h2> <h2>{username}</h2>
<p>({user.nickname})</p>
<ul> <ul>
<li><a href="https://sso.bocken.org/if/user/#/settings" >Einstellungen</a></li> <li><a href="https://sso.bocken.org/if/user/#/settings" >Einstellungen</a></li>
<li><a href="/auth/signout" >Log Out</a></li> <li><a href="/auth/signout" >Log Out</a></li>

View File

@ -2,15 +2,23 @@
import Header from '$lib/components/Header.svelte' import Header from '$lib/components/Header.svelte'
import UserHeader from '$lib/components/UserHeader.svelte'; import UserHeader from '$lib/components/UserHeader.svelte';
export let data export let data
let user; let username = ""
if(data.session){ if(data.session){
user = data.session.user username = data.session.user.name
} }
console.log(data)
</script> </script>
<Header> <Header>
<ul class=site_header slot=links> <ul class=site_header slot=links>
<li><a href="/rezepte">Rezepte</a></li>
<li><a href="/git">Git</a></li>
<li><a href="https://stream.bocken.org">Streaming</a></li>
<li><a href="/bilder">Bilder</a></li>
<li><a href="https://meet.bocken.org">Jitsi</a></li>
<li><a href="https://cloud.bocken.org">Cloud</a></li>
<li><a href="/searx">Searx</a></li>
</ul> </ul>
<UserHeader {user} slot=right_side></UserHeader> <UserHeader {username} slot=right_side></UserHeader>
<slot></slot> <slot></slot>
</Header> </Header>

View File

@ -53,14 +53,6 @@ section h2{
} }
</style> </style>
<svelte:head>
<title>Bocken</title>
<meta name="description" content="Die persönliche Website von Alexander Bocken" />
<meta property="og:image" content="https://bocken.org/static/favicon.png" />
<meta property="og:image:secure_url" content="https://bocken.org/favicon.png" />
<meta property="og:image:type" content="image/png" />
<meta property="og:image:alt" content="Das Familienwappen simplifiziert" />
</svelte:head>
{#if ! data.session} {#if ! data.session}
<section class=hero> <section class=hero>
@ -82,7 +74,6 @@ section h2{
{/if} {/if}
<section> <section>
<h2>Seiten</h2> <h2>Seiten</h2>
<LinksGrid> <LinksGrid>
<a href="rezepte"> <a href="rezepte">

View File

@ -1,8 +1,8 @@
import type { PageServerLoad } from "./$types" import type { Actions, PageServerLoad } from "./$types"
import { error } from "@sveltejs/kit" import { error } from "@sveltejs/kit"
export const load : PageServerLoad = async ({locals}) => { export const load = (async ({cookies, locals}) => {
return { return {
session: await locals.auth() session: await locals.getSession()
} }
}; });

View File

@ -2,9 +2,9 @@
import Header from '$lib/components/Header.svelte' import Header from '$lib/components/Header.svelte'
import UserHeader from '$lib/components/UserHeader.svelte'; import UserHeader from '$lib/components/UserHeader.svelte';
export let data export let data
let user; let username = ""
if(data.session){ if(data.session){
user = data.session.user username = data.session.user.name
} }
</script> </script>
@ -16,6 +16,6 @@ if(data.session){
<li><a href="/rezepte/icon">Icon</a></li> <li><a href="/rezepte/icon">Icon</a></li>
<li><a href="/rezepte/tag">Stichwörter</a></li> <li><a href="/rezepte/tag">Stichwörter</a></li>
</ul> </ul>
<UserHeader slot=right_side {user}></UserHeader> <UserHeader slot=right_side {username}></UserHeader>
<slot></slot> <slot></slot>
</Header> </Header>