summaryrefslogtreecommitdiff
path: root/src/chef/pages/home.clj
blob: 748c60c68c863d2f643c1b454792b963f4eaf8b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
(ns chef.pages.home
  (:require [hiccup2.core :as html]
            [ring.util.response :as ruresp]
            [chef.utils :as cutils]))

(defn- render []
  (cutils/gen-page "chef"
                   [:div {:style {:text-align :center}}
                    [:h1 "chef"]
                    [:h2 "Finde das perfekte Gericht für dich!"]
                    [:b "Welchen Gang suchst du?"]
                    ;; TODO: Dummy data; replace with data from db
                    [:div
                     [:button {:style {:margin-bottom "1em"}} "Vorspeise"]
                     [:br]
                     [:button {:style {:margin-bottom "1em"}} "Hauptgang"]
                     [:br]
                     [:button {:style {:margin-bottom "1em"}} "Nachtisch"]
                     [:br]]
                    [:input {:type        :text
                             :style       {:width "90%" :margin :auto}
                             :placeholder "Suche"
                             :hx-get      "/components/search"
                             :name        "query"
                             :hx-swap     "innerHTML"
                             :hx-target   "#search-results"}]
                    [:div {:id "search-results"}]]))

(defn handler [req]
  (-> (render)
      html/html
      str
      ruresp/response))