# HG changeset patch # User Steve Losh # Date 1317871018 14400 # Node ID 0ee99fd4f36362e8198d5c72380f69e3c85cf820 # Parent 906581f17100c3131ea28900e8437bc266e6739a Use form-to everywhere. diff -r 906581f17100 -r 0ee99fd4f363 src/newseasons/templates/main.clj --- a/src/newseasons/templates/main.clj Wed Oct 05 22:59:03 2011 -0400 +++ b/src/newseasons/templates/main.clj Wed Oct 05 23:16:58 2011 -0400 @@ -89,10 +89,10 @@ (defpartial home [] (base "home" [:div.six.columns - [:form {:action "" :method "POST"} - (field text-field "email" "Email Address") - (field password-field "password" "Password") - (submit-button "Log In or Create Account")]] + (form-to [:post ""] + (field text-field "email" "Email Address") + (field password-field "password" "Password") + (submit-button "Log In or Create Account"))] [:div.five.columns [:p "New Seasons will notify you when your favorite TV " "shows have new seasons on iTunes."]] @@ -111,24 +111,24 @@ (defpartial user [user] (inner (str "Hello, " (:email user)) "user" - [:div.seven.columns - [:form {:action "/search"} - (field text-field - "query" - "Which show do you want to keep track of?") - (submit-button "Search")]] - [:div.nine.columns - (let [shows (:shows user)] - (if (empty? shows) - [:p "You're not currently watching any shows."] - (list - [:p - "You're watching " - (count shows) - " show" - (pluralize shows) - "."] - [:ul.shows (map user-show shows)])))])) + [:div.seven.columns + (form-to [:get "search"] + (field text-field + "query" + "Which show do you want to keep track of?") + (submit-button "Search"))] + [:div.nine.columns + (let [shows (:shows user)] + (if (empty? shows) + [:p "You're not currently watching any shows."] + (list + [:p + "You're watching " + (count shows) + " show" + (pluralize shows) + "."] + [:ul.shows (map user-show shows)])))])) (defpartial result [r]