web: show a proper not found page on 404

This commit is contained in:
Simon Michael 2016-05-06 19:30:23 -07:00
parent aac67b3d4d
commit 1b674cbb44

View File

@ -235,17 +235,19 @@ viewdataWithDateAndParams d q a p =
-- | Gather data used by handlers and templates in the current request.
getViewData :: Handler ViewData
getViewData = do
mhere <- getCurrentRoute
case mhere of
Nothing -> return nullviewdata
Just here -> do
app <- getYesod
let opts@WebOpts{cliopts_=copts@CliOpts{reportopts_=ropts}} = appOpts app
today <- liftIO getCurrentDay
(j, merr) <- getCurrentJournal app copts{reportopts_=ropts{no_elide_=True}} today
lastmsg <- getLastMessage
let msg = maybe lastmsg (Just . toHtml) merr
Just here <- getCurrentRoute
q <- getParameterOrNull "q"
a <- getParameterOrNull "a"
p <- getParameterOrNull "p"
-- sidebar visibility: show it, unless there is a showsidebar cookie
-- set to "0", or a ?sidebar=0 query parameter.
msidebarparam <- lookupGetParam "sidebar"