about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--TODO2
-rw-r--r--res/blogstyle.css10
-rw-r--r--src/Blog.hs7
-rw-r--r--src/Locales.hs9
-rw-r--r--src/Main.hs2
5 files changed, 27 insertions, 3 deletions
diff --git a/TODO b/TODO
index b2b76bbbb82c..fdb963dd790a 100644
--- a/TODO
+++ b/TODO
@@ -1,3 +1 @@
-* handle BlogErrors
-* add readMore link
 * Bootstrap: http://twitter.github.com/bootstrap/index.html
diff --git a/res/blogstyle.css b/res/blogstyle.css
index d8e878b0126a..37cf90c10af5 100644
--- a/res/blogstyle.css
+++ b/res/blogstyle.css
@@ -118,6 +118,16 @@ body {
 	padding-left: 20px
 }
 
+.notFoundFace {
+	text-align: center;
+	font-size: 100px;
+}
+
+.notFoundText {
+	text-align: center;
+	font-size: 24px;
+	font-weight: bold;
+}
 
 label span {
     width: 6%;
diff --git a/src/Blog.hs b/src/Blog.hs
index 5914052f932e..d6b806985ed6 100644
--- a/src/Blog.hs
+++ b/src/Blog.hs
@@ -237,4 +237,9 @@ editPage (Entry{..}) = adminTemplate "Index" $
 
 -- Error pages
 showError :: BlogError -> BlogLang -> Html
-showError NotFound l = undefined
+showError NotFound l = blogTemplate l (T.append ": " $ notFound l) $ 
+  H.div ! A.class_ "innerBox" $ do
+    H.div ! A.class_ "innerBoxTop" $ toHtml $ notFound l
+    H.div ! A.class_ "innerBoxMiddle" $ do
+        H.p ! A.class_ "notFoundFace" $ toHtml (":'(" :: Text)
+        H.p ! A.class_ "notFoundText" $ toHtml $ notFoundText l
diff --git a/src/Locales.hs b/src/Locales.hs
index 9330fd81fb9b..c1dc02453c12 100644
--- a/src/Locales.hs
+++ b/src/Locales.hs
@@ -115,6 +115,15 @@ cSend :: BlogLang -> Text
 cSend DE = "Absenden"
 cSend EN = "Submit"
 
+-- errors
+notFound :: BlogLang -> Text
+notFound DE = "Nicht gefunden"
+notFound EN = "Not found"
+
+notFoundText :: BlogLang -> Text
+notFoundText DE = "Das gewünschte Objekt wurde leider nicht gefunden."
+notFoundText EN = "The requested object could unfortunately not be found."
+
 -- right side text (this is inserted AS IS. Escape HTML!)
 rightText :: BlogLang -> Text
 rightText DE = "English version <a href=\"/en\" style=\"color: black;\">available here</a>."
diff --git a/src/Main.hs b/src/Main.hs
index 84fa0d9dd326..f12c74349414 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -74,6 +74,7 @@ tazBlog acid =
          , dir "admin" $ ok $ toResponse $ adminLogin 
          , dir "dologin" $ processLogin acid
          , serveDirectory DisableBrowsing [] "../res"
+         , ok $ toResponse $ showError NotFound DE
          ]
 
 blogHandler :: AcidState Blog -> BlogLang -> ServerPart Response
@@ -84,6 +85,7 @@ blogHandler acid lang =
                 \(eId :: Integer) -> addComment acid lang $ EntryId eId
          , do nullDir
               showIndex acid lang
+         , ok $ toResponse $ showError NotFound lang
          ]
 
 formatOldLink :: Int -> Int -> String -> ServerPart Response