* fixed 404 page
This commit is contained in:
parent
b7e34eba74
commit
515660fa7d
5 changed files with 27 additions and 3 deletions
2
TODO
2
TODO
|
@ -1,3 +1 @@
|
||||||
* handle BlogErrors
|
|
||||||
* add readMore link
|
|
||||||
* Bootstrap: http://twitter.github.com/bootstrap/index.html
|
* Bootstrap: http://twitter.github.com/bootstrap/index.html
|
||||||
|
|
|
@ -118,6 +118,16 @@ body {
|
||||||
padding-left: 20px
|
padding-left: 20px
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.notFoundFace {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.notFoundText {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 24px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
label span {
|
label span {
|
||||||
width: 6%;
|
width: 6%;
|
||||||
|
|
|
@ -237,4 +237,9 @@ editPage (Entry{..}) = adminTemplate "Index" $
|
||||||
|
|
||||||
-- Error pages
|
-- Error pages
|
||||||
showError :: BlogError -> BlogLang -> Html
|
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
|
||||||
|
|
|
@ -115,6 +115,15 @@ cSend :: BlogLang -> Text
|
||||||
cSend DE = "Absenden"
|
cSend DE = "Absenden"
|
||||||
cSend EN = "Submit"
|
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!)
|
-- right side text (this is inserted AS IS. Escape HTML!)
|
||||||
rightText :: BlogLang -> Text
|
rightText :: BlogLang -> Text
|
||||||
rightText DE = "English version <a href=\"/en\" style=\"color: black;\">available here</a>."
|
rightText DE = "English version <a href=\"/en\" style=\"color: black;\">available here</a>."
|
||||||
|
|
|
@ -74,6 +74,7 @@ tazBlog acid =
|
||||||
, dir "admin" $ ok $ toResponse $ adminLogin
|
, dir "admin" $ ok $ toResponse $ adminLogin
|
||||||
, dir "dologin" $ processLogin acid
|
, dir "dologin" $ processLogin acid
|
||||||
, serveDirectory DisableBrowsing [] "../res"
|
, serveDirectory DisableBrowsing [] "../res"
|
||||||
|
, ok $ toResponse $ showError NotFound DE
|
||||||
]
|
]
|
||||||
|
|
||||||
blogHandler :: AcidState Blog -> BlogLang -> ServerPart Response
|
blogHandler :: AcidState Blog -> BlogLang -> ServerPart Response
|
||||||
|
@ -84,6 +85,7 @@ blogHandler acid lang =
|
||||||
\(eId :: Integer) -> addComment acid lang $ EntryId eId
|
\(eId :: Integer) -> addComment acid lang $ EntryId eId
|
||||||
, do nullDir
|
, do nullDir
|
||||||
showIndex acid lang
|
showIndex acid lang
|
||||||
|
, ok $ toResponse $ showError NotFound lang
|
||||||
]
|
]
|
||||||
|
|
||||||
formatOldLink :: Int -> Int -> String -> ServerPart Response
|
formatOldLink :: Int -> Int -> String -> ServerPart Response
|
||||||
|
|
Loading…
Add table
Reference in a new issue