mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-24 07:15:24 -07:00
Merge branch 'mealie-next' into fix/admin-users-couldnt-delete-other-household-recipes
This commit is contained in:
commit
4c39c4cfa4
3 changed files with 28 additions and 41 deletions
|
@ -29,33 +29,31 @@
|
||||||
{{ activeText }}
|
{{ activeText }}
|
||||||
</p>
|
</p>
|
||||||
<v-divider class="mb-4" />
|
<v-divider class="mb-4" />
|
||||||
<v-checkbox
|
<v-checkbox-btn
|
||||||
v-for="ing in unusedIngredients"
|
v-for="ing in unusedIngredients"
|
||||||
:key="ing.referenceId"
|
:key="ing.referenceId"
|
||||||
v-model="activeRefs"
|
v-model="activeRefs"
|
||||||
:value="ing.referenceId"
|
:value="ing.referenceId"
|
||||||
class="mb-n2 mt-n2"
|
|
||||||
>
|
>
|
||||||
<template #label>
|
<template #label>
|
||||||
<RecipeIngredientHtml :markup="parseIngredientText(ing, recipe.settings.disableAmount)" />
|
<RecipeIngredientHtml :markup="parseIngredientText(ing, recipe.settings.disableAmount)" />
|
||||||
</template>
|
</template>
|
||||||
</v-checkbox>
|
</v-checkbox-btn>
|
||||||
|
|
||||||
<template v-if="usedIngredients.length > 0">
|
<template v-if="usedIngredients.length > 0">
|
||||||
<h4 class="py-3 ml-1">
|
<h4 class="py-3 ml-1">
|
||||||
{{ $t("recipe.linked-to-other-step") }}
|
{{ $t("recipe.linked-to-other-step") }}
|
||||||
</h4>
|
</h4>
|
||||||
<v-checkbox
|
<v-checkbox-btn
|
||||||
v-for="ing in usedIngredients"
|
v-for="ing in usedIngredients"
|
||||||
:key="ing.referenceId"
|
:key="ing.referenceId"
|
||||||
v-model="activeRefs"
|
v-model="activeRefs"
|
||||||
:value="ing.referenceId"
|
:value="ing.referenceId"
|
||||||
class="mb-n2 mt-n2"
|
|
||||||
>
|
>
|
||||||
<template #label>
|
<template #label>
|
||||||
<RecipeIngredientHtml :markup="parseIngredientText(ing, recipe.settings.disableAmount)" />
|
<RecipeIngredientHtml :markup="parseIngredientText(ing, recipe.settings.disableAmount)" />
|
||||||
</template>
|
</template>
|
||||||
</v-checkbox>
|
</v-checkbox-btn>
|
||||||
</template>
|
</template>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
|
|
||||||
|
|
|
@ -66,12 +66,12 @@
|
||||||
<v-card-text class="mt-n5">
|
<v-card-text class="mt-n5">
|
||||||
<div class="mt-4 d-flex align-center">
|
<div class="mt-4 d-flex align-center">
|
||||||
<v-text-field
|
<v-text-field
|
||||||
:model-value="yieldQuantityEditorValue"
|
:model-value="yieldQuantity"
|
||||||
type="number"
|
type="number"
|
||||||
:min="0"
|
:min="0"
|
||||||
variant="underlined"
|
variant="underlined"
|
||||||
hide-spin-buttons
|
hide-spin-buttons
|
||||||
@update:model-value="recalculateScale(yieldQuantityEditorValue)"
|
@update:model-value="recalculateScale(parseFloat($event) || 0)"
|
||||||
/>
|
/>
|
||||||
<v-tooltip
|
<v-tooltip
|
||||||
end
|
end
|
||||||
|
@ -81,6 +81,7 @@
|
||||||
<v-btn
|
<v-btn
|
||||||
v-bind="props"
|
v-bind="props"
|
||||||
icon
|
icon
|
||||||
|
flat
|
||||||
class="mx-1"
|
class="mx-1"
|
||||||
size="small"
|
size="small"
|
||||||
@click="scale = 1"
|
@click="scale = 1"
|
||||||
|
@ -178,21 +179,8 @@ export default defineNuxtComponent({
|
||||||
: "";
|
: "";
|
||||||
});
|
});
|
||||||
|
|
||||||
// only update yield quantity when the menu opens, so we don't override the user's input
|
|
||||||
const yieldQuantityEditorValue = ref(recipeYieldAmount.value.scaledAmount);
|
|
||||||
watch(
|
|
||||||
() => menu.value,
|
|
||||||
() => {
|
|
||||||
if (!menu.value) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
yieldQuantityEditorValue.value = recipeYieldAmount.value.scaledAmount;
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
const disableDecrement = computed(() => {
|
const disableDecrement = computed(() => {
|
||||||
return recipeYieldAmount.value.scaledAmount <= 1;
|
return yieldQuantity.value <= 1;
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -202,7 +190,6 @@ export default defineNuxtComponent({
|
||||||
recalculateScale,
|
recalculateScale,
|
||||||
yieldDisplay,
|
yieldDisplay,
|
||||||
yieldQuantity,
|
yieldQuantity,
|
||||||
yieldQuantityEditorValue,
|
|
||||||
disableDecrement,
|
disableDecrement,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
|
@ -8,24 +8,26 @@
|
||||||
class="flex-nowrap align-center"
|
class="flex-nowrap align-center"
|
||||||
>
|
>
|
||||||
<v-col :cols="itemLabelCols">
|
<v-col :cols="itemLabelCols">
|
||||||
<v-checkbox
|
<div class="d-flex align-center flex-nowrap">
|
||||||
v-model="listItem.checked"
|
<v-checkbox
|
||||||
class="mt-0"
|
v-model="listItem.checked"
|
||||||
color="null"
|
hide-details
|
||||||
hide-details
|
density="compact"
|
||||||
density="compact"
|
class="mt-0"
|
||||||
:label="listItem.note!"
|
color="null"
|
||||||
@change="$emit('checked', listItem)"
|
@change="$emit('checked', listItem)"
|
||||||
>
|
/>
|
||||||
<template #label>
|
<div
|
||||||
<div :class="listItem.checked ? 'strike-through' : ''">
|
class="ml-2 text-truncate"
|
||||||
<RecipeIngredientListItem
|
:class="listItem.checked ? 'strike-through' : ''"
|
||||||
:ingredient="listItem"
|
style="min-width: 0;"
|
||||||
:disable-amount="!(listItem.isFood || listItem.quantity !== 1)"
|
>
|
||||||
/>
|
<RecipeIngredientListItem
|
||||||
</div>
|
:ingredient="listItem"
|
||||||
</template>
|
:disable-amount="!(listItem.isFood || listItem.quantity !== 1)"
|
||||||
</v-checkbox>
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-spacer />
|
<v-spacer />
|
||||||
<v-col
|
<v-col
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue