diff --git a/dev/data/templates/recipes.md b/dev/data/templates/recipes.md index 84a404798444..6ee2d4bb6972 100644 --- a/dev/data/templates/recipes.md +++ b/dev/data/templates/recipes.md @@ -1,6 +1,6 @@ -![Recipe Image](../../images/{{ recipe.image }}) +![Recipe Image](../../images/{{ recipe.slug }}/original.jpg) # {{ recipe.name }} {{ recipe.description }} diff --git a/frontend/src/App.vue b/frontend/src/App.vue index d9de087efdc7..bb545577b9a9 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,35 +1,6 @@ diff --git a/frontend/src/api/category.js b/frontend/src/api/category.js index ef582c580478..0f8ecd3fd65c 100644 --- a/frontend/src/api/category.js +++ b/frontend/src/api/category.js @@ -5,27 +5,27 @@ import { store } from "@/store"; const prefix = baseURL + "categories"; const categoryURLs = { - get_all: `${prefix}`, - get_category: category => `${prefix}/${category}`, - delete_category: category => `${prefix}/${category}`, + getAll: `${prefix}`, + getCategory: category => `${prefix}/${category}`, + deleteCategory: category => `${prefix}/${category}`, }; export const categoryAPI = { async getAll() { - let response = await apiReq.get(categoryURLs.get_all); + let response = await apiReq.get(categoryURLs.getAll); return response.data; }, async create(name) { - let response = await apiReq.post(categoryURLs.get_all, { name: name }); + let response = await apiReq.post(categoryURLs.getAll, { name: name }); store.dispatch("requestCategories"); return response.data; }, async getRecipesInCategory(category) { - let response = await apiReq.get(categoryURLs.get_category(category)); + let response = await apiReq.get(categoryURLs.getCategory(category)); return response.data; }, async delete(category) { - let response = await apiReq.delete(categoryURLs.delete_category(category)); + let response = await apiReq.delete(categoryURLs.deleteCategory(category)); store.dispatch("requestCategories"); return response.data; }, diff --git a/frontend/src/api/recipe.js b/frontend/src/api/recipe.js index 97a4b08c4713..5eef791acf8f 100644 --- a/frontend/src/api/recipe.js +++ b/frontend/src/api/recipe.js @@ -56,9 +56,7 @@ export const recipeAPI = { const fd = new FormData(); fd.append("image", fileObject); fd.append("extension", fileObject.name.split(".").pop()); - let response = apiReq.put(recipeURLs.updateImage(recipeSlug), fd); - return response; }, @@ -87,4 +85,16 @@ export const recipeAPI = { return response.data; }, + + recipeImage(recipeSlug) { + return `/api/recipes/${recipeSlug}/image?image_type=original`; + }, + + recipeSmallImage(recipeSlug) { + return `/api/recipes/${recipeSlug}/image?image_type=small`; + }, + + recipeTinyImage(recipeSlug) { + return `/api/recipes/${recipeSlug}/image?image_type=tiny`; + }, }; diff --git a/frontend/src/components/MealPlan/MealPlanCard.vue b/frontend/src/components/MealPlan/MealPlanCard.vue index f88e27c177ca..985f039aa48f 100644 --- a/frontend/src/components/MealPlan/MealPlanCard.vue +++ b/frontend/src/components/MealPlan/MealPlanCard.vue @@ -28,8 +28,8 @@ \ No newline at end of file diff --git a/frontend/src/components/UI/TheAppBar.vue b/frontend/src/components/UI/TheAppBar.vue new file mode 100644 index 000000000000..1c556feb6a00 --- /dev/null +++ b/frontend/src/components/UI/TheAppBar.vue @@ -0,0 +1,114 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/mixins/utilMixins.js b/frontend/src/mixins/utilMixins.js new file mode 100644 index 000000000000..2b9bf8504264 --- /dev/null +++ b/frontend/src/mixins/utilMixins.js @@ -0,0 +1,7 @@ +export const utilMixins = { + commputed: { + isMobile() { + return this.$vuetify.breakpoint.name === "xs"; + }, + }, +}; diff --git a/frontend/src/pages/MealPlan/Planner.vue b/frontend/src/pages/MealPlan/Planner.vue index 57df248a3835..2d472216d244 100644 --- a/frontend/src/pages/MealPlan/Planner.vue +++ b/frontend/src/pages/MealPlan/Planner.vue @@ -117,7 +117,7 @@ export default { return utils.getDateAsTextAlt(dateObject); }, getImage(image) { - return utils.getImageURL(image); + return api.recipes.recipeTinyImage(image); }, editPlan(id) { diff --git a/frontend/src/pages/MealPlan/ThisWeek.vue b/frontend/src/pages/MealPlan/ThisWeek.vue index a361ba0e16e1..e8279d319f80 100644 --- a/frontend/src/pages/MealPlan/ThisWeek.vue +++ b/frontend/src/pages/MealPlan/ThisWeek.vue @@ -52,7 +52,6 @@