matebeamter/src/View/Scaffold.hs

33 lines
675 B
Haskell
Raw Normal View History

2019-09-08 15:27:38 +00:00
{-# LANGUAGE OverloadedStrings #-}
module View.Scaffold where
2019-09-16 07:44:46 +00:00
import Servant.Links
2019-09-08 15:27:38 +00:00
import qualified Text.Blaze.Html5 as H
import qualified Text.Blaze.Html5.Attributes as H
import qualified Data.Text as T
2019-09-16 07:44:46 +00:00
import Data.String (fromString)
2019-09-08 15:27:38 +00:00
import Data.Text.I18n
-- internal imports
import Types.Page
2019-09-16 07:44:46 +00:00
import API
2019-09-08 15:27:38 +00:00
scaffold
:: L10n
-> Locale
2019-09-11 04:27:54 +00:00
-> Page H.Html T.Text
2019-09-08 15:27:38 +00:00
-> H.Html
-> H.Html
2019-09-11 04:27:54 +00:00
scaffold l10n locale page content = template page $ do
2019-10-16 16:07:12 +00:00
H.header $ H.nav $ H.ul $
H.li $ H.a H.! H.href ("/" <> fromString (show $ linkURI userSelectLink)) $
2019-09-16 07:44:46 +00:00
H.toHtml $ localize l10n locale $ gettext "Home"
2019-09-08 15:27:38 +00:00
H.hr
2019-10-16 16:07:12 +00:00
H.div H.! H.id "main" H.! H.role "main" $
2019-09-08 15:27:38 +00:00
content