Skip to content

Commit

Permalink
Allow for a user named 'anonymous' to live amongst the named people a…
Browse files Browse the repository at this point in the history
…nd lead a relatively normal life.
  • Loading branch information
Raynes committed Jan 4, 2012
1 parent 79e1fad commit 30d7df8
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions src/refheap/views/paste.clj
Expand Up @@ -62,20 +62,18 @@

(defn pastes [ps]
(for [{:keys [paste-id summary date user]} ps]
(let [user (if user
(:username (users/get-user-by-id user))
"anonymous")]
(list
[:span.header
(ph/link-to (str "/paste/" paste-id) paste-id)
" pasted by "
(if (= user "anonymous")
user
(list
[:span.header
(ph/link-to (str "/paste/" paste-id) paste-id)
" pasted by "
(if user
(let [user (:username (users/get-user-by-id user))]
(ph/link-to (str "/users/" user) user))
" on "
(date-string date)]
[:div.syntax summary]
[:br]))))
"anonymous")
" on "
(date-string date)]
[:div.syntax summary]
[:br])))

(defn all-pastes-page [page]
(let [paste-count (paste/count-pastes)]
Expand Down

0 comments on commit 30d7df8

Please sign in to comment.