Skip to content

Commit

Permalink
Use hiccup's special names for classes and ids.
Browse files Browse the repository at this point in the history
  • Loading branch information
Raynes committed Apr 20, 2011
1 parent 38f7bdb commit f9d3eb4
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion src/foreclojure/login.clj
Expand Up @@ -8,7 +8,7 @@
[ring.util.response :as response]))

(def-page my-login-page []
[:div {:class "error"} (session/flash-get :error)]
[:div.error (session/flash-get :error)]
(form-to [:post "/login"]
[:table
[:tr
Expand Down
12 changes: 6 additions & 6 deletions src/foreclojure/problems.clj
Expand Up @@ -111,8 +111,8 @@
(submit-button {:type "image" :src "/run.png"} "Run"))]))

(def-page problem-page []
[:div {:class "congrats"} (session/flash-get :message)]
[:table {:class "my-table" :width "60%"}
[:div.congrats (session/flash-get :message)]
[:table.mytable {:width "60%"}
[:th "Title"]
[:th "Tags"]
[:th "Count"]
Expand All @@ -122,14 +122,14 @@
(map-indexed
(fn [x {:keys [title times-solved tags], id :_id}]
[:tr (row-class x)
[:td {:class "title-link"}
[:td.titlelink
[:a {:href (str "/problem/" id)}
title]]
[:td {:class "centered"}
[:td.centered
(s/join " " (map #(str "<span class='tag'>" % "</span>")
tags))]
[:td {:class "centered"} (int times-solved)]
[:td {:class "centered"}
[:td.centered (int times-solved)]
[:td.centered
[:img {:src (if (contains? solved id)
"/checkmark.png"
"/empty-sq.png")}]]])
Expand Down
2 changes: 1 addition & 1 deletion src/foreclojure/register.clj
Expand Up @@ -13,7 +13,7 @@
[:td (type name)]])

(def-page register-page []
[:div {:class "error"} (session/flash-get :error)]
[:div.error (session/flash-get :error)]
(form-to [:post "/register"]
[:table
(map form-row
Expand Down
12 changes: 6 additions & 6 deletions src/foreclojure/static.clj
Expand Up @@ -12,7 +12,7 @@
"StackOverflow.com: A Gentle Tutorial to Emacs/Swank/Paredit for Clojure"]]])

(def-page welcome-page []
[:div {:id "welcome"}
[:div#welcome
[:div
[:h3 "What is 4Clojure?"]
[:p "4Clojure is a resource to help fledgling clojurians learn the language through interactive problems. The first few problems are easy enough that even someone with no prior experience should find the learning curve forgiving. See 'Getting Started' for more information."]]
Expand All @@ -35,8 +35,8 @@
[:u "not"]
" part of the syntax of the language. Any code which makes the final form evaluate to 'true' will be considered a correct answer. Lets consider the first problem:"
[:br][:br]
[:div {:id "testcases"}
[:li {:class "testcase"} "(= __ true)"]]
[:div#testcases
[:li.testcase "(= __ true)"]]
[:br][:br][:br]
"Any of the following would be considered correct answers:"
[:br][:br]
Expand All @@ -46,9 +46,9 @@
[:br]
"Some problems will expect you to fill-in-the-blanks with a function. Here is a problem which asks you to provide a function to double a number:"
[:br][:br]
[:div {:id "testcases"}
[:li {:class "testcase"} "(= (__ 2) 4)"]
[:li {:class "testcase"} "(= (__ 3) 6)"]]
[:div#testcases
[:li.testcase "(= (__ 2) 4)"]
[:li.testcase "(= (__ 3) 6)"]]
[:br][:br][:br][:br]
"Any of the following forms are valid solutions:"
[:br][:br]
Expand Down
26 changes: 13 additions & 13 deletions src/foreclojure/utils.clj
Expand Up @@ -66,20 +66,20 @@
"
)]
[:body
[:div {:id "top"} [:img {:id "logo" :src "/logo.png"}]]
[:div {:id "content"}
[:div {:id "menu"}
[:div#top [:img#logo {:src "/logo.png"}]]
[:div#content
[:div#menu
[:a {:href "/"} "Main Page"]
[:a {:href "/problems"} "Problem List"]
[:a {:href "/users"} "Top Users"]
[:a {:href "/directions"} "Getting Started"]
[:span {:id "user-info"}
(if-let [user (session/session-get :user)]
[:div
(str "Logged in as " user)
[:a {:id "logout" :href "/logout"} "Logout"]]
[:div
[:a {:href "/login"} "Login"] " or "
[:a {:href "/register"} "Register"]])]]
[:div {:id "content"} body]
[:div {:id "footer"} "&copy; 2011 David Byrne" ]]]]))
[:span#user-info
(if-let [user (session/session-get :user)]
[:div
(str "Logged in as " user)
[:a#logout :href "/logout" "Logout"]]
[:div
[:a {:href "/login"} "Login"] " or "
[:a {:href "/register"} "Register"]])]]
[:div#content body]
[:div#footer "&copy; 2011 David Byrne" ]]]]))

0 comments on commit f9d3eb4

Please sign in to comment.