[viewjob page works pretty well, using dummy data thomashartman1@gmail.com**20080922155201] hunk ./src/AppStateSetBased.hs 143 -tphyahooJobs = map (\(j,b)-> Job { jobname = j, jobbudget = b, jobblurb ="" } ) $ +tphyahooJobs = map (\(j,b)-> Job { jobname = j, jobbudget = b, jobblurb ="make " ++ j ++ " using HAppS "} ) $ hunk ./src/Controller.hs 59 + , dir "viewjob" [ methodSP GET . viewJob $ rglobs ] hunk ./src/ControllerGetActions.hs 11 +import Data.List +import qualified Data.Set as S + +import Misc hunk ./src/ControllerGetActions.hs 26 ---jobsDummyData = [] - hunk ./src/ControllerGetActions.hs 31 - [ simpleLink (templates rglobs) ("/tutorial/viewjob?job=" ++ j,j) + [ simpleLink (templates rglobs) ("/tutorial/viewjob?user="++postedBy++"&job=" ++ j,j) hunk ./src/ControllerGetActions.hs 58 +data ViewJobData = ViewJobData String String +instance FromData ViewJobData where + fromData = liftM2 ViewJobData (look "user") + (look "job") + +viewJob rglobs = + withData $ \(ViewJobData pBy jN) -> + [ ServerPartT $ \rq -> do + let mbJ = do u <- find ( (==pBy) . username) . S.toList $ datastoreDummyData + jobs <- jobs u + find ( (==jN) . jobname) $ jobs + lay (Job jN jBud jBlu) = tutlayoutU rglobs [("jobname",jN),("budget",jBud),("jobblurb",jBlu)] "viewjob" + + return $ maybe ( tutlayoutU rglobs [("errmsg", "no job found")] "errortemplate") + lay + mbJ + ] + hunk ./src/ControllerGetActions.hs 84 + + -- use better dummy data!! hunk ./src/ControllerGetActions.hs 89 - tutlay rq u = ( tutlayoutU rglobs [("username",username u) {- , ("jobsPosted",jobsPosted) -} ] ) template + tutlay u = ( tutlayoutU rglobs [("username",username u) {- , ("jobsPosted",jobsPosted) -} ] ) template hunk ./src/ControllerGetActions.hs 94 - ( tutlay rq ) + tutlay hunk ./templates/simplelink.st 1 -$anchortext$ +$anchortext$ addfile ./templates/viewjob.st hunk ./templates/viewjob.st 1 - +

$jobname$

+

+