Skip to content

Commit

Permalink
Merge branch 'hotfix/1.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
amalloy committed Sep 12, 2011
2 parents ce29962 + a601de1 commit c079fca
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions src/foreclojure/users.clj
Expand Up @@ -88,12 +88,29 @@
(filter ids (get-solved username)))))

(def-page user-profile [username]
[:h2 "User: " username]
[:hr]
[:table
(for [difficulty ["Elementary" "Easy" "Medium" "Hard"]]
[:tr [:td.count-label difficulty] [:td.count-value [:div.progress-bar-bg [:div.progress-bar {:style (str "width: " (* 100 (/ (count (get-solved username difficulty)) (count (get-problems difficulty)))) "%")}]]]])
[:tr [:td.count-total "TOTAL:" ] [:td.count-value (count (get-solved username)) "/" (count (get-problems))]]])
(let [page-title (str "User: " username)]
{:title title
:content
(list
[:h2 "User: " username]
[:hr]
[:table
(for [difficulty ["Elementary" "Easy" "Medium" "Hard"]]
(let [solved (count (get-solved username difficulty))
total (count (get-problems difficulty))]
[:tr
[:td.count-label difficulty]
[:td.count-value
[:div.progress-bar-bg
[:div.progress-bar
{:style (str "width: "
(int (* 100 (/ solved total)))
"%")}]]]]))
[:tr
[:td.count-total "TOTAL:" ]
[:td.count-value
(count (get-solved username)) "/"
(count (get-problems))]]])}))

(defn set-disable-codebox [disable-flag]
(with-user [{:keys [_id]}]
Expand Down

0 comments on commit c079fca

Please sign in to comment.