                          (assoc (:response ctx)
                                 :cookies {"session" cookie}
                                 :body (html
-                                       [:h1 (format "Thanks %s!" (get-in ctx [:parameters :form :user]))]
+                                       [:h1 (format "Hello %s!" (get-in ctx [:parameters :form :user]))]
                                        [:p [:a {:href (path-for @*router ::secret)} "secret"]]
                                        [:p [:a {:href (path-for @*router ::logout)} "logout"]]
                                        )))

   [yada.yada :as yada :refer [yada resource as-resource]]
   [ring.middleware.cookies :refer [cookies-request cookies-response]])
  (:import [modular.bidi Router]))

(defn hello []
  (yada "Hello World!\n"))

(defn- login-form-html [fields]
  (html
   [:div
    [:style "* {margin:2px;padding:2px}"]
    [:h1 "Login form"]
    [:form {:method :post}
     (for [{:keys [label type name]} fields]
       [:div
        [:label {:for name} label]
        [:input {:type type :name name}]])
     [:div [:input {:type :submit :name :submit :value "Login"}]]]]))

(defn- login-form-parameters [fields]
  {:form

     :methods
     {:get
      {:produces "text/html"
       :response (html
                  [:div
                   [:style "* {margin:2px;padding:2px}"]
                   [:h1 "Login form"]
                   [:form {:method :post}
                    (for [{:keys [label type name]} fields]
                      [:div
                       [:label {:for name} label]
                       [:input {:type type :name name}]])
                    [:div [:input {:type :submit :name :submit :value "Login"}]]]])}
      
      :post
      {:parameters (login-form-parameters fields)
