generated from cms/tibi-docs
backend and api endpoints
This commit is contained in:
52
frontend/src/lib/components/NotFound.svelte
Normal file
52
frontend/src/lib/components/NotFound.svelte
Normal file
@@ -0,0 +1,52 @@
|
||||
<script>
|
||||
import { navigate } from "svelte-routing"
|
||||
</script>
|
||||
|
||||
<div class="not-found">
|
||||
<div class="content">
|
||||
<h1>404</h1>
|
||||
<h2>Seite nicht gefunden</h2>
|
||||
<p>
|
||||
Die gesuchte Seite wurde möglicherweise entfernt, ihr Name wurde geändert oder sie ist vorübergehend nicht
|
||||
verfügbar.
|
||||
</p>
|
||||
<button on:click="{() => navigate('/')}" class="back-home">Zurück zur Startseite</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style lang="less">
|
||||
@import "../assets/css/main.less";
|
||||
.not-found {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-height: 100vh;
|
||||
|
||||
.content {
|
||||
text-align: center;
|
||||
padding: 2rem;
|
||||
background-color: rgba(255, 255, 255, 0.9);
|
||||
|
||||
h1 {
|
||||
font-size: 6rem;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 2rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.back-home {
|
||||
text-decoration: none;
|
||||
border: 1px solid black;
|
||||
padding: 0.5rem 1rem;
|
||||
transition: background-color 0.2s, color 0.2s;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
5
frontend/src/lib/components/Pagebuilder/Homepage.svelte
Normal file
5
frontend/src/lib/components/Pagebuilder/Homepage.svelte
Normal file
@@ -0,0 +1,5 @@
|
||||
<script lang="ts">
|
||||
export let row: Row
|
||||
</script>
|
||||
|
||||
<stlye lang="less"></stlye>
|
||||
@@ -0,0 +1,8 @@
|
||||
<script lang="ts">
|
||||
export let row: Row
|
||||
</script>
|
||||
|
||||
<div></div>
|
||||
|
||||
<style lang="less">
|
||||
</style>
|
||||
27
frontend/src/lib/components/Pagebuilder/Rows.svelte
Normal file
27
frontend/src/lib/components/Pagebuilder/Rows.svelte
Normal file
@@ -0,0 +1,27 @@
|
||||
<script lang="ts">
|
||||
import { init } from "svelte/internal"
|
||||
import { pages } from "../../store"
|
||||
|
||||
export let path
|
||||
export let homepage = false
|
||||
|
||||
let page: Page
|
||||
function initPage() {
|
||||
page = $pages[path]
|
||||
}
|
||||
|
||||
$: {
|
||||
if (Object.keys($pages).length) {
|
||||
initPage()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div>
|
||||
{#if page}
|
||||
{page.path}
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<style lang="less">
|
||||
</style>
|
||||
6
frontend/src/lib/functions/getPages.ts
Normal file
6
frontend/src/lib/functions/getPages.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { api } from "../../api"
|
||||
|
||||
export async function loadPages(): Promise<Page[]> {
|
||||
let site = await api<Page[]>("page", {})
|
||||
return site.data
|
||||
}
|
||||
6
frontend/src/lib/functions/loadNavigation.ts
Normal file
6
frontend/src/lib/functions/loadNavigation.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { api } from "../../api"
|
||||
|
||||
export async function loadNavigation(): Promise<Navigation[]> {
|
||||
let nav = await api<Navigation[]>("navigation", {})
|
||||
return nav.data
|
||||
}
|
||||
15
frontend/src/lib/store.ts
Normal file
15
frontend/src/lib/store.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { writable } from "svelte/store"
|
||||
|
||||
const initLoc = {
|
||||
path: (typeof window !== "undefined" && window.location?.pathname) || "/",
|
||||
search: (typeof window !== "undefined" && window.location?.search) || "",
|
||||
hash: (typeof window !== "undefined" && window.location?.hash) || "",
|
||||
push: false,
|
||||
pop: false,
|
||||
categoryPath: "",
|
||||
}
|
||||
export const location = writable(initLoc)
|
||||
|
||||
export let navigation = writable<Navigation>()
|
||||
export let pages = writable<Pages>({})
|
||||
export let serviceNavigation = writable<Navigation>()
|
||||
Reference in New Issue
Block a user