mealie/frontend/components/Domain/Recipe/RecipeSettingsMenu.vue
Hayden a2f8f27193
feat: support for lockable recipes (#876)
* feat:  support for lockable recipes

* feat(backend):  check user can update before updating recipe

* test(backend):  add recipe lock tests

* feat(frontend):  disabled lock action when not owner

* test(backend):  test non-owner can't lock recipe

* hide quantity on zero value

* fix(backend): 🐛 temp/partial fix for recipes with same name. WIP
2021-12-11 19:12:08 -09:00

70 lines
1.7 KiB
Vue

<template>
<div class="text-center">
<v-menu offset-y top nudge-top="6" :close-on-content-click="false">
<template #activator="{ on, attrs }">
<v-btn color="accent" dark v-bind="attrs" v-on="on">
<v-icon left>
{{ $globals.icons.cog }}
</v-icon>
{{ $t("general.settings") }}
</v-btn>
</template>
<v-card>
<v-card-title class="py-2">
<div>
{{ $t("recipe.recipe-settings") }}
</div>
</v-card-title>
<v-divider class="mx-2"></v-divider>
<v-card-text class="mt-n5 pt-6 pb-2">
<v-switch
v-for="(itemValue, key) in value"
:key="key"
v-model="value[key]"
xs
dense
:disabled="key == 'locked' && !isOwner"
class="my-1"
:label="labels[key]"
hide-details
></v-switch>
</v-card-text>
</v-card>
</v-menu>
</div>
</template>
<script>
export default {
components: {},
props: {
value: {
type: Object,
required: true,
},
isOwner: {
type: Boolean,
required: false,
},
},
computed: {
labels() {
return {
public: this.$t("recipe.public-recipe"),
showNutrition: this.$t("recipe.show-nutrition-values"),
showAssets: this.$t("asset.show-assets"),
landscapeView: this.$t("recipe.landscape-view-coming-soon"),
disableComments: this.$t("recipe.disable-comments"),
disableAmount: this.$t("recipe.disable-amount"),
locked: "Locked",
};
},
},
methods: {},
};
</script>
<style lang="scss" scoped></style>