diff --git a/frontend/src/pages/Admin/MealPlanner/index.vue b/frontend/src/pages/Admin/MealPlanner/index.vue deleted file mode 100644 index 51461f5ba..000000000 --- a/frontend/src/pages/Admin/MealPlanner/index.vue +++ /dev/null @@ -1,137 +0,0 @@ - - - - {{ $t("meal-plan.meal-planner") }} - - - - {{ $t("recipe.categories") }} - - - - - - - {{ $t("settings.webhooks.meal-planner-webhooks") }} - - - {{ - $t( - "settings.webhooks.the-urls-listed-below-will-recieve-webhooks-containing-the-recipe-data-for-the-meal-plan-on-its-scheduled-day-currently-webhooks-will-execute-at" - ) - }} - {{ groupSettings.webhookTime }} - - - - - - - mdi-webhook - {{ $t("settings.webhooks.test-webhooks") }} - - - - - - - mdi-minus - - - - - - - - - - mdi-plus - - - - mdi-content-save - {{ $t("general.save") }} - - - - - - - - diff --git a/frontend/src/pages/Admin/Profile/APITokenCard.vue b/frontend/src/pages/Admin/Profile/APITokenCard.vue index c31ff7ca2..3855c03b7 100644 --- a/frontend/src/pages/Admin/Profile/APITokenCard.vue +++ b/frontend/src/pages/Admin/Profile/APITokenCard.vue @@ -53,7 +53,7 @@ USERS - + - + {{ generateInitials(item.fullName) }} @@ -38,22 +38,85 @@ {{ item.fullName }} - - - + + + + + mdi-food-variant + + Mealplan Settings + + + + + MEALPLAN CATEGORIES + + {{ $t("meal-plan.only-recipes-with-these-categories-will-be-used-in-meal-plans") }} + + + + + WEBHOOKS + + {{ + $t( + "settings.webhooks.the-urls-listed-below-will-recieve-webhooks-containing-the-recipe-data-for-the-meal-plan-on-its-scheduled-day-currently-webhooks-will-execute-at" + ) + }} + {{ groupSettings.webhookTime }} + + + + + + + + + + + + mdi-webhook + New + + + + + + + + mdi-webhook + {{ $t("settings.webhooks.test-webhooks") }} + + + + mdi-content-save + {{ $t("general.update") }} + + diff --git a/frontend/src/pages/Admin/Profile/index.vue b/frontend/src/pages/Admin/Profile/index.vue index 88127c2a8..e6cfa1a38 100644 --- a/frontend/src/pages/Admin/Profile/index.vue +++ b/frontend/src/pages/Admin/Profile/index.vue @@ -4,10 +4,10 @@ + - diff --git a/frontend/src/pages/Recipes/CategoryPage.vue b/frontend/src/pages/Recipes/CategoryPage.vue index 2d0acf225..89818210f 100644 --- a/frontend/src/pages/Recipes/CategoryPage.vue +++ b/frontend/src/pages/Recipes/CategoryPage.vue @@ -1,13 +1,6 @@ - + @@ -22,20 +15,30 @@ export default { return { title: "", recipes: [], + sortedResults: [], }; }, computed: { currentCategory() { return this.$route.params.category; }, + shownRecipes() { + if (this.sortedResults.length > 0) { + return this.sortedResults; + } else { + return this.recipes; + } + }, }, watch: { async currentCategory() { + this.sortedResults = []; this.getRecipes(); }, }, mounted() { this.getRecipes(); + this.sortedResults = []; }, methods: { async getRecipes() { @@ -43,11 +46,8 @@ export default { this.title = data.name; this.recipes = data.recipes; }, - sortAZ() { - this.recipes.sort((a, b) => (a.name > b.name ? 1 : -1)); - }, - sortRecent() { - this.recipes.sort((a, b) => (a.dateAdded > b.dateAdded ? -1 : 1)); + assignSorted(val) { + this.sortedResults = val.slice(); }, }, }; diff --git a/frontend/src/pages/Recipes/CustomPage.vue b/frontend/src/pages/Recipes/CustomPage.vue index 91d2bbe82..ad6f6003a 100644 --- a/frontend/src/pages/Recipes/CustomPage.vue +++ b/frontend/src/pages/Recipes/CustomPage.vue @@ -1,24 +1,23 @@ - - - - {{ title.toUpperCase() }} - - + + + mdi-tag-multiple-outline + + {{ page.name }} - + {{ item.name }} - - + + @@ -36,8 +35,8 @@ export default { }, data() { return { + page: "", title: "", - tab: null, render: false, recipeStore: [], categories: [], @@ -47,6 +46,14 @@ export default { pageSlug() { return this.$route.params.customPage; }, + tab: { + set(tab) { + this.$router.replace({ query: { ...this.$route.query, tab } }); + }, + get() { + return this.$route.query.tab; + }, + }, }, watch: { @@ -61,27 +68,15 @@ export default { }, methods: { async buildPage() { - const page = await api.siteSettings.getPage(this.pageSlug); - this.title = page.name; - this.categories = page.categories; - page.categories.forEach(async element => { - let categoryRecipes = await this.getRecipeByCategory(element.slug); - this.recipeStore.push(categoryRecipes); - }); - }, - async getRecipeByCategory(category) { - return await api.categories.getRecipesInCategory(category); + this.page = await api.siteSettings.getPage(this.pageSlug); }, filterRecipe(slug) { const storeCategory = this.recipeStore.find(element => element.slug === slug); return storeCategory ? storeCategory.recipes : []; }, + sortRecipes(sortedRecipes, destKey) { + this.page.categories[destKey].recipes = sortedRecipes; + }, }, }; - - diff --git a/frontend/src/pages/Recipes/TagPage.vue b/frontend/src/pages/Recipes/TagPage.vue index 822d94edb..d5b63cf8a 100644 --- a/frontend/src/pages/Recipes/TagPage.vue +++ b/frontend/src/pages/Recipes/TagPage.vue @@ -1,13 +1,6 @@ - + @@ -22,20 +15,30 @@ export default { return { title: "", recipes: [], + sortedResults: [], }; }, computed: { currentTag() { return this.$route.params.tag; }, + shownRecipes() { + if (this.sortedResults.length > 0) { + return this.sortedResults; + } else { + return this.recipes; + } + }, }, watch: { async currentTag() { this.getRecipes(); + this.sortedResults = []; }, }, mounted() { this.getRecipes(); + this.sortedResults = []; }, methods: { async getRecipes() { @@ -43,11 +46,9 @@ export default { this.title = data.name; this.recipes = data.recipes; }, - sortAZ() { - this.recipes.sort((a, b) => (a.name > b.name ? 1 : -1)); - }, - sortRecent() { - this.recipes.sort((a, b) => (a.dateAdded > b.dateAdded ? -1 : 1)); + assignSorted(val) { + console.log(val); + this.sortedResults = val.slice(); }, }, };
- {{ - $t( - "settings.webhooks.the-urls-listed-below-will-recieve-webhooks-containing-the-recipe-data-for-the-meal-plan-on-its-scheduled-day-currently-webhooks-will-execute-at" - ) - }} - {{ groupSettings.webhookTime }} -