diff options
Diffstat (limited to 'src/chef/pages/admin.clj')
-rw-r--r-- | src/chef/pages/admin.clj | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/chef/pages/admin.clj b/src/chef/pages/admin.clj index 83e5dbd..031da8c 100644 --- a/src/chef/pages/admin.clj +++ b/src/chef/pages/admin.clj @@ -8,17 +8,24 @@ (defn- render-category [data children] [:li - [:p {:style {:display :inline-block}} (if (some? data) - [:input {:type :text :placeholder "Name" - :value (:categories/name data)}] - "Startseite")] + [:p {:style {:display :inline-block}} + (if (some? data) + [:input {:type :text :placeholder "Name" + :value (:categories/name data) + :name "name" + :hx-post (str "/api/admin/edit-category/" (:categories/id data)) + :hx-trigger "change"}] + "Startseite")] [:p {:style {:display :inline-block :margin-left "1em" :margin-right "1em"}} "->"] - [:input {:type :text :placeholder "Frage" - :style {:display :inline-block - :width :auto} - :value (:category/name data)}] ; TODO: only show when category has children + [:input {:type :text :placeholder "Frage" + :style {:display :inline-block + :width :auto} + :value (:categories/question data) + :name "question" + :hx-post (str "/api/admin/edit-category/" (:categories/id data)) + :hx-trigger "change"}] ; TODO: only show when category has children [:img {:src "/static/icons/plus.svg" :height "30em" :style {:vertical-align :middle :margin-left "1em"} |