diff --git a/src/lib/components/EditRecipeNote.svelte b/src/lib/components/EditRecipeNote.svelte new file mode 100644 index 0000000..a4e55d6 --- /dev/null +++ b/src/lib/components/EditRecipeNote.svelte @@ -0,0 +1,22 @@ + + + +
+

Notiz:

+ +
diff --git a/src/lib/components/RecipeNote.svelte b/src/lib/components/RecipeNote.svelte new file mode 100644 index 0000000..89efd49 --- /dev/null +++ b/src/lib/components/RecipeNote.svelte @@ -0,0 +1,23 @@ + + + +
+

Notiz:

+ {@html note} +
diff --git a/src/lib/components/SeasonSelect.svelte b/src/lib/components/SeasonSelect.svelte index 1593869..3117161 100644 --- a/src/lib/components/SeasonSelect.svelte +++ b/src/lib/components/SeasonSelect.svelte @@ -44,6 +44,8 @@ label{ background-color: var(--nord0); color: white; padding: 0.25em 1em; + margin-inline: 0.1em; + line-height: 2em; border-radius: 1000px; cursor: pointer; position: relative; @@ -81,7 +83,8 @@ input[type=checkbox]::after flex-wrap: wrap; flex-direction: row; justify-content: center; - gap: min(1rem, 1dvh); + margin-bottom: 1em; + } diff --git a/src/models/Recipe.ts b/src/models/Recipe.ts index cd7d01d..4ae3f82 100644 --- a/src/models/Recipe.ts +++ b/src/models/Recipe.ts @@ -14,6 +14,7 @@ const RecipeSchema = new mongoose.Schema( caption: String, }], description: {type: String, required: true}, + note: {type: String}, tags : [String], season : [Number], baking: { temperature: {type:String, default: ""}, diff --git a/src/routes/(rezepte)/rezepte/[name]/+page.svelte b/src/routes/(rezepte)/rezepte/[name]/+page.svelte index cd3582c..4871c45 100644 --- a/src/routes/(rezepte)/rezepte/[name]/+page.svelte +++ b/src/routes/(rezepte)/rezepte/[name]/+page.svelte @@ -10,6 +10,7 @@ import TitleImgParallax from '$lib/components/TitleImgParallax.svelte'; import { afterNavigate } from '$app/navigation'; import {season} from '$lib/js/season_store'; + import RecipeNote from '$lib/components/RecipeNote.svelte'; export let data: PageData; @@ -226,8 +227,10 @@ h4{ {tag} {/each} - - + {#if data.note} + + {/if} +
diff --git a/src/routes/(rezepte)/rezepte/edit/[name]/+page.svelte b/src/routes/(rezepte)/rezepte/edit/[name]/+page.svelte index 5cf921c..647e08c 100644 --- a/src/routes/(rezepte)/rezepte/edit/[name]/+page.svelte +++ b/src/routes/(rezepte)/rezepte/edit/[name]/+page.svelte @@ -4,11 +4,13 @@ import SeasonSelect from '$lib/components/SeasonSelect.svelte'; import '$lib/css/action_button.css' import { redirect } from '@sveltejs/kit'; + import EditRecipeNote from '$lib/components/EditRecipeNote.svelte'; export let data: PageData; let preamble = data.recipe.preamble let addendum = data.recipe.addendum let image_preview_url="https://new.bocken.org/static/rezepte/thumb/" + data.recipe.short_name + ".webp" + let note = data.recipe.note import { season } from '$lib/js/season_store'; import { portions } from '$lib/js/portions_store'; @@ -212,7 +214,8 @@ instructions, ingredients, addendum, - preamble + preamble, + note, }, old_short_name, headers: { @@ -347,6 +350,7 @@ button.action_button{

Saison:

+