[working on using-templates thomashartman1@gmail.com**20080623223403] hunk ./src/Controller.hs 15 +import ControllerUsingTemplates hunk ./src/Controller.hs 22 - tutorial ++ loginHandlers ++ simpleHandlers ++ staticfiles + tutorial ++ loginHandlers ++ simpleHandlers ++ usingTemplatesHandlers ++ staticfiles addfile ./src/ControllerUsingTemplates.hs hunk ./src/ControllerUsingTemplates.hs 1 +{-# OPTIONS -XPatternSignatures #-} +module ControllerUsingTemplates where + +import HAppS.Server +import Misc +import Data.Monoid + +import View +import Text.StringTemplate + +usingTemplatesHandlers :: [ServerPartT IO Response] +usingTemplatesHandlers = debugFilter [ + dir "usingtemplates" + [ exactdir "/testtgio" [withTemplate "myhomepage" $ setManyAttrib [("favoriteAnimal", "giraffe")] ] + ] + ] + hunk ./src/View.hs 49 - {- - tmpls <- getTemplates - bt <- (return . getStringTemplateDef "base") tmpls - ( return . (setAttribute "contentarea" content) ) bt - -} hunk ./src/View.hs 55 -h1 = exactdir "/testtgio" [withTemplate "myhomepage" (setAttribute "favoriteAnimal" "giraffe") ] + + + hunk ./templates/using-templates.st 1 - +