Created
May 16, 2012 02:07
-
-
Save devn/2706731 to your computer and use it in GitHub Desktop.
noir.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defpartial search-input [{:keys [query]}] | |
(label "query" "Search by Input: ") | |
(text-field "query" query)) | |
(defpartial search-value [{:keys [query]}] | |
(label "query" "Search by Output: ") | |
(text-field "query" query)) | |
(defpage "/" {:as query} | |
(common/layout | |
[:h1 "getclojure"] | |
[:div#search-input | |
(form-to | |
[:post "/search-by-input/:query"] | |
(search-input query) | |
(submit-button "Search Input"))] | |
[:div#search-value | |
(form-to | |
[:post "/search-by-value/:query"] | |
(search-value query) | |
(submit-button "Search Value"))])) | |
(defpage [:post "/search-by-input/:query"] {:keys [query]} | |
(common/layout | |
[:h1 (str "\"" query "\"" " examples")] | |
[:dl (search (core/walton-html query))])) | |
(defpage [:post "/search-by-value/:query"] {:keys [query]} | |
(common/layout | |
[:h1 (str "\"" query "\"" " examples")] | |
[:dl (search (core/notlaw-html query))])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment