mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2025-12-24 02:39:20 -05:00
improved step sorting
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
<template>
|
||||
|
||||
<!--TODO name, time, recipe, file(s), ingredients, quick add ingredients -->
|
||||
|
||||
<v-card variant="outlined">
|
||||
<template #title>
|
||||
<v-card-title>
|
||||
@@ -28,6 +26,9 @@
|
||||
<v-list-item link>
|
||||
<v-switch v-model="step.showAsHeader" :label="$t('Show_as_header')" hide-details></v-switch>
|
||||
</v-list-item>
|
||||
<v-list-item @click="emit('move')" prepend-icon="fa-solid fa-sort">
|
||||
{{ $t('Move') }}
|
||||
</v-list-item>
|
||||
|
||||
<v-list-item prepend-icon="$delete" @click="emit('delete')">{{ $t('Delete') }}</v-list-item>
|
||||
</v-list>
|
||||
@@ -240,7 +241,7 @@ import {ErrorMessageType, useMessageStore} from "@/stores/MessageStore";
|
||||
import {ingredientToString} from "@/utils/model_utils";
|
||||
import StepIngredientSorterDialog from "@/components/dialogs/StepIngredientSorterDialog.vue";
|
||||
|
||||
const emit = defineEmits(['delete'])
|
||||
const emit = defineEmits(['delete','move'])
|
||||
|
||||
const step = defineModel<Step>({required: true})
|
||||
const recipe = defineModel<Recipe>('recipe', {required: true})
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
<v-form :disabled="loading || fileApiLoading">
|
||||
<v-row v-for="(s,i ) in editingObj.steps" :key="s.id">
|
||||
<v-col>
|
||||
<step-editor v-model="editingObj.steps[i]" v-model:recipe="editingObj" :step-index="i" @delete="deleteStepAtIndex(i)"></step-editor>
|
||||
<step-editor v-model="editingObj.steps[i]" v-model:recipe="editingObj" :step-index="i" @delete="deleteStepAtIndex(i)" @move="dialogStepManager = true"></step-editor>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
@@ -139,7 +139,9 @@
|
||||
<vue-draggable handle=".drag-handle" v-model="editingObj.steps" :on-sort="sortSteps">
|
||||
<v-list-item v-for="(s,i) in editingObj.steps" :key="s.id">
|
||||
<v-chip color="primary">{{ i + 1 }}</v-chip>
|
||||
{{ s.name }}
|
||||
<span class="ms-2" v-if="s.name"> {{ s.name }}</span>
|
||||
<span class="ms-2" v-else>{{ $t('Step') }} {{ i + 1 }}</span>
|
||||
|
||||
<template #append>
|
||||
<v-icon class="drag-handle" icon="$dragHandle"></v-icon>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user