diff --git a/frontend/src/App.vue b/frontend/src/App.vue
index 8c043cbb6..66f15ccce 100644
--- a/frontend/src/App.vue
+++ b/frontend/src/App.vue
@@ -1,6 +1,6 @@
-
+
mdi-silverware-variant
diff --git a/frontend/src/api/category.js b/frontend/src/api/category.js
index 34af4606b..e80eb7a27 100644
--- a/frontend/src/api/category.js
+++ b/frontend/src/api/category.js
@@ -1,15 +1,20 @@
import { baseURL } from "./api-utils";
import { apiReq } from "./api-utils";
-const categoryBase = baseURL + "category/";
+const categoryBase = baseURL + "/recipes/categories";
const categoryURLs = {
- get_all: `${categoryBase}all`,
- };
-
+ get_all: `${categoryBase}/all/`,
+ get_category: (category) => `${categoryBase}/${category}/`,
+};
+
export default {
- async get_all() {
- let response = await apiReq.get(categoryURLs.get_all);
- return response;
- },
-}
\ No newline at end of file
+ async get_all() {
+ let response = await apiReq.get(categoryURLs.get_all);
+ return response.data;
+ },
+ async get_recipes_in_category(category) {
+ let response = await apiReq.get(categoryURLs.get_category(category));
+ return response.data;
+ },
+};
diff --git a/frontend/src/components/Settings/General/HomePageSettings.vue b/frontend/src/components/Settings/General/HomePageSettings.vue
index 8eb4af3bf..24f7d2c6f 100644
--- a/frontend/src/components/Settings/General/HomePageSettings.vue
+++ b/frontend/src/components/Settings/General/HomePageSettings.vue
@@ -119,36 +119,34 @@ export default {
},
data() {
return {
- homeCategories: [],
+ homeCategories: null,
showLimit: null,
- categories: ["breakfast"],
showRecent: true,
};
},
mounted() {
this.getOptions();
},
-
+ computed: {
+ categories() {
+ return this.$store.getters.getCategories;
+ },
+ },
methods: {
getOptions() {
- let options = this.$store.getters.getHomePageSettings;
- this.showLimit = options.showLimit;
- this.categories = options.categories;
- this.showRecent = options.showRecent;
- this.homeCategories = options.homeCategories;
+ this.showLimit = this.$store.getters.getShowLimit;
+ this.showRecent = this.$store.getters.getShowRecent;
+ this.homeCategories = this.$store.getters.getHomeCategories;
},
deleteActiveCategory(index) {
this.homeCategories.splice(index, 1);
},
saveSettings() {
- let payload = {
- showRecent: this.showRecent,
- showLimit: this.showLimit,
- categories: this.categories,
- homeCategories: this.homeCategories,
- };
-
- this.$store.commit("setHomePageSettings", payload);
+ console.log("Saving Settings");
+ console.log(this.homeCategories);
+ this.$store.commit("setShowRecent", this.showRecent);
+ this.$store.commit("setShowLimit", this.showLimit);
+ this.$store.commit("setHomeCategories", this.homeCategories);
},
},
};
diff --git a/frontend/src/components/Settings/General/index.vue b/frontend/src/components/Settings/General/index.vue
index 9f2c9cd0e..c61842b62 100644
--- a/frontend/src/components/Settings/General/index.vue
+++ b/frontend/src/components/Settings/General/index.vue
@@ -43,22 +43,14 @@ export default {
},
data() {
return {
- categories: ["cat 1", "cat 2", "cat 3"],
- usedCategories: ["recent"],
langOptions: [],
selectedLang: "en",
- homeOptions: {
- recipesToShow: 10,
- },
};
},
mounted() {
this.getOptions();
},
watch: {
- usedCategories() {
- console.log(this.usedCategories);
- },
selectedLang() {
this.$store.commit("setLang", this.selectedLang);
},
@@ -66,6 +58,7 @@ export default {
methods: {
getOptions() {
this.langOptions = this.$store.getters.getAllLangs;
+ console.log(this.langOptions);
this.selectedLang = this.$store.getters.getActiveLang;
},
},
diff --git a/frontend/src/components/UI/CategorySidebar.vue b/frontend/src/components/UI/CategorySidebar.vue
new file mode 100644
index 000000000..d81f6ab08
--- /dev/null
+++ b/frontend/src/components/UI/CategorySidebar.vue
@@ -0,0 +1,50 @@
+
+
+
+
+
+ {{ nav.icon }}
+
+ {{ nav.title }}
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/frontend/src/components/UI/UploadBtn.vue b/frontend/src/components/UI/UploadBtn.vue
index b13442b0f..1ada19a7d 100644
--- a/frontend/src/components/UI/UploadBtn.vue
+++ b/frontend/src/components/UI/UploadBtn.vue
@@ -3,7 +3,7 @@
mdi-cloud-upload
- {{ $t('general.upload') }}
+ {{ $t("general.upload") }}
@@ -15,7 +15,6 @@ export default {
url: String,
},
data: () => ({
- defaultButtonText: this.$t("general.upload"),
file: null,
isSelecting: false,
}),
diff --git a/frontend/src/pages/AllRecipesPage.vue b/frontend/src/pages/AllRecipesPage.vue
new file mode 100644
index 000000000..7df8c422a
--- /dev/null
+++ b/frontend/src/pages/AllRecipesPage.vue
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/frontend/src/pages/CategoryPage.vue b/frontend/src/pages/CategoryPage.vue
new file mode 100644
index 000000000..89735233c
--- /dev/null
+++ b/frontend/src/pages/CategoryPage.vue
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/frontend/src/pages/HomePage.vue b/frontend/src/pages/HomePage.vue
index 9a9589e7f..5d43d04cb 100644
--- a/frontend/src/pages/HomePage.vue
+++ b/frontend/src/pages/HomePage.vue
@@ -1,18 +1,20 @@
+
+
@@ -20,34 +22,43 @@