Compare commits
1 Commits
0dc950c824
...
7f4022f9f7
| Author | SHA1 | Date | |
|---|---|---|---|
|
7f4022f9f7
|
@@ -85,22 +85,24 @@
|
|||||||
return season;
|
return season;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prepare German recipe data - use $derived to prevent infinite effect loops
|
// Prepare German recipe data
|
||||||
let germanRecipeData = $derived({
|
function getGermanRecipeData() {
|
||||||
...card_data,
|
return {
|
||||||
...add_info,
|
...card_data,
|
||||||
images: uploaded_image_filename ? [{ mediapath: uploaded_image_filename, alt: "", caption: "" }] : [],
|
...add_info,
|
||||||
season: season_local,
|
images: uploaded_image_filename ? [{ mediapath: uploaded_image_filename, alt: "", caption: "" }] : [],
|
||||||
short_name: short_name.trim(),
|
season: season_local,
|
||||||
portions: portions_local,
|
short_name: short_name.trim(),
|
||||||
datecreated: new Date(),
|
portions: portions_local,
|
||||||
datemodified: new Date(),
|
datecreated: new Date(),
|
||||||
instructions,
|
datemodified: new Date(),
|
||||||
ingredients,
|
instructions,
|
||||||
preamble,
|
ingredients,
|
||||||
addendum,
|
preamble,
|
||||||
isBaseRecipe,
|
addendum,
|
||||||
});
|
isBaseRecipe,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// Show translation workflow before submission
|
// Show translation workflow before submission
|
||||||
function prepareSubmit() {
|
function prepareSubmit() {
|
||||||
@@ -383,7 +385,7 @@ button.action_button {
|
|||||||
{#if showTranslationWorkflow}
|
{#if showTranslationWorkflow}
|
||||||
<div id="translation-section">
|
<div id="translation-section">
|
||||||
<TranslationApproval
|
<TranslationApproval
|
||||||
germanData={germanRecipeData}
|
germanData={getGermanRecipeData()}
|
||||||
onapproved={handleTranslationApproved}
|
onapproved={handleTranslationApproved}
|
||||||
onskipped={handleTranslationSkipped}
|
onskipped={handleTranslationSkipped}
|
||||||
oncancelled={handleTranslationCancelled}
|
oncancelled={handleTranslationCancelled}
|
||||||
|
|||||||
@@ -103,8 +103,8 @@
|
|||||||
return season;
|
return season;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get current German recipe data - use $derived to prevent infinite effect loops
|
// Get current German recipe data
|
||||||
let currentRecipeData = $derived.by(() => {
|
function getCurrentRecipeData() {
|
||||||
// Ensure we always have a valid images array with at least one item
|
// Ensure we always have a valid images array with at least one item
|
||||||
let recipeImages;
|
let recipeImages;
|
||||||
if (uploaded_image_filename) {
|
if (uploaded_image_filename) {
|
||||||
@@ -142,11 +142,11 @@
|
|||||||
note,
|
note,
|
||||||
isBaseRecipe,
|
isBaseRecipe,
|
||||||
};
|
};
|
||||||
});
|
}
|
||||||
|
|
||||||
// Detect which fields have changed from the original
|
// Detect which fields have changed from the original
|
||||||
function detectChangedFields(): string[] {
|
function detectChangedFields(): string[] {
|
||||||
const current = currentRecipeData;
|
const current = getCurrentRecipeData();
|
||||||
const changed: string[] = [];
|
const changed: string[] = [];
|
||||||
|
|
||||||
const fieldsToCheck = [
|
const fieldsToCheck = [
|
||||||
@@ -486,7 +486,7 @@
|
|||||||
{#if showTranslationWorkflow}
|
{#if showTranslationWorkflow}
|
||||||
<div id="translation-section">
|
<div id="translation-section">
|
||||||
<TranslationApproval
|
<TranslationApproval
|
||||||
germanData={currentRecipeData}
|
germanData={getCurrentRecipeData()}
|
||||||
englishData={translationData}
|
englishData={translationData}
|
||||||
changedFields={changedFields}
|
changedFields={changedFields}
|
||||||
isEditMode={true}
|
isEditMode={true}
|
||||||
|
|||||||
Reference in New Issue
Block a user