meal plan tweaks

This commit is contained in:
vabene1111
2024-12-23 13:53:44 +01:00
parent 7a2b3c2d2e
commit 4b0d022db1
35 changed files with 99 additions and 32 deletions

View File

@@ -0,0 +1,45 @@
<template>
<v-select v-model="useUserPreferenceStore().deviceSettings.mealplan_displayPeriod" :label="$t('Period')" :hint="$t('Plan_Period_To_Show')" :items="MEALPLAN_PERIODS"
persistent-hint></v-select>
<v-select v-model="useUserPreferenceStore().deviceSettings.mealplan_displayPeriodCount" :label="$t('Periods')" :hint="$t('Plan_Show_How_Many_Periods')"
:items="MEALPLAN_PERIOD_COUNTS" persistent-hint></v-select>
<v-select v-model="useUserPreferenceStore().deviceSettings.mealplan_startingDayOfWeek" :label="$t('Starting_Day')" :hint="$t('Starting_Day')"
:items="MEALPLAN_STARTING_DAYS" persistent-hint></v-select>
<v-checkbox v-model="useUserPreferenceStore().deviceSettings.mealplan_displayWeekNumbers" :label="$t('Week_Numbers')" :hint="$t('Show_Week_Numbers')"
persistent-hint></v-checkbox>
</template>
<script setup lang="ts">
import {useUserPreferenceStore} from "@/stores/UserPreferenceStore";
import {useI18n} from "vue-i18n";
import {ref} from "vue";
const {t} = useI18n()
const MEALPLAN_PERIODS = ref([
{title: t("Week"), value: "week"},
{title: t("Month"), value: "month"},
{title: t("Year"), value: "year"},
])
const MEALPLAN_STARTING_DAYS = ref([
{title: t("Sunday"), value: 0},
{title: t("Monday"), value: 1},
{title: t("Tuesday"), value: 2},
{title: t("Wednesday"), value: 3},
{title: t("Thursday"), value: 4},
{title: t("Friday"), value: 5},
{title: t("Saturday"), value: 6},
])
const MEALPLAN_PERIOD_COUNTS = ref([1, 2, 3, 4])
</script>
<style scoped>
</style>

View File

@@ -13,16 +13,7 @@
<v-divider></v-divider>
<p class="text-subtitle-2 mb-2">{{ $t('DeviceSettingsHelp') }}</p>
<v-select v-model="useUserPreferenceStore().deviceSettings.mealplan_displayPeriod" :label="$t('Period')" :hint="$t('Plan_Period_To_Show')" :items="MEALPLAN_PERIODS"
persistent-hint></v-select>
<v-select v-model="useUserPreferenceStore().deviceSettings.mealplan_displayPeriodCount" :label="$t('Periods')" :hint="$t('Plan_Show_How_Many_Periods')"
:items="MEALPLAN_PERIOD_COUNTS" persistent-hint></v-select>
<v-select v-model="useUserPreferenceStore().deviceSettings.mealplan_startingDayOfWeek" :label="$t('Starting_Day')" :hint="$t('Starting_Day')"
:items="MEALPLAN_STARTING_DAYS" persistent-hint></v-select>
<v-checkbox v-model="useUserPreferenceStore().deviceSettings.mealplan_displayWeekNumbers" :label="$t('Week_Numbers')" :hint="$t('Show_Week_Numbers')"
persistent-hint></v-checkbox>
<meal-plan-device-settings></meal-plan-device-settings>
<p class="text-h6 mt-2">{{ $t('Meal_Types') }}
<v-btn prepend-icon="$create" color="create" size="small" class="float-right">
@@ -59,24 +50,7 @@ import {onMounted, ref} from "vue";
import {ApiApi, MealType} from "@/openapi";
import {ErrorMessageType, useMessageStore} from "@/stores/MessageStore";
import ModelEditDialog from "@/components/dialogs/ModelEditDialog.vue";
const {t} = useI18n()
const MEALPLAN_PERIODS = ref([
{title: t("Week"), value: "week"},
{title: t("Month"), value: "month"},
{title: t("Year"), value: "year"},
])
const MEALPLAN_STARTING_DAYS = ref([
{title: t("Sunday"), value: 0},
{title: t("Monday"), value: 1},
{title: t("Tuesday"), value: 2},
{title: t("Wednesday"), value: 3},
{title: t("Thursday"), value: 4},
{title: t("Friday"), value: 5},
{title: t("Saturday"), value: 6},
])
const MEALPLAN_PERIOD_COUNTS = ref([1, 2, 3, 4])
import MealPlanDeviceSettings from "@/components/settings/MealPlanDeviceSettings.vue";
const mealTypes = ref([] as MealType[])