1
0
mirror of https://github.com/TandoorRecipes/recipes.git synced 2026-01-11 17:16:59 -05:00

added titles

This commit is contained in:
vabene1111
2025-08-17 09:59:22 +02:00
parent 6c17937313
commit a46f3958fe
6 changed files with 61 additions and 31 deletions

View File

@@ -101,10 +101,12 @@ import ModelMergeDialog from "@/components/dialogs/ModelMergeDialog.vue";
import {VDataTableUpdateOptions} from "@/vuetify";
import SyncDialog from "@/components/dialogs/SyncDialog.vue";
import {ApiApi, RecipeImport} from "@/openapi";
import {useTitle} from "@vueuse/core";
const {t} = useI18n()
const router = useRouter()
const route = useRoute()
const title = useTitle()
const props = defineProps({
model: {
@@ -160,6 +162,8 @@ onBeforeMount(() => {
genericModel.value = getGenericModelFromString('Food', t)
}
title.value = t(genericModel.value.model.localizationKey)
if (typeof route.query.page == "string" && !isNaN(parseInt(route.query.page))) {
tablePage.value = parseInt(route.query.page)
}

View File

@@ -10,7 +10,7 @@ import {onMounted, ref, watch} from 'vue'
import {ApiApi, ApiRecipeRetrieveRequest, Recipe, ViewLog} from "@/openapi";
import RecipeView from "@/components/display/RecipeView.vue";
import {useDisplay} from "vuetify";
import {useUrlSearchParams} from "@vueuse/core";
import {useTitle, useUrlSearchParams} from "@vueuse/core";
import {ErrorMessageType, useMessageStore} from "@/stores/MessageStore";
import {useUserPreferenceStore} from "@/stores/UserPreferenceStore";
@@ -20,6 +20,7 @@ const props = defineProps({
const params = useUrlSearchParams('history')
const {mobile} = useDisplay()
const title = useTitle()
const recipe = ref({} as Recipe)
@@ -42,6 +43,7 @@ function refreshData(recipeId: string) {
api.apiRecipeRetrieve(requestParameters).then(r => {
recipe.value = r
title.value = recipe.value.name
if (useUserPreferenceStore().isAuthenticated) {
api.apiViewLogCreate({viewLog: {recipe: Number(recipeId)} as ViewLog})