Skip to content

Commit b5465fb

Browse files
committed
little improvement over activity creating form
1 parent 903bf4f commit b5465fb

File tree

2 files changed

+23
-14
lines changed

2 files changed

+23
-14
lines changed

Diff for: src/co/gaiwan/compass/html/sessions.clj

+12-12
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,15 @@
9595
[:div
9696
[:label {:for "location"} "Location"]
9797
[:select {:id "location" :name "location"}
98-
[:option {:value "depot"} "Het Depot - main stage"]
99-
[:option {:value "depot"} "Het Depot - Bar"]
100-
[:option {:value "hal5"} "Hal 5 - zone A"]
101-
[:option {:value "hal5"} "Hal 5 - zone B"]
102-
[:option {:value "hal5"} "Hal 5 - HoC Café"]
103-
[:option {:value "hal5"} "Hal 5 - Foodcourt"]
104-
[:option {:value "hal5"} "Hal 5 - park"]
105-
[:option {:value "hal5"} "Hal 5 - outside seating"]
106-
[:option {:value "hal5"} "Hal 5 - long table"]]]
98+
[:option {:value "depot-main-stage"} "Het Depot - main stage"]
99+
[:option {:value "depot-baar"} "Het Depot - Bar"]
100+
[:option {:value "hal5-zone-a"} "Hal 5 - zone A"]
101+
[:option {:value "hal5-zone-b"} "Hal 5 - zone B"]
102+
[:option {:value "hal5-hoc-cafe"} "Hal 5 - HoC Café"]
103+
[:option {:value "hal5-foodcourt"} "Hal 5 - Foodcourt"]
104+
[:option {:value "hal5-park"} "Hal 5 - park"]
105+
[:option {:value "hal5-outside-seating"} "Hal 5 - outside seating"]
106+
[:option {:value "hal5-long-table"} "Hal 5 - long table"]]]
107107

108108
[:div
109109
[:label {:for "capacity"} "Capacity"]
@@ -115,10 +115,10 @@
115115

116116
[:div
117117
[:label {:for "requires_ticket"} "Requires Ticket?"]
118-
[:input {:id "requires_ticket" :name "requires_ticket" :type "checkbox"}]]
118+
[:input {:id "requires_ticket" :name "requires-ticket?" :type "checkbox"}]]
119119

120120
[:div
121-
[:label {:for "published"} "Published?"]
122-
[:input {:id "published" :name "published" :type "checkbox"}]]
121+
[:label {:for "published"} "Published/Visible?"]
122+
[:input {:id "published" :name "published?" :type "checkbox"}]]
123123

124124
[:input {:type "submit" :value "Create"}]]]))

Diff for: src/co/gaiwan/compass/routes/sessions.clj

+11-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"
99
(:require
1010
[co.gaiwan.compass.html.sessions :as h]
11-
[ring.util.response :as response]))
11+
[ring.util.response :as response]
12+
[co.gaiwan.compass.db :as db]))
1213

1314
(defn new-session [req]
1415
(if-not (:identity req)
@@ -17,7 +18,15 @@
1718
{:html/head [:title "Create new session"]
1819
:html/body [h/session-form {}]}))
1920

20-
(defn save-session [{:keys [params]}]
21+
(defn save-session
22+
"Save session to Datomic
23+
24+
The typical params is:
25+
{:name \"dsafa\", :type \"talk\",
26+
:location \"depot-main-stage\", :capacity \"34\",
27+
:description \"dsafa\", :requires-ticket? \"on\"
28+
:published? \"on\"}"
29+
[{:keys [params]}]
2130
;; TODO save to datomic
2231
{:html/body [:p "OK " (pr-str params)]})
2332

0 commit comments

Comments
 (0)