First fully working user management, move to layout groups

This commit is contained in:
2023-07-18 14:18:52 +02:00
parent 70e640aa9a
commit 7dd52d8890
55 changed files with 366 additions and 192 deletions

View File

@ -1,16 +0,0 @@
<script lang="ts">
import type { PageData } from './$types';
export let data: PageData;
import TagCloud from '$lib/components/TagCloud.svelte';
import TagBall from '$lib/components/TagBall.svelte';
</script>
<h1>Rezepte</h1>
<h2>Kategorien</h2>
<section>
<TagCloud>
{#each data.categories as tag}
<TagBall {tag} ref="/rezepte/category">
</TagBall>
{/each}
</TagCloud>
</section>

View File

@ -1,7 +0,0 @@
import type { PageLoad } from "./$types";
export async function load({ fetch}) {
const res = await fetch(`/api/items/category`);
const categories= await res.json();
return {categories}
};

View File

@ -1,19 +0,0 @@
<script lang="ts">
import type { PageData } from './$types';
import Recipes from '$lib/components/Recipes.svelte';
import Search from '$lib/components/Search.svelte';
export let data: PageData;
export let current_month = new Date().getMonth() + 1;
import Card from '$lib/components/Card.svelte'
import { rand_array } from '$lib/js/randomize';
</script>
<h1>Rezepte</h1>
<h2>In Kategorie {data.category}</h2>
<Search></Search>
<section>
<Recipes>
{#each rand_array(data.recipes) as recipe}
<Card {recipe} {current_month}></Card>
{/each}
</Recipes>
</section>

View File

@ -1,10 +0,0 @@
import type { PageLoad } from "./$types";
export async function load({ fetch, params }) {
const res = await fetch(`/api/items/category/${params.category}`);
const items = await res.json();
return {
category: params.category,
recipes: items
}
};