Skip to content
Browse files

Merge branch 'release/1.5.2.2'

  • Loading branch information...
2 parents 742322d + 0701bc7 commit 51b6103919a3cbfd44512f8dec73404d7c5effb5 @amalloy amalloy committed Nov 7, 2011
View
1 README.md
@@ -49,6 +49,7 @@ vaguely like this:
* [Michael Kohl](https://github.com/citizen428) (citizen428)
* [Martin Sander](https://github.com/marvinthepa) (0x89)
* [Alex McNamara](https://github.com/amcnamara) (amcnamara)
+* [Ara Jeknavorian](https://github.com/arajek) (arajek)
Problem sources:
View
2 project.clj
@@ -1,4 +1,4 @@
-(defproject foreclojure "1.5.2.1"
+(defproject foreclojure "1.5.2.2"
:description "4clojure - a website for learning Clojure"
:dependencies [[clojure "1.2.1"]
[clojure-contrib "1.2.0"]
View
BIN resources/public/images/4clj-gus-confused-small.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
2 src/foreclojure/problems.clj
@@ -545,7 +545,7 @@ Return a map, {:message, :error, :url, :num-tests-passed}."
{:from "team@4clojure.com"
:to [(users/email-address user)]
:subject (format "Problem #%d: submission accepted" id)
- :html (html (link-to url title))
+ :html (html (link-to (str "http://www.4clojure.com/" url) title))
:text (str title ": " url)})
;; TODO: dump this in a proper log
(catch EmailException e (println (str "email failed to send on approved problem #" id))))
View
12 src/foreclojure/ring.clj
@@ -5,6 +5,7 @@
[cheshire.core :as json])
(:import [java.net URL])
(:use [compojure.core :only [GET routes]]
+ [hiccup.core :only [html]]
[foreclojure.version-utils :only [strip-version-number]]
[foreclojure.ring-utils :only [get-host]]
[useful.debug :only [?]]
@@ -60,6 +61,15 @@
handler (or (host-handlers host) default)]
(handler request)))))
+(def render-404
+ (html
+ [:head
+ [:title "4clojure: Page not found"]]
+ [:body
+ [:div {:style "margin-left: auto; margin-right: auto; width: 300px;"}
+ [:p {:style "text-align: center; width: 100%; margin-top: 45px; font-family: helvetica; color: gray; font-size: 25px;"} "404 — Page not found."]
+ [:img {:style "margin-left: 18px;" :src "/images/4clj-gus-confused-small.png"}]]]))
+
(defn wrap-404 [handler]
(routes handler
- (route/not-found "Page not found")))
+ (route/not-found render-404)))
View
5 src/foreclojure/users.clj
@@ -294,7 +294,10 @@
(defroutes users-routes
(GET "/users" [] (top-users-page))
(GET "/users/all" [] (all-users-page))
- (GET "/user/:username" [username] (user-profile username))
+ (GET "/user/:username" [username]
+ (if (nil? (get-user username))
+ {:status 404 :headers {"Content-Type" "text/plain"} :body "Error: This user does not exist, nice try though."}
+ (user-profile username)))
(POST "/user/follow/:username" [username] (static-follow-user username true))
(POST "/user/unfollow/:username" [username] (static-follow-user username false))
(POST "/rest/user/follow/:username" [username] (rest-follow-user username true))

0 comments on commit 51b6103

Please sign in to comment.
Something went wrong with that request. Please try again.