about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorVincent Ambo <v.ambo@me.com>2012-03-18T22·47+0100
committerVincent Ambo <v.ambo@me.com>2012-03-18T22·47+0100
commit515660fa7deeeb6753768378e0cfa38a4616e03a (patch)
treebea09c2dbbb4611f53803e33bbc13aad9f6dce22 /src
parentb7e34eba74918c04ab247ba7d761ddc3e6c46321 (diff)
* fixed 404 page
Diffstat (limited to 'src')
-rw-r--r--src/Blog.hs7
-rw-r--r--src/Locales.hs9
-rw-r--r--src/Main.hs2
3 files changed, 17 insertions, 1 deletions
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