mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 14:33:33 -07:00
settings form
This commit is contained in:
parent
fd5a1672b0
commit
fa1824c7fa
5 changed files with 42 additions and 9 deletions
|
@ -3,6 +3,19 @@
|
||||||
<v-card-title> General Settings </v-card-title>
|
<v-card-title> General Settings </v-card-title>
|
||||||
<v-divider></v-divider>
|
<v-divider></v-divider>
|
||||||
<v-card-text>
|
<v-card-text>
|
||||||
|
<h2 class="mt-1 mb-1">Home Page</h2>
|
||||||
|
<v-row>
|
||||||
|
<v-col> Section Selector </v-col>
|
||||||
|
<v-col cols="2">
|
||||||
|
<v-text-field label="Card Limit"></v-text-field>
|
||||||
|
</v-col>
|
||||||
|
<v-spacer> </v-spacer>
|
||||||
|
<v-spacer> </v-spacer>
|
||||||
|
</v-row>
|
||||||
|
</v-card-text>
|
||||||
|
<v-divider></v-divider>
|
||||||
|
<v-card-text>
|
||||||
|
<h2 class="mt-1 mb-1">Language</h2>
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col>
|
<v-col>
|
||||||
<v-select
|
<v-select
|
||||||
|
@ -18,6 +31,7 @@
|
||||||
<v-spacer></v-spacer>
|
<v-spacer></v-spacer>
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
|
<v-divider></v-divider>
|
||||||
</v-card>
|
</v-card>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -50,11 +50,12 @@ export default {
|
||||||
props: {
|
props: {
|
||||||
title: String,
|
title: String,
|
||||||
recipes: Array,
|
recipes: Array,
|
||||||
|
cardLimit: {
|
||||||
|
default: 6,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {};
|
||||||
cardLimit: 6,
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<CardSection v-if="showRecent" title="Recent" :recipes="recentRecipes" />
|
<CardSection
|
||||||
|
v-if="pageSettings.showRecent"
|
||||||
|
title="Recent"
|
||||||
|
:recipes="recentRecipes"
|
||||||
|
/>
|
||||||
<CardSection
|
<CardSection
|
||||||
v-for="section in recipeByCategory"
|
v-for="section in recipeByCategory"
|
||||||
:key="section.title"
|
:key="section.title"
|
||||||
:title="section.title"
|
:title="section.title"
|
||||||
:recipes="section.recipes"
|
:recipes="section.recipes"
|
||||||
|
:limit="pageSettings.showLimit"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -18,7 +23,6 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
showRecent: true,
|
|
||||||
recipeByCategory: [
|
recipeByCategory: [
|
||||||
{
|
{
|
||||||
title: "Title 1",
|
title: "Title 1",
|
||||||
|
@ -35,6 +39,9 @@ export default {
|
||||||
recentRecipes() {
|
recentRecipes() {
|
||||||
return this.$store.getters.getRecentRecipes;
|
return this.$store.getters.getRecentRecipes;
|
||||||
},
|
},
|
||||||
|
pageSettings() {
|
||||||
|
return this.$store.getters.getHomePageSettings;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getRecentRecipes() {
|
getRecentRecipes() {
|
||||||
|
|
1
frontend/src/store/modules/recipes.js
Normal file
1
frontend/src/store/modules/recipes.js
Normal file
|
@ -0,0 +1 @@
|
||||||
|
c
|
|
@ -18,6 +18,12 @@ const store = new Vuex.Store({
|
||||||
language,
|
language,
|
||||||
},
|
},
|
||||||
state: {
|
state: {
|
||||||
|
// Home Page Settings
|
||||||
|
homePage: {
|
||||||
|
showRecent: true,
|
||||||
|
showLimit: 9,
|
||||||
|
categories: [],
|
||||||
|
},
|
||||||
// Snackbar
|
// Snackbar
|
||||||
snackActive: false,
|
snackActive: false,
|
||||||
snackText: "",
|
snackText: "",
|
||||||
|
@ -29,6 +35,9 @@ const store = new Vuex.Store({
|
||||||
},
|
},
|
||||||
|
|
||||||
mutations: {
|
mutations: {
|
||||||
|
setHomePage(state, payload) {
|
||||||
|
state.homePage = payload;
|
||||||
|
},
|
||||||
setSnackBar(state, payload) {
|
setSnackBar(state, payload) {
|
||||||
state.snackText = payload.text;
|
state.snackText = payload.text;
|
||||||
state.snackType = payload.type;
|
state.snackType = payload.type;
|
||||||
|
@ -61,11 +70,12 @@ const store = new Vuex.Store({
|
||||||
|
|
||||||
getters: {
|
getters: {
|
||||||
//
|
//
|
||||||
getSnackText: state => state.snackText,
|
getSnackText: (state) => state.snackText,
|
||||||
getSnackActive: state => state.snackActive,
|
getSnackActive: (state) => state.snackActive,
|
||||||
getSnackType: state => state.snackType,
|
getSnackType: (state) => state.snackType,
|
||||||
|
|
||||||
getRecentRecipes: state => state.recentRecipes,
|
getRecentRecipes: (state) => state.recentRecipes,
|
||||||
|
getHomePageSettings: (state) => state.homePage,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue