diff --git a/src/lib/components/Card.svelte b/src/lib/components/Card.svelte index 204fbbc..5a46d88 100644 --- a/src/lib/components/Card.svelte +++ b/src/lib/components/Card.svelte @@ -11,6 +11,8 @@ export let isFavorite = false; export let showFavoriteIndicator = false; // to manually override lazy loading for top cards export let loading_strat : "lazy" | "eager" | undefined; +// route prefix for language support (/rezepte or /recipes) +export let routePrefix = '/rezepte'; if(loading_strat === undefined){ loading_strat = "lazy" } @@ -27,7 +29,9 @@ onMount(() => { isloaded = document.querySelector("img")?.complete ? true : false }) -const img_name=recipe.short_name + ".webp?v=" + recipe.dateModified +// Use germanShortName for images if available (English recipes), otherwise use short_name (German recipes) +const imageShortName = recipe.germanShortName || recipe.short_name; +const img_name = imageShortName + ".webp?v=" + recipe.dateModified + +
+ {#each ingredients as group, groupIndex} +
+ updateIngredientGroupName(groupIndex, e)} + placeholder="Ingredient group name" + /> + {#each group.list as item, itemIndex} +
+ updateIngredientItem(groupIndex, itemIndex, 'amount', e)} + placeholder="Amt" + /> + updateIngredientItem(groupIndex, itemIndex, 'unit', e)} + placeholder="Unit" + /> + updateIngredientItem(groupIndex, itemIndex, 'name', e)} + placeholder="Ingredient name" + /> +
+ {/each} +
+ {/each} +
diff --git a/src/lib/components/EditableInstructions.svelte b/src/lib/components/EditableInstructions.svelte new file mode 100644 index 0000000..935e706 --- /dev/null +++ b/src/lib/components/EditableInstructions.svelte @@ -0,0 +1,140 @@ + + + + +
+ {#each instructions as group, groupIndex} +
+ updateInstructionGroupName(groupIndex, e)} + placeholder="Instruction section name" + /> + {#each group.steps as step, stepIndex} +
+
{stepIndex + 1}
+