mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 06:23:34 -07:00
HouseholdPreferenceEditor
This commit is contained in:
parent
5afa928f58
commit
1d20b1455c
1 changed files with 71 additions and 96 deletions
|
@ -41,27 +41,19 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script setup lang="ts">
|
||||||
import type { ReadHouseholdPreferences } from "~/lib/api/types/household";
|
import type { ReadHouseholdPreferences } from "~/lib/api/types/household";
|
||||||
|
|
||||||
export default defineNuxtComponent({
|
const preferences = defineModel<ReadHouseholdPreferences>({ required: true });
|
||||||
props: {
|
const i18n = useI18n();
|
||||||
modelValue: {
|
|
||||||
type: Object,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
emits: ["update:modelValue"],
|
|
||||||
setup(props, context) {
|
|
||||||
const i18n = useI18n();
|
|
||||||
|
|
||||||
type Preference = {
|
type Preference = {
|
||||||
key: keyof ReadHouseholdPreferences;
|
key: keyof ReadHouseholdPreferences;
|
||||||
label: string;
|
label: string;
|
||||||
description: string;
|
description: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const recipePreferences: Preference[] = [
|
const recipePreferences: Preference[] = [
|
||||||
{
|
{
|
||||||
key: "recipePublic",
|
key: "recipePublic",
|
||||||
label: i18n.t("group.allow-users-outside-of-your-group-to-see-your-recipes"),
|
label: i18n.t("group.allow-users-outside-of-your-group-to-see-your-recipes"),
|
||||||
|
@ -92,9 +84,9 @@ export default defineNuxtComponent({
|
||||||
label: i18n.t("group.disable-organizing-recipe-ingredients-by-units-and-food"),
|
label: i18n.t("group.disable-organizing-recipe-ingredients-by-units-and-food"),
|
||||||
description: i18n.t("group.disable-organizing-recipe-ingredients-by-units-and-food-description"),
|
description: i18n.t("group.disable-organizing-recipe-ingredients-by-units-and-food-description"),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const allDays = [
|
const allDays = [
|
||||||
{
|
{
|
||||||
name: i18n.t("general.sunday"),
|
name: i18n.t("general.sunday"),
|
||||||
value: 0,
|
value: 0,
|
||||||
|
@ -123,24 +115,7 @@ export default defineNuxtComponent({
|
||||||
name: i18n.t("general.saturday"),
|
name: i18n.t("general.saturday"),
|
||||||
value: 6,
|
value: 6,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const preferences = computed({
|
|
||||||
get() {
|
|
||||||
return props.modelValue;
|
|
||||||
},
|
|
||||||
set(val) {
|
|
||||||
context.emit("update:modelValue", val);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
return {
|
|
||||||
allDays,
|
|
||||||
preferences,
|
|
||||||
recipePreferences,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="css">
|
<style lang="css">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue