diff options
Diffstat (limited to 'src/chef/pages/admin/recipe_editor.clj')
-rw-r--r-- | src/chef/pages/admin/recipe_editor.clj | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/chef/pages/admin/recipe_editor.clj b/src/chef/pages/admin/recipe_editor.clj index 6afd591..cc30942 100644 --- a/src/chef/pages/admin/recipe_editor.clj +++ b/src/chef/pages/admin/recipe_editor.clj @@ -13,9 +13,20 @@ [:h1 "Rezept bearbeiten"] [:form {:style {:width "50%"} :hx-post (str "/api/admin/edit-recipe/" (:recipes/id recipe)) - :hx-swap "none"} + :hx-swap "none" + :enctype "multipart/form-data"} [:input {:type :text :name "title" :placeholder "Titel" :value (:recipes/title recipe)}] + [:div {:style {:display :flex}} + [:p {:style {:margin-right "0.5em"}} "Thumbnail: "] + [:input {:type :file :name "thumbnail" + :style {:height :fit-content + :padding "0.3em"}}]] + [:button {:class ["button" "error"] + :hx-trigger "click" + :hx-delete (str "/api/admin/delete-thumbnail/" (:recipes/id recipe)) + :hx-swap :none} + "Thumbnail entfernen"] [:h2 "Kategorie"] [:select {:name "category"} (for [category (->> (sql/format {:select [:*] @@ -36,7 +47,6 @@ [:p ":"]] [:textarea {:name "ingredients"} (:recipes/ingredients recipe)] - ;; Regex: ([A-z0-9 ]*)=([0-9]*) ?([A-z]*) [:p "(Je Zeile eine Zutat, in dem Format " [:code "[Beschreibung der Zutat]=[Menge als Zahl][Einheit der Menge]"] ".)"] [:h2 "Zubereitung"] [:textarea {:name "preparation"} |