implemented user login.
next: find a solution for routing
This commit is contained in:
6
frontend/src/Components/Footer.svelte
Normal file
6
frontend/src/Components/Footer.svelte
Normal file
@@ -0,0 +1,6 @@
|
||||
<script>
|
||||
import { t } from '../translations.svelte.js';
|
||||
</script>
|
||||
<footer>
|
||||
{@html t('footer.message','<a href="https://srsoftware.de">SRSoftware</a>')}
|
||||
</footer>
|
||||
@@ -2,4 +2,4 @@
|
||||
import { t } from '../translations.svelte.js';
|
||||
import { user } from '../user.svelte.js';
|
||||
</script>
|
||||
<h1>{t('home.Welcome')}, {user.username}</h1>
|
||||
<h1>{t('home.Welcome',user.name)}</h1>
|
||||
@@ -3,11 +3,13 @@
|
||||
import { user } from '../user.svelte.js';
|
||||
|
||||
function logout(){
|
||||
user.username = null;
|
||||
user.name = null;
|
||||
}
|
||||
</script>
|
||||
<nav>
|
||||
<a href="/">{t('nav.Home')}</a>
|
||||
<a href="https://svelte.dev/tutorial/svelte/state" target="_blank">{t('nav.Tutorial')}</a>
|
||||
{#if user.name }
|
||||
<a href="#" on:click={logout}>Logout</a>
|
||||
{/if}
|
||||
</nav>
|
||||
Reference in New Issue
Block a user