diff options
-rw-r--r-- | resources/public/icons/plus.svg | 1 | ||||
-rw-r--r-- | resources/public/icons/trash.svg | 1 | ||||
-rw-r--r-- | src/chef/database/init.clj | 2 | ||||
-rw-r--r-- | src/chef/pages/admin.clj | 22 | ||||
-rw-r--r-- | src/chef/pages/home.clj | 2 |
5 files changed, 25 insertions, 3 deletions
diff --git a/resources/public/icons/plus.svg b/resources/public/icons/plus.svg new file mode 100644 index 0000000..e150859 --- /dev/null +++ b/resources/public/icons/plus.svg @@ -0,0 +1 @@ +<svg width="128" height="128" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M1600 736v192q0 40-28 68t-68 28h-416v416q0 40-28 68t-68 28h-192q-40 0-68-28t-28-68v-416h-416q-40 0-68-28t-28-68v-192q0-40 28-68t68-28h416v-416q0-40 28-68t68-28h192q40 0 68 28t28 68v416h416q40 0 68 28t28 68z"/></svg>
\ No newline at end of file diff --git a/resources/public/icons/trash.svg b/resources/public/icons/trash.svg new file mode 100644 index 0000000..15e67af --- /dev/null +++ b/resources/public/icons/trash.svg @@ -0,0 +1 @@ +<svg width="128" height="128" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M704 1376v-704q0-14-9-23t-23-9h-64q-14 0-23 9t-9 23v704q0 14 9 23t23 9h64q14 0 23-9t9-23zm256 0v-704q0-14-9-23t-23-9h-64q-14 0-23 9t-9 23v704q0 14 9 23t23 9h64q14 0 23-9t9-23zm256 0v-704q0-14-9-23t-23-9h-64q-14 0-23 9t-9 23v704q0 14 9 23t23 9h64q14 0 23-9t9-23zm-544-992h448l-48-117q-7-9-17-11h-317q-10 2-17 11zm928 32v64q0 14-9 23t-23 9h-96v948q0 83-47 143.5t-113 60.5h-832q-66 0-113-58.5t-47-141.5v-952h-96q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h309l70-167q15-37 54-63t79-26h320q40 0 79 26t54 63l70 167h309q14 0 23 9t9 23z"/></svg>
\ No newline at end of file diff --git a/src/chef/database/init.clj b/src/chef/database/init.clj index f791e39..803e85a 100644 --- a/src/chef/database/init.clj +++ b/src/chef/database/init.clj @@ -8,7 +8,7 @@ [:name :text] [:question :text] [:children :text] - [:parent :text]]})) + [:parent :text]]})) ;TODO: create root category (jdbc/execute! db (sql/format {:create-table :recipes :with-columns [[:id :integer :auto-increment :primary-key] [:category :integer] diff --git a/src/chef/pages/admin.clj b/src/chef/pages/admin.clj index 3e2b0a1..9aaade3 100644 --- a/src/chef/pages/admin.clj +++ b/src/chef/pages/admin.clj @@ -3,9 +3,29 @@ [hiccup2.core :as html] [ring.util.response :as ruresp])) +(defn- render [] + (cutils/gen-page "chef - Admin" + [:h1 "chef - Admin"] + [:h2 "Kategorien"] + ;;TODO: add delete icons to non-root categories + [:ul + [:li + [:p {:style {:display :inline-block}} "Startseite"] + [:p {:style {:display :inline-block + :margin-left "1em" + :margin-right "1em"}} "->"] + [:input {:type :text :placeholder "Frage" + :style {:display :inline-block + :width :auto}}] ; TODO: only show when category has children + [:img {:src "/static/icons/plus.svg" :height "30em" + :style {:vertical-align :middle + :margin-left "1em"}}]]] + [:h2 "Rezepte"] + [:i "Coming soon..."])) + (defn handler [req] (cutils/auth-only req - (-> (cutils/gen-page "chef - Dashboard" [:i "Coming soon..."]) + (-> (render) html/html str ruresp/response))) diff --git a/src/chef/pages/home.clj b/src/chef/pages/home.clj index 210fbed..2060668 100644 --- a/src/chef/pages/home.clj +++ b/src/chef/pages/home.clj @@ -3,7 +3,7 @@ [ring.util.response :as ruresp] [chef.utils :as cutils])) -(defn render [] +(defn- render [] (cutils/gen-page "chef" [:div {:style {:text-align :center}} [:h1 "chef"] |