mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 04:10:06 -05:00
various fixes
This commit is contained in:
@@ -87,24 +87,27 @@
|
||||
<!-- </template>-->
|
||||
|
||||
<v-btn-group divided border>
|
||||
<v-btn icon="" @click="e.amount = e.amount / 2; updateEntryAmount(e)">
|
||||
<v-btn icon="" @click="e.amount = e.amount / 2; updateEntryAmount(e)" v-if="!e.listRecipeData">
|
||||
<v-icon icon="fa-solid fa-divide"></v-icon>
|
||||
</v-btn>
|
||||
<v-btn icon="" @click="e.amount--; updateEntryAmount(e)">
|
||||
<v-btn icon="" @click="e.amount--; updateEntryAmount(e)" v-if="!e.listRecipeData">
|
||||
<v-icon icon="fa-solid fa-minus"></v-icon>
|
||||
</v-btn>
|
||||
<v-btn icon="" @click="e.amount++; updateEntryAmount(e)">
|
||||
<v-btn icon="" @click="e.amount++; updateEntryAmount(e)" v-if="!e.listRecipeData">
|
||||
<v-icon icon="fa-solid fa-plus"></v-icon>
|
||||
</v-btn>
|
||||
|
||||
<v-btn icon="" @click="e.amount = e.amount * 2; updateEntryAmount(e)">
|
||||
<v-btn icon="" @click="e.amount = e.amount * 2; updateEntryAmount(e)" v-if="!e.listRecipeData">
|
||||
<v-icon icon="fa-solid fa-times"></v-icon>
|
||||
</v-btn>
|
||||
<v-btn color="edit" icon="$edit" v-if="!e.recipeMealplan">
|
||||
<v-btn color="edit" icon="$edit" v-if="!e.listRecipeData">
|
||||
<v-icon icon="$edit"></v-icon>
|
||||
<model-edit-dialog model="ShoppingListEntry" :item="e" @delete="useShoppingStore().entries.delete(e.id); shoppingListFood.entries.delete(e.id)"
|
||||
@save="(args: ShoppingListEntry) => (shoppingListFood.entries.set(e.id, args))"></model-edit-dialog>
|
||||
</v-btn>
|
||||
<v-btn color="edit" icon="$recipes" v-if="e.listRecipe && e.listRecipeData.recipe" :to="{name: 'view_recipe', params: {id: e.listRecipeData.recipe}}">
|
||||
<v-icon icon="$recipes"></v-icon>
|
||||
</v-btn>
|
||||
<v-btn icon="" @click="useShoppingStore().deleteObject(e, true); shoppingListFood.entries.delete(e.id)" color="delete">
|
||||
<v-icon icon="$delete"></v-icon>
|
||||
</v-btn>
|
||||
|
||||
@@ -164,7 +164,7 @@
|
||||
<v-list>
|
||||
<v-list-item v-for="r in useShoppingStore().getAssociatedRecipes()">
|
||||
<template #prepend>
|
||||
<v-btn color="edit" icon>
|
||||
<v-btn color="edit" icon :disabled="r.mealplan">
|
||||
{{ r.servings }}
|
||||
<number-scaler-dialog :number="r.servings"
|
||||
@confirm="(servings: number) => {updateRecipeServings(r, servings)}"></number-scaler-dialog>
|
||||
|
||||
@@ -10,16 +10,16 @@
|
||||
:close-on-back="false"
|
||||
multi-line
|
||||
>
|
||||
<small>{{ DateTime.fromSeconds(visibleMessage.createdAt).toLocaleString(DateTime.DATETIME_MED) }}</small> <br/>
|
||||
<!-- <small>{{ DateTime.fromSeconds(visibleMessage.createdAt).toLocaleString(DateTime.DATETIME_MED) }}</small> <br/>-->
|
||||
<h3 v-if="visibleMessage.msg.title">{{ visibleMessage.msg.title }}</h3>
|
||||
<span class="text-pre">{{ visibleMessage.msg.text }}</span>
|
||||
|
||||
<template v-slot:actions>
|
||||
|
||||
<v-btn ref="ref_btn_view">View</v-btn>
|
||||
<v-btn ref="ref_btn_view">{{$t('View')}}</v-btn>
|
||||
<v-btn variant="text" @click="removeItem()">
|
||||
<span v-if="useMessageStore().snackbarQueue.length > 1">Next ({{ useMessageStore().snackbarQueue.length - 1 }})</span>
|
||||
<span v-else>Close</span>
|
||||
<span v-if="useMessageStore().snackbarQueue.length > 1">{{$t('Next')}} ({{ useMessageStore().snackbarQueue.length - 1 }})</span>
|
||||
<span v-else>{{$t('Close')}}</span>
|
||||
</v-btn>
|
||||
</template>
|
||||
</v-snackbar>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
<v-card-text>
|
||||
|
||||
<v-number-input v-model="mutable_number" @update:modelValue="updateNumber('set')" control-variant="split" :min="0">
|
||||
<v-number-input v-model="mutableNumber" @update:modelValue="updateNumber('set')" control-variant="split" :min="0">
|
||||
</v-number-input>
|
||||
|
||||
<v-btn-group divided class="d-flex">
|
||||
@@ -21,7 +21,7 @@
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-btn @click=" dialog=false">{{ $t('Close') }}</v-btn>
|
||||
<v-btn color="save" prepend-icon="$save" @click="emit('confirm', mutable_number); dialog=false">{{ $t('Save') }}</v-btn>
|
||||
<v-btn color="save" prepend-icon="$save" @click="emit('confirm', mutableNumber); dialog=false">{{ $t('Save') }}</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
|
||||
@@ -49,14 +49,15 @@ const props = defineProps({
|
||||
})
|
||||
|
||||
const dialog = ref(false)
|
||||
const mutable_number = ref(0)
|
||||
const mutableNumber = ref(0)
|
||||
|
||||
watch(() => props.number, (newVal) => {
|
||||
mutable_number.value = newVal
|
||||
mutableNumber.value = newVal
|
||||
console.log('prop updated')
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
mutable_number.value = props.number
|
||||
mutableNumber.value = props.number
|
||||
})
|
||||
|
||||
/**
|
||||
@@ -65,19 +66,19 @@ onMounted(() => {
|
||||
*/
|
||||
function updateNumber(operation: string) {
|
||||
if (operation === 'half') {
|
||||
mutable_number.value = props.number / 2
|
||||
mutableNumber.value = mutableNumber.value / 2
|
||||
}
|
||||
if (operation === 'double') {
|
||||
mutable_number.value = props.number * 2
|
||||
mutableNumber.value = mutableNumber.value * 2
|
||||
}
|
||||
if (operation === 'add') {
|
||||
mutable_number.value = props.number + 1
|
||||
mutableNumber.value = mutableNumber.value + 1
|
||||
}
|
||||
if (operation === 'sub') {
|
||||
mutable_number.value = props.number - 1
|
||||
mutableNumber.value = mutableNumber.value - 1
|
||||
}
|
||||
|
||||
emit('change', mutable_number.value)
|
||||
console.log('change emitted')
|
||||
emit('change', mutableNumber.value)
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -215,6 +215,7 @@
|
||||
@update:modelValue="step.ingredients[editingIngredientIndex].unit = null; step.ingredients[editingIngredientIndex].food = null; step.ingredients[editingIngredientIndex].amount = 0"
|
||||
></v-checkbox>
|
||||
</v-form>
|
||||
<v-btn color="info" class="mt-2" @click="dialogIngredientEditor = false; dialogIngredientSorter = true" prepend-icon="fa-solid fa-sort">{{ $t('Move') }}</v-btn>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-btn @click="dialogIngredientEditor = false; deleteIngredientAtIndex(editingIngredientIndex); editingIngredientIndex = -1" color="delete" prepend-icon="$delete">
|
||||
|
||||
@@ -138,19 +138,19 @@ export const useMessageStore = defineStore('message_store', () => {
|
||||
*/
|
||||
function addPreparedMessage(preparedMessage: PreparedMessage, data?: any) {
|
||||
if (preparedMessage == PreparedMessage.UPDATE_SUCCESS) {
|
||||
addMessage(MessageType.SUCCESS, {title: t('Updated'), text: ''} as StructuredMessage, 6000, data)
|
||||
addMessage(MessageType.SUCCESS, {title: t('Updated'), text: ''} as StructuredMessage, 1500, data)
|
||||
}
|
||||
if (preparedMessage == PreparedMessage.DELETE_SUCCESS) {
|
||||
addMessage(MessageType.SUCCESS, {title: t('Deleted'), text: ''} as StructuredMessage, 6000, data)
|
||||
addMessage(MessageType.SUCCESS, {title: t('Deleted'), text: ''} as StructuredMessage, 1500, data)
|
||||
}
|
||||
if (preparedMessage == PreparedMessage.CREATE_SUCCESS) {
|
||||
addMessage(MessageType.SUCCESS, {title: t('Created'), text: ''} as StructuredMessage, 6000, data)
|
||||
addMessage(MessageType.SUCCESS, {title: t('Created'), text: ''} as StructuredMessage, 1500, data)
|
||||
}
|
||||
if (preparedMessage == PreparedMessage.MERGE_SUCCESS) {
|
||||
addMessage(MessageType.SUCCESS, {title: t('Merge'), text: ''} as StructuredMessage, 6000, data)
|
||||
addMessage(MessageType.SUCCESS, {title: t('Merge'), text: ''} as StructuredMessage, 1500, data)
|
||||
}
|
||||
if (preparedMessage == PreparedMessage.MOVE_SUCCESS) {
|
||||
addMessage(MessageType.SUCCESS, {title: t('Move'), text: ''} as StructuredMessage, 6000, data)
|
||||
addMessage(MessageType.SUCCESS, {title: t('Move'), text: ''} as StructuredMessage, 1500, data)
|
||||
}
|
||||
if (preparedMessage == PreparedMessage.NOT_FOUND) {
|
||||
addMessage(MessageType.WARNING, {title: t('NotFound'), text: t('NotFoundHelp')} as StructuredMessage, 6000, data)
|
||||
|
||||
@@ -6,6 +6,11 @@ import {Ingredient} from "@/openapi";
|
||||
*/
|
||||
export function ingredientToString(ingredient: Ingredient) {
|
||||
let content = []
|
||||
|
||||
if(ingredient == undefined){
|
||||
return ''
|
||||
}
|
||||
|
||||
if(ingredient.amount != 0){
|
||||
content.push(ingredient.amount)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user