[nix function arg to template handlers. I guess we should really be using a list of attributes, if anything. thomashartman1@gmail.com**20080619032538] hunk ./src/Controller.hs 28 -loginSPs = [methodSP GET $ withBaseTemplate "login" id +loginSPs = [methodSP GET $ withBaseTemplate "login" {-id-} hunk ./src/Controller.hs 48 -templateservedir d f = dir d [ templateserve f] -templateserve f = ServerPartT $ \rq -> case rqPaths rq of - [tmpl] -> withBaseTemplateW tmpl f +templateservedir d {-f-} = dir d [ templateserve {-f-}] +templateserve {-f-} = ServerPartT $ \rq -> case rqPaths rq of + [tmpl] -> withBaseTemplateW tmpl {-f-} hunk ./src/Controller.hs 56 -tutorial = [ dir "tutorial" [templateserve id] +tutorial = [ dir "tutorial" [templateserve {-id-}] hunk ./src/View.hs 37 -withBaseTemplate contentTmpl f = ( anyRequest ) ( withBaseTemplateW contentTmpl f ) +withBaseTemplate contentTmpl {-f-} = ( anyRequest ) ( withBaseTemplateW contentTmpl {-f-} ) hunk ./src/View.hs 40 -withBaseTemplateW contentTmpl f = ioMsgToWeb $ do +withBaseTemplateW contentTmpl {-f-} = ioMsgToWeb $ do hunk ./src/View.hs 46 +{- +withBaseContentW content f = ioMsgToWeb $ do + tmpls <- getTemplates + bt <- (return . getStringTemplateDef "base") tmpls + -- content <- (return . toString . getStringTemplateDef contentTmpl) tmpls + ( return . (setAttribute "contentarea" content) ) bt +-} + hunk ./templates/basic-url-handling.st 5 -
  • read the source code of the "impl" function in Main.hs to see how urls are handled in HApps
  • +
  • read the source code of the "impl" function in Main.hs to see how urls are handled in HApps