{-# LANGUAGE FlexibleContexts, OverloadedStrings, RecordWildCards #-} {-# OPTIONS_GHC -F -pgmFtrhsx #-} module Theme where import Clckwrks import Clckwrks.Monad import Clckwrks.ProfileData.Acid (HasRole(..)) import Data.Maybe (fromMaybe) import qualified Data.Set as Set import Data.Text (Text, unpack) -- import Happstack.Server import HSP import Paths_clckwrks_theme_happstack (getDataDir) theme :: Theme theme = Theme { themeName = "happstack" , _themeTemplate = pageTemplate , themeBlog = blog , themeDataDir = getDataDir } pageTemplate :: ( EmbedAsChild (ClckT ClckURL (ServerPartT IO)) headers , EmbedAsChild (ClckT ClckURL (ServerPartT IO)) body ) => Text -> headers -> body -> XMLGenT (ClckT ClckURL (ServerPartT IO)) XML pageTemplate ttl hdr bdy = do pid <- XMLGenT $ getPageId case pid of (PageId 1) -> home ttl hdr bdy _ -> standardTemplate ttl hdr
<% bdy %>The relentless, uncompromised power and beauty of Haskell in a web framework.