Skip to content

Commit

Permalink
Un-indent some instances of form-to
Browse files Browse the repository at this point in the history
  • Loading branch information
amalloy committed Apr 23, 2011
1 parent 2b806e1 commit 9aae536
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 29 deletions.
28 changes: 14 additions & 14 deletions src/foreclojure/login.clj
Expand Up @@ -13,20 +13,20 @@
(def-page my-login-page []
[:div.error (session/flash-get :error)]
(form-to [:post "/login"]
[:table
[:tr
[:td (label :user "Username")]
[:td (text-field :user)]]
[:tr
[:td (label :pwd "Password")]
[:td (password-field :pwd)]]
[:tr
[:td]
[:td [:button {:type "submit"} "Log In"]]]
[:tr
[:td ]
[:td
[:a {:href "/login/reset"} "Forgot your password?"]]]]))
[:table
[:tr
[:td (label :user "Username")]
[:td (text-field :user)]]
[:tr
[:td (label :pwd "Password")]
[:td (password-field :pwd)]]
[:tr
[:td]
[:td [:button {:type "submit"} "Log In"]]]
[:tr
[:td ]
[:td
[:a {:href "/login/reset"} "Forgot your password?"]]]]))

(defn do-login [user pwd]
(let [user (.toLowerCase user)
Expand Down
14 changes: 7 additions & 7 deletions src/foreclojure/problems.clj
Expand Up @@ -94,12 +94,12 @@
[:b "Enter your code:" [:br]
[:span {:class "error"} (session/flash-get :error)]]]
(form-to [:post "/run-code"]
(text-area {:id "code-box"
:spellcheck "false"}
:code (session/flash-get :code))
(hidden-field :id id)
[:br]
[:button.large {:type "submit"} "Run"])]))
(text-area {:id "code-box"
:spellcheck "false"}
:code (session/flash-get :code))
(hidden-field :id id)
[:br]
[:button.large {:type "submit"} "Run"])]))

(def-page problem-page []
[:div.congrats (session/flash-get :message)]
Expand Down Expand Up @@ -132,4 +132,4 @@
(GET "/problems" [] (problem-page))
(GET "/problem/:id" [id] (code-box id))
(POST "/run-code" {{:strs [id code]} :form-params}
(run-code (Integer. id) code)))
(run-code (Integer. id) code)))
16 changes: 8 additions & 8 deletions src/foreclojure/register.clj
Expand Up @@ -10,14 +10,14 @@
(def-page register-page []
[:div.error (session/flash-get :error)]
(form-to [:post "/register"]
[:table
(map form-row
[[text-field :user "Username (4-13 chars.)"]
[password-field :pwd "Password (7-13 chars.)"]
[password-field :repeat-pwd "Repeat Password"]
[text-field :email "Email"]])
[:tr
[:td [:button {:type "submit"} "Register"]]]]))
[:table
(map form-row
[[text-field :user "Username (4-13 chars.)"]
[password-field :pwd "Password (7-13 chars.)"]
[password-field :repeat-pwd "Repeat Password"]
[text-field :email "Email"]])
[:tr
[:td [:button {:type "submit"} "Register"]]]]))

(defn do-register [user pwd repeat-pwd email]
(let [lower-user (.toLowerCase user)]
Expand Down

0 comments on commit 9aae536

Please sign in to comment.