mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-03 21:37:49 -05:00
small improvements
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<v-spacer></v-spacer>
|
||||
<global-search-dialog></global-search-dialog>
|
||||
|
||||
<v-avatar color="primary" class="me-2">{{useUserPreferenceStore().userSettings.user.displayName.charAt(0)}}
|
||||
<v-avatar color="primary" class="me-2">{{ useUserPreferenceStore().userSettings.user.displayName.charAt(0) }}
|
||||
<v-menu activator="parent">
|
||||
|
||||
<v-list density="compact">
|
||||
@@ -83,9 +83,13 @@
|
||||
</v-list-item>
|
||||
<v-divider></v-divider>
|
||||
<v-list-item prepend-icon="fas fa-book" title="Home" :to="{ name: 'view_home', params: {} }"></v-list-item>
|
||||
<v-list-item prepend-icon="fas fa-calendar-alt" title="Mealplan" :to="{ name: 'view_mealplan', params: {} }"></v-list-item>
|
||||
<v-list-item prepend-icon="fas fa-shopping-cart" title="Shopping" :to="{ name: 'view_shopping', params: {} }"></v-list-item>
|
||||
<v-list-item prepend-icon="fas fa-calendar-alt" :title="$t('Meal_Plan')" :to="{ name: 'view_mealplan', params: {} }"></v-list-item>
|
||||
<v-list-item prepend-icon="fas fa-shopping-cart" :title="$t('Shopping_list')" :to="{ name: 'view_shopping', params: {} }"></v-list-item>
|
||||
<v-list-item prepend-icon="fas fa-globe" :title="$t('Import')" :to="{ name: 'RecipeImportPage', params: {} }"></v-list-item>
|
||||
<v-list-item prepend-icon="fas fa-bars" title="Test" :to="{ name: 'view_test', params: {} }"></v-list-item>
|
||||
|
||||
<navigation-drawer-context-menu></navigation-drawer-context-menu>
|
||||
|
||||
<template #append>
|
||||
<v-list-item prepend-icon="fas fa-sliders" :title="$t('Settings')" :to="{ name: 'view_settings', params: {} }"></v-list-item>
|
||||
<v-list-item prepend-icon="fa-solid fa-heart" href="https://tandoor.dev" target="_blank">
|
||||
@@ -135,6 +139,8 @@ import {useDisplay} from "vuetify"
|
||||
import VSnackbarQueued from "@/components/display/VSnackbarQueued.vue";
|
||||
import MessageListDialog from "@/components/dialogs/MessageListDialog.vue";
|
||||
import {useUserPreferenceStore} from "@/stores/UserPreferenceStore";
|
||||
import {TAutomation, TCookLog, TFood, TKeyword, TPropertyType, TSupermarket, TSupermarketCategory, TUnit, TUnitConversion, TUserFile, TViewLog} from "@/types/Models";
|
||||
import NavigationDrawerContextMenu from "@/components/display/NavigationDrawerContextMenu.vue";
|
||||
|
||||
const {lgAndUp} = useDisplay()
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ import UserSpaceSettings from "@/components/settings/UserSpaceSettings.vue";
|
||||
import ApiSettings from "@/components/settings/ApiSettings.vue";
|
||||
import ModelListPage from "@/pages/ModelListPage.vue";
|
||||
import ModelEditPage from "@/pages/ModelEditPage.vue";
|
||||
import RecipeImportPage from "@/pages/RecipeImportPage.vue";
|
||||
|
||||
const routes = [
|
||||
{path: '/', component: StartPage, name: 'view_home'},
|
||||
@@ -46,6 +47,7 @@ const routes = [
|
||||
{path: '/shopping', component: ShoppingListPage, name: 'view_shopping'},
|
||||
{path: '/mealplan', component: MealPlanPage, name: 'view_mealplan'},
|
||||
{path: '/books', component: ShoppingListPage, name: 'view_books'},
|
||||
{path: '/recipe/import', component: RecipeImportPage, name: 'RecipeImportPage'},
|
||||
{path: '/recipe/:id', component: RecipeViewPage, name: 'view_recipe', props: true},
|
||||
{path: '/recipe/edit/:recipe_id', component: RecipeEditPage, name: 'edit_recipe', props: true},
|
||||
|
||||
|
||||
27
vue3/src/components/display/NavigationDrawerContextMenu.vue
Normal file
27
vue3/src/components/display/NavigationDrawerContextMenu.vue
Normal file
@@ -0,0 +1,27 @@
|
||||
<template>
|
||||
|
||||
<template v-if="route.name == 'ModelListPage'">
|
||||
<v-divider></v-divider>
|
||||
<v-list-item v-for="m in getListModels()"
|
||||
:to="{ name: 'ModelListPage', params: {model: m.name} }">
|
||||
<template #prepend>
|
||||
<v-icon :icon="m.icon"></v-icon>
|
||||
</template>
|
||||
{{ $t(m.localizationKey) }}
|
||||
</v-list-item>
|
||||
</template>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
||||
import {useRoute} from "vue-router";
|
||||
import {getListModels} from "@/types/Models";
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -9,7 +9,7 @@
|
||||
<v-list>
|
||||
|
||||
<v-list-item
|
||||
v-for="m in [TFood, TUnit, TKeyword,TSupermarket, TSupermarketCategory, TPropertyType, TUnitConversion, TAutomation, TUserFile, TCookLog, TViewLog]"
|
||||
v-for="m in getListModels()"
|
||||
@click="changeModel(m)"
|
||||
:active="m.name == genericModel.model.name"
|
||||
>
|
||||
@@ -63,7 +63,7 @@ import {useI18n} from "vue-i18n";
|
||||
import {
|
||||
EditorSupportedModels,
|
||||
GenericModel,
|
||||
getGenericModelFromString,
|
||||
getGenericModelFromString, getListModels,
|
||||
Model,
|
||||
TAutomation,
|
||||
TCookLog,
|
||||
|
||||
53
vue3/src/pages/RecipeImportPage.vue
Normal file
53
vue3/src/pages/RecipeImportPage.vue
Normal file
@@ -0,0 +1,53 @@
|
||||
<template>
|
||||
<v-container>
|
||||
<v-row>
|
||||
<v-col>
|
||||
|
||||
<v-stepper v-model="stepper">
|
||||
<v-stepper-header>
|
||||
<v-stepper-item :title="$t('Import')" :value="1"></v-stepper-item>
|
||||
<v-divider></v-divider>
|
||||
<v-stepper-item :title="$t('Keywords')" :value="2"></v-stepper-item>
|
||||
<v-divider></v-divider>
|
||||
<v-stepper-item :title="$t('Steps')" :value="3"></v-stepper-item>
|
||||
<v-divider></v-divider>
|
||||
<v-stepper-item :title="$t('Save')" :value="4"></v-stepper-item>
|
||||
</v-stepper-header>
|
||||
|
||||
<v-stepper-window>
|
||||
<v-stepper-window-item :value="1">
|
||||
test1
|
||||
</v-stepper-window-item>
|
||||
<v-stepper-window-item :value="2">
|
||||
test2
|
||||
</v-stepper-window-item>
|
||||
<v-stepper-window-item :value="3">
|
||||
test3
|
||||
</v-stepper-window-item>
|
||||
<v-stepper-window-item :value="4">
|
||||
test4
|
||||
</v-stepper-window-item>
|
||||
</v-stepper-window>
|
||||
|
||||
<v-stepper-actions >
|
||||
|
||||
</v-stepper-actions>
|
||||
</v-stepper>
|
||||
|
||||
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
|
||||
import {ref} from "vue";
|
||||
|
||||
const stepper = ref(0)
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -26,6 +26,19 @@ function registerModel(model: Model) {
|
||||
SUPPORTED_MODELS.set(model.name.toLowerCase(), model)
|
||||
}
|
||||
|
||||
/**
|
||||
* returns a list of models that should be shown in the list/database view
|
||||
*/
|
||||
export function getListModels() {
|
||||
let modelList: Model[] = []
|
||||
SUPPORTED_MODELS.forEach((model) => {
|
||||
if(!model.disableListView){
|
||||
modelList.push(model)
|
||||
}
|
||||
})
|
||||
return modelList
|
||||
}
|
||||
|
||||
/**
|
||||
* common list parameters shared by all generic models
|
||||
*/
|
||||
@@ -66,6 +79,8 @@ export type Model = {
|
||||
disableCreate?: boolean | undefined,
|
||||
disableUpdate?: boolean | undefined,
|
||||
disableDelete?: boolean | undefined,
|
||||
// disable showing this model as an option in the ModelListPage
|
||||
disableListView?: boolean | undefined,
|
||||
|
||||
isPaginated: boolean | undefined,
|
||||
|
||||
@@ -151,6 +166,8 @@ export const TRecipe = {
|
||||
isPaginated: true,
|
||||
toStringKeys: ['name'],
|
||||
|
||||
disableListView: true,
|
||||
|
||||
tableHeaders: [
|
||||
{title: 'Name', key: 'name'},
|
||||
{title: 'Actions', key: 'action', align: 'end'},
|
||||
@@ -166,6 +183,8 @@ export const TStep = {
|
||||
isPaginated: true,
|
||||
toStringKeys: ['name'],
|
||||
|
||||
disableListView: true,
|
||||
|
||||
tableHeaders: [
|
||||
{title: 'Name', key: 'name'},
|
||||
{title: 'Actions', key: 'action', align: 'end'},
|
||||
@@ -181,6 +200,8 @@ export const TIngredient = {
|
||||
isPaginated: true,
|
||||
toStringKeys: ['id'],
|
||||
|
||||
disableListView: true,
|
||||
|
||||
tableHeaders: [
|
||||
{title: 'Name', key: 'id'},
|
||||
{title: 'Actions', key: 'action', align: 'end'},
|
||||
@@ -211,6 +232,8 @@ export const TMealPlan = {
|
||||
isPaginated: true,
|
||||
toStringKeys: ['title', 'recipe.name'],
|
||||
|
||||
disableListView: true,
|
||||
|
||||
tableHeaders: [
|
||||
{title: 'Title', key: 'title'},
|
||||
{title: 'StartDate', key: 'startDate'},
|
||||
@@ -227,6 +250,7 @@ export const TUser = {
|
||||
disableCreate: true,
|
||||
disableDelete: true,
|
||||
disableUpdate: true,
|
||||
disableListView: true,
|
||||
|
||||
isPaginated: false,
|
||||
toStringKeys: ['displayName'],
|
||||
@@ -274,6 +298,7 @@ export const TShoppingListEntry = {
|
||||
localizationKey: 'ShoppingListEntry',
|
||||
icon: 'fa-solid fa-list-check',
|
||||
|
||||
disableListView: true,
|
||||
isPaginated: true,
|
||||
toStringKeys: ['amount', 'unit.name', 'food.name'],
|
||||
|
||||
@@ -306,6 +331,7 @@ export const TProperty = {
|
||||
localizationKey: 'Property',
|
||||
icon: 'fa-solid fa-database',
|
||||
|
||||
disableListView: true,
|
||||
isPaginated: true,
|
||||
toStringKeys: ['propertyAmount', 'propertyType.name'],
|
||||
|
||||
@@ -404,6 +430,7 @@ export const TAccessToken = {
|
||||
localizationKey: 'Access_Token',
|
||||
icon: 'fa-solid fa-key',
|
||||
|
||||
disableListView: true,
|
||||
isPaginated: true,
|
||||
toStringKeys: ['token'],
|
||||
|
||||
@@ -420,6 +447,7 @@ export const TUserSpace = {
|
||||
localizationKey: 'SpaceMembers',
|
||||
icon: 'fa-solid fa-users',
|
||||
|
||||
disableListView: true,
|
||||
isPaginated: true,
|
||||
toStringKeys: ['user.displayName'],
|
||||
|
||||
@@ -437,8 +465,8 @@ export const TInviteLink = {
|
||||
localizationKey: 'Invite_Link',
|
||||
icon: 'fa-solid fa-link',
|
||||
|
||||
disableListView: true,
|
||||
isPaginated: true,
|
||||
|
||||
toStringKeys: ['email', 'role'],
|
||||
|
||||
tableHeaders: [
|
||||
@@ -455,6 +483,7 @@ export const TFoodInheritField = {
|
||||
localizationKey: 'FoodInherit',
|
||||
icon: 'fa-solid fa-list',
|
||||
|
||||
disableListView: true,
|
||||
toStringKeys: ['name'],
|
||||
|
||||
disableCreate: true,
|
||||
|
||||
Reference in New Issue
Block a user