summaryrefslogtreecommitdiff
path: root/src/Settlr/Views/ErrorNotFound.hs
diff options
context:
space:
mode:
authorHannes Schulze <contact@haschu.me>2026-10-03 22:52:15 +0200
committerHannes Schulze <contact@haschu.me>2026-10-03 22:52:15 +0200
commit0bffdaf882a9ecdae7887ac59223ed489c96dc64 (patch)
tree53c9393820018f55c76fbf54aa56803dbeb65ab7 /src/Settlr/Views/ErrorNotFound.hs
parent0d43caf82404abc610a56520bfe7ef15559ce2c5 (diff)
routing
Diffstat (limited to 'src/Settlr/Views/ErrorNotFound.hs')
-rw-r--r--src/Settlr/Views/ErrorNotFound.hs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/Settlr/Views/ErrorNotFound.hs b/src/Settlr/Views/ErrorNotFound.hs
new file mode 100644
index 0000000..d087c5e
--- /dev/null
+++ b/src/Settlr/Views/ErrorNotFound.hs
@@ -0,0 +1,24 @@
+{-# LANGUAGE OverloadedStrings #-}
+
+module Settlr.Views.ErrorNotFound
+ ( viewErrorNotFound
+ ) where
+
+import Settlr.Config (ScriptM)
+import Text.Blaze.Html5 (Html, (!), textValue)
+import qualified Text.Blaze.Html5 as H
+import qualified Text.Blaze.Html5.Attributes as A
+import Settlr.Routes (Route(..), formatRoute)
+import Network.CGI (setStatus)
+
+viewErrorNotFound :: ScriptM Html
+viewErrorNotFound = do setStatus 404 "Not Found"
+ homePath <- formatRoute RouteHome
+ pure $ H.docTypeHtml $ do
+ H.head $ do
+ H.title "Not Found"
+ H.meta ! A.charset "utf-8"
+ H.body $ do
+ H.h1 "Page Not Found"
+ H.p "The requested page could not be found"
+ H.a "Go back home" ! A.href (textValue homePath)