summaryrefslogtreecommitdiff
path: root/src/chef/frontend/visitor/recipe.clj
diff options
context:
space:
mode:
authorTim <contact@bytim.eu>2025-06-21 12:42:03 +0200
committerTim <contact@bytim.eu>2025-06-21 12:42:03 +0200
commit09d21984a753649d47b977fa563bd5ebd37cc5ef (patch)
treef72e4373a9e26cc3bc99b50ac7ea7dd66bc333b9 /src/chef/frontend/visitor/recipe.clj
parenta18ef423d43c2d2b8f2b6b3a74ada48f1f4eaf5f (diff)
downloadchef-09d21984a753649d47b977fa563bd5ebd37cc5ef.tar.xz
chef-09d21984a753649d47b977fa563bd5ebd37cc5ef.zip
Make changes to visitor uiHEADmaster
Diffstat (limited to 'src/chef/frontend/visitor/recipe.clj')
-rw-r--r--src/chef/frontend/visitor/recipe.clj30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/chef/frontend/visitor/recipe.clj b/src/chef/frontend/visitor/recipe.clj
index e3dbf97..f76b58a 100644
--- a/src/chef/frontend/visitor/recipe.clj
+++ b/src/chef/frontend/visitor/recipe.clj
@@ -9,8 +9,10 @@
(defn- render [portions recipe]
(cutils/gen-page (str "chef - " (:recipes/title recipe))
- [:div {:style {:margin-left "1em"}}
- [:div
+ [:div {:style {:margin "2em auto"
+ :width :fit-content}
+ :class "card"}
+ [:div {:style {:width :inherit}}
[:h1 {:style {:display :inline-block
:margin-right "0.5em"}}
(:recipes/title recipe)]
@@ -19,8 +21,9 @@
clcategories/generate-path) ")")]]
(when (some? (clrecipes/get-recipe-thumbnail (:recipes/id recipe)))
[:img {:src (str "/recipes/" (:recipes/id recipe) "/thumbnail")
- :width "50%"}])
- [:h2
+ :width "50%"
+ :style {:border-radius "10px"}}])
+ [:h2 {:style {:width :inherit}}
"Zutaten pro "
[:input {:type :number
:value portions
@@ -32,19 +35,20 @@
1 " Person(en)"
"")
":"]
- [:ul (for [ingredient (-> recipe
- :recipes/ingredients
- cutils/parse-ingredients)]
- [:li
- [:b (:description ingredient)] ": "
- (* (:amount ingredient) portions)
- (:unit ingredient)])]
- [:h2 "Zubereitung"]
+ [:ul {:style {:width :inherit}}
+ (for [ingredient (-> recipe
+ :recipes/ingredients
+ cutils/parse-ingredients)]
+ [:li
+ [:b (:description ingredient)] ": "
+ (* (:amount ingredient) portions)
+ (:unit ingredient)])]
+ [:h2 {:style {:width :inherit}} "Zubereitung"]
(->> (:recipes/preparation recipe)
cstr/split-lines
(map #(if (cstr/blank? %)
[:br]
- [:p %])))]))
+ [:p {:style {:width :inherit}} %])))]))
(defn handler [req]
(->> (clrecipes/get-recipe (get-in req [:path-params :id]))