From a59ac44f3b81628f8b736344973779f48fa204bc Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Wed, 13 Jan 2021 10:57:38 +0100 Subject: [PATCH] recipe page styling --- cookbook/templates/test.html | 35 ++++++++++++++++ vue/src/apps/RecipeView/RecipeView.vue | 34 ++++++++------- vue/src/components/Ingredient.vue | 2 - vue/src/components/Nutrition.vue | 57 +++++++++----------------- vue/vue.config.js | 2 +- vue/webpack-stats.json | 2 +- 6 files changed, 77 insertions(+), 55 deletions(-) diff --git a/cookbook/templates/test.html b/cookbook/templates/test.html index 69878df8..a524aa5e 100644 --- a/cookbook/templates/test.html +++ b/cookbook/templates/test.html @@ -36,6 +36,41 @@ + {% if request.user.userpreference.comments %} +
+
+ +
{% trans 'Comments' %} +
+ {% for c in comments %} +
+
+ {{ c.updated_at }} {% trans 'by' %} {{ c.created_by.username }}
+ {{ c.text }} +
+
+
+ {% endfor %} + + {% if request.user.is_authenticated %} +
+ +
+ {% csrf_token %} +
+ +
+ +
+
+
+
+ {% endif %} + {% endif %} + {% endblock %} diff --git a/vue/src/apps/RecipeView/RecipeView.vue b/vue/src/apps/RecipeView/RecipeView.vue index d412f661..0292b3a1 100644 --- a/vue/src/apps/RecipeView/RecipeView.vue +++ b/vue/src/apps/RecipeView/RecipeView.vue @@ -14,7 +14,7 @@
-
+
@@ -26,7 +26,7 @@
-
+
@@ -38,11 +38,26 @@
-
- Hier kann noch text stehen +
+ + + + + + + +
+ + + + + {{ _('Servings') }} +
+
-
+
@@ -57,15 +72,6 @@

{{ _('Ingredients') }}

-
-
- -
- -
-
-

diff --git a/vue/src/components/Ingredient.vue b/vue/src/components/Ingredient.vue index c5f3251c..084694e4 100644 --- a/vue/src/components/Ingredient.vue +++ b/vue/src/components/Ingredient.vue @@ -19,8 +19,6 @@ class="d-print-none"> - -
{{ ingredient.note }}
diff --git a/vue/src/components/Nutrition.vue b/vue/src/components/Nutrition.vue index cb1dce53..757917a5 100644 --- a/vue/src/components/Nutrition.vue +++ b/vue/src/components/Nutrition.vue @@ -6,67 +6,50 @@
-
{{ _('Nutrition') }}
+

{{ _('Nutrition') }}

-
- -
- -
-
- {{ _('Calories') }} +
+ {{ _('Calories') }} +
+
{{ calculateAmount(recipe.nutrition.calories) }} kcal
-
- {{ _('Carbohydrates') }} +
+ {{ _('Carbohydrates') }} +
+
+ {{ calculateAmount(recipe.nutrition.carbohydrates) }} g
-
-
-
- {{ _('Fats') }} -
-
- {{ calculateAmount(recipe.nutrition.fats) }} -
-
- g -
+
+
+ {{ _('Fats') }}
- -
-
- {{ _('Fats') }} -
-
- {{ calculateAmount(recipe.nutrition.fats) }} -
-
- g -
+
+ {{ calculateAmount(recipe.nutrition.fats) }} g
-
-
- {{ _('Proteins') }} +
+ {{ _('Proteins') }} +
+
{{ calculateAmount(recipe.nutrition.proteins) }} g
- +
-
diff --git a/vue/vue.config.js b/vue/vue.config.js index 6925020e..b36b032d 100644 --- a/vue/vue.config.js +++ b/vue/vue.config.js @@ -48,7 +48,7 @@ module.exports = { .host('localhost') .port(8080) .hotOnly(true) - .watchOptions({poll: 1000}) + .watchOptions({poll: 500}) .https(false) .headers({"Access-Control-Allow-Origin": ["*"]}) diff --git a/vue/webpack-stats.json b/vue/webpack-stats.json index 875feb47..fc06687d 100644 --- a/vue/webpack-stats.json +++ b/vue/webpack-stats.json @@ -1 +1 @@ -{"status":"done","publicPath":"http://localhost:8080/","chunks":{"chunk-vendors":[{"name":"js/chunk-vendors.js","publicPath":"http://localhost:8080/js/chunk-vendors.js","path":"F:\\Developement\\Django\\recipes\\cookbook\\static\\vue\\js\\chunk-vendors.js"}],"recipe_view":[{"name":"js/recipe_view.js","publicPath":"http://localhost:8080/js/recipe_view.js","path":"F:\\Developement\\Django\\recipes\\cookbook\\static\\vue\\js\\recipe_view.js"},{"name":"recipe_view.984f442acdcbbef1634d.hot-update.js","publicPath":"http://localhost:8080/recipe_view.984f442acdcbbef1634d.hot-update.js","path":"F:\\Developement\\Django\\recipes\\cookbook\\static\\vue\\recipe_view.984f442acdcbbef1634d.hot-update.js"}]},"error":"ModuleError","message":"Module Error (from ./node_modules/eslint-loader/index.js):\n\nF:\\Developement\\Django\\recipes\\vue\\src\\components\\ImageViewer.vue\n 25:50 error 'resolveDjangoUrl' is not defined no-undef\n\n✖ 1 problem (1 error, 0 warnings)\n"} \ No newline at end of file +{"status":"done","publicPath":"http://localhost:8080/","chunks":{"chunk-vendors":[{"name":"js/chunk-vendors.js","publicPath":"http://localhost:8080/js/chunk-vendors.js","path":"F:\\Developement\\Django\\recipes\\cookbook\\static\\vue\\js\\chunk-vendors.js"}],"recipe_view":[{"name":"js/recipe_view.js","publicPath":"http://localhost:8080/js/recipe_view.js","path":"F:\\Developement\\Django\\recipes\\cookbook\\static\\vue\\js\\recipe_view.js"},{"name":"recipe_view.b45a25f0f923b4f16949.hot-update.js","publicPath":"http://localhost:8080/recipe_view.b45a25f0f923b4f16949.hot-update.js","path":"F:\\Developement\\Django\\recipes\\cookbook\\static\\vue\\recipe_view.b45a25f0f923b4f16949.hot-update.js"}]},"error":"ModuleError","message":"Module Error (from ./node_modules/eslint-loader/index.js):\n\nF:\\Developement\\Django\\recipes\\vue\\src\\apps\\RecipeView\\RecipeView.vue\n 48:130 error Parsing error: missing-whitespace-between-attributes vue/no-parsing-error\n 48:131 error Parsing error: unexpected-character-in-attribute-name vue/no-parsing-error\n\n✖ 2 problems (2 errors, 0 warnings)\n"} \ No newline at end of file