diff options
Diffstat (limited to 'src/chef/frontend/visitor')
-rw-r--r-- | src/chef/frontend/visitor/recipe.clj | 30 | ||||
-rw-r--r-- | src/chef/frontend/visitor/search.clj | 2 |
2 files changed, 18 insertions, 14 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])) diff --git a/src/chef/frontend/visitor/search.clj b/src/chef/frontend/visitor/search.clj index 7a2db93..3afa029 100644 --- a/src/chef/frontend/visitor/search.clj +++ b/src/chef/frontend/visitor/search.clj @@ -8,7 +8,7 @@ [chef.logic.recipes :as clrecipes])) (defn render [query category] - [:table + [:table {:style {:margin "1em"}} [:tr [:th "Rezept"] [:th "Kategorie"]] |