mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 20:28:46 -05:00
Recipe editor improvements
This commit is contained in:
@@ -7,24 +7,28 @@
|
||||
<v-closable-card-title :title="$t('Move')" v-model="dialog"
|
||||
:sub-title="ingredientToString(step.ingredients[editingIngredientIndex])"></v-closable-card-title>
|
||||
<v-card-text>
|
||||
<v-btn block :disabled="editingIngredientIndex== 0" @click="moveIngredient(editingIngredientIndex, props.stepIndex, 0)">{{ $t('First') }}</v-btn>
|
||||
<v-btn block :disabled="editingIngredientIndex == 0" class="mt-1" @click="moveIngredient(editingIngredientIndex, props.stepIndex, editingIngredientIndex - 1)">{{
|
||||
$t('Up')
|
||||
}}
|
||||
</v-btn>
|
||||
<v-btn block :disabled="editingIngredientIndex + 1 == step.ingredients.length" class="mt-1"
|
||||
@click="moveIngredient(editingIngredientIndex, props.stepIndex, editingIngredientIndex + 1)"> {{ $t('Down') }}
|
||||
</v-btn>
|
||||
<v-btn block :disabled="editingIngredientIndex + 1 == step.ingredients.length" class="mt-1"
|
||||
@click="moveIngredient(editingIngredientIndex, props.stepIndex, step.ingredients.length - 1)">{{ $t('Last') }}
|
||||
</v-btn>
|
||||
<template v-if="step.ingredients.length > 1">
|
||||
<v-btn block :disabled="editingIngredientIndex== 0" @click="moveIngredient(editingIngredientIndex, props.stepIndex, 0)">{{ $t('First') }}</v-btn>
|
||||
<v-btn block :disabled="editingIngredientIndex == 0" class="mt-1" @click="moveIngredient(editingIngredientIndex, props.stepIndex, editingIngredientIndex - 1)">
|
||||
{{
|
||||
$t('Up')
|
||||
}}
|
||||
</v-btn>
|
||||
<v-btn block :disabled="editingIngredientIndex + 1 == step.ingredients.length" class="mt-1"
|
||||
@click="moveIngredient(editingIngredientIndex, props.stepIndex, editingIngredientIndex + 1)"> {{ $t('Down') }}
|
||||
</v-btn>
|
||||
<v-btn block :disabled="editingIngredientIndex + 1 == step.ingredients.length" class="mt-1"
|
||||
@click="moveIngredient(editingIngredientIndex, props.stepIndex, step.ingredients.length - 1)">{{ $t('Last') }}
|
||||
</v-btn>
|
||||
</template>
|
||||
|
||||
{{ $t('Step') }}
|
||||
<v-btn block v-for="(s,i) in recipe.steps" :disabled="i == props.stepIndex" class="mt-1"
|
||||
@click="moveIngredient(editingIngredientIndex, i, recipe.steps[i].ingredients.length)">{{ i + 1 }} <span v-if="'name' in s">{{ s.name }}</span>
|
||||
</v-btn>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-btn @click="dialog = false">{{$t('Close')}}</v-btn>
|
||||
<v-btn @click="dialog = false">{{ $t('Close') }}</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
@@ -39,8 +43,8 @@ import {ref, watch} from "vue";
|
||||
import {useDisplay} from "vuetify/framework";
|
||||
|
||||
const dialog = defineModel<Boolean>({required: true, default: false})
|
||||
const step = defineModel<Step|SourceImportStep>('step', {required: true})
|
||||
const recipe = defineModel<Recipe|SourceImportRecipe>('recipe', {required: true})
|
||||
const step = defineModel<Step | SourceImportStep>('step', {required: true})
|
||||
const recipe = defineModel<Recipe | SourceImportRecipe>('recipe', {required: true})
|
||||
const props = defineProps({
|
||||
stepIndex: {type: Number, required: true},
|
||||
ingredientIndex: {type: Number, required: true},
|
||||
|
||||
@@ -91,7 +91,10 @@
|
||||
$t('Move')
|
||||
}}
|
||||
</v-list-item>
|
||||
|
||||
<v-list-item v-if="ingredient.originalText" prepend-icon="$import">
|
||||
<v-list-item-title>{{$t('Original_Text')}}</v-list-item-title>
|
||||
<v-list-item-subtitle>{{ ingredient.originalText}}</v-list-item-subtitle>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
</v-btn>
|
||||
@@ -178,6 +181,7 @@
|
||||
<v-closable-card-title :title="$t('Ingredient Editor')" v-model="dialogIngredientEditor"></v-closable-card-title>
|
||||
<v-card-text>
|
||||
<v-form>
|
||||
<v-text-field :label="$t('Original_Text')" readonly v-model="step.ingredients[editingIngredientIndex].originalText" v-if="step.ingredients[editingIngredientIndex].originalText"></v-text-field>
|
||||
<v-number-input v-model="step.ingredients[editingIngredientIndex].amount" inset control-variant="stacked" autofocus :label="$t('Amount')"
|
||||
:min="0" :precision="2" v-if="!step.ingredients[editingIngredientIndex].isHeader"></v-number-input>
|
||||
<model-select model="Unit" v-model="step.ingredients[editingIngredientIndex].unit" :label="$t('Unit')" v-if="!step.ingredients[editingIngredientIndex].isHeader"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<v-card :loading="loading">
|
||||
<v-closable-card-title
|
||||
:title="$t(modelClass.model.localizationKey) + ((isChanged) ? '*' : '')"
|
||||
:sub-title="objectName"
|
||||
:sub-title="$t(modelClass.model.localizationKey) + ((isChanged) ? ` (${$t('unsaved')})` : '')"
|
||||
:title="objectName"
|
||||
:icon="modelClass.model.icon"
|
||||
@close="closeDialog()"
|
||||
:hide-close="!dialog"
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<v-tab value="recipe">{{ $t('Recipe') }}</v-tab>
|
||||
<v-tab value="steps">{{ $t('Steps') }}</v-tab>
|
||||
<v-tab value="properties">{{ $t('Properties') }}</v-tab>
|
||||
<v-tab value="settings">{{ $t('Settings') }}</v-tab>
|
||||
<v-tab value="settings">{{ $t('Miscellaneous') }}</v-tab>
|
||||
</v-tabs>
|
||||
</v-card-text>
|
||||
<v-card-text v-if="!isSpaceAtRecipeLimit(useUserPreferenceStore().activeSpace)">
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
<v-form :disabled="loading || fileApiLoading">
|
||||
<v-text-field :label="$t('Name')" v-model="editingObj.name"></v-text-field>
|
||||
<v-textarea :label="$t('Description')" v-model="editingObj.description" clearable counter="512" rows="2"></v-textarea>
|
||||
<v-textarea :label="$t('Description')" v-model="editingObj.description" clearable counter="512" rows="2" auto-grow></v-textarea>
|
||||
|
||||
<v-row>
|
||||
<v-col cols="12" md="6">
|
||||
@@ -99,9 +99,9 @@
|
||||
v-model="editingObj.showIngredientOverview"></v-checkbox>
|
||||
|
||||
<v-text-field :label="$t('Imported_From')" v-model="editingObj.sourceUrl"></v-text-field>
|
||||
<v-checkbox :label="$t('Private_Recipe')" :hint="$t('Private_Recipe_Help')" persistent-hint v-model="editingObj._private"></v-checkbox>
|
||||
<v-checkbox :label="$t('Private_Recipe')" persistent-hint v-model="editingObj._private"></v-checkbox>
|
||||
<model-select mode="tags" model="User" :label="$t('Private_Recipe')" :hint="$t('Private_Recipe_Help')" persistent-hint v-model="editingObj.shared"
|
||||
append-to-body></model-select>
|
||||
append-to-body v-if="editingObj._private"></model-select>
|
||||
|
||||
</v-form>
|
||||
</v-tabs-window-item>
|
||||
|
||||
Reference in New Issue
Block a user