[adding functionality to view user profiles thomashartman1@gmail.com**20080913083736] move ./templates/view-all-users.st ./templates/users.st hunk ./src/Controller.hs 43 + , exactdir "/tutorial/users" viewAllUsers hunk ./src/Controller.hs 45 - exactdir "/view-all-users" [ viewAllUsers ] - , lastPathPartSp (\rq tmpl -> ( tutlayoutReq rq []) tmpl ) -- tutlayoutSp [] + lastPathPartSp (\rq tmpl -> ( tutlayoutReq rq []) tmpl ) -- tutlayoutSp [] hunk ./src/Controller.hs 54 + where -- A handler that renders a template with the template name specified in the argument + tutlayoutSp1 attrs tmpl = withRequest $ \rq -> ( tutlayoutReq rq attrs ) tmpl hunk ./src/Controller.hs 57 -viewAllUsers = do - users <- anyRequest $ query ListUsers - tutlayoutSp1 [("userList", (paint users))] "view-all-users" - where paint xs = intercalate "

" xs hunk ./src/Controller.hs 58 --- A handler that renders a template with the template name specified in the argument -tutlayoutSp1 attrs tmpl = withRequest $ \rq -> ( tutlayoutReq rq attrs ) tmpl +viewAllUsers = [ ServerPartT $ \rq -> do + users <- query ListUsers + url <- return . rqURL $ rq + tutlayoutReq rq [("userList", (paint url users) )] "users" + ] + where paint url users = intercalate "

" . map (paintUser url) $ users + paintUser url user = "" ++ user ++ "" hunk ./src/Controller.hs 66 + + +{- hunk ./src/Controller.hs 75 +-} hunk ./src/View.hs 82 - , "view-all-users" + , "users" + hunk ./templates/menubar.st 11 - |view all users + |tutorial users hunk ./templates/users.st 1 -Users: $ userList $ +Users:

+ +$ userList $ hunk ./todo 5 + + hunk ./todo 26 + link to this?http://gilesbowkett.blogspot.com/2007/05/sql-unnecessary-in-haskells-happs.html +