[working on table pagination, notes on windows install, table header thomashartman1@gmail.com**20080919101354] hunk ./src/Controller.hs 45 + --, exactdir "/tutorial/jobs" viewJobs + + --,pathPartsSp ["tutorial","jobs"] $ withData viewJobs hunk ./src/Controller.hs 50 - lastPathPartSp (\rq tmpl -> ( tutlayoutReq rq []) tmpl ) -- tutlayoutSp [] + lastPathPartSp0 (\rq tmpl -> ( tutlayoutReq rq []) tmpl ) hunk ./src/Controller.hs 75 -viewJobs = [ ServerPartT $ \rq -> do +viewJobs {- (TablePagination currpage resperpage) -} = + [ ServerPartT $ \rq -> do hunk ./src/Controller.hs 88 + ++ map (\num -> ( ("job" ++ (show num)), Just "$0") ) [1..2000] hunk ./src/Controller.hs 90 - jobTable = paintTable jobCells + jobTable = paintTable (Just ["project","budget"]) jobCells + lift . putStrLn . show . rqInputs $ rq hunk ./src/Controller.hs 95 + hunk ./src/Controller.hs 137 - basedomain <- return . (\(h,p) -> "http://" ++ h ++ (if p==80 then "" else ":" ++ (show p))) . rqPeer $ rq + + + -- THIS BREAKS ONLINE. AND DOESN'T EVEN FIX LOCAL! FIX ME. + let basedomain = "http://localhost:5001" + + --basedomain <- return . (\(h,p) -> "http://" ++ h ++ (if p==80 then "" else ":" ++ (show p))) . rqPeer $ rq hunk ./src/Misc.hs 88 - + +pathPartsSp pps f = ServerPartT $ \rq -> + if rqPaths rq == pps + then f rq + else noHandle hunk ./src/Misc.hs 96 -lastPathPartSp f = ServerPartT $ \rq -> +lastPathPartSp0 f = ServerPartT $ \rq -> hunk ./src/Misc.hs 101 +{- hunk ./src/Misc.hs 106 +-} hunk ./src/Model.hs 16 -data ChangeUserInfo = ChangeUserInfo String String String + hunk ./src/Model.hs 27 +data ChangeUserInfo = ChangeUserInfo String String String hunk ./src/Model.hs 29 - fromData = liftM3 ChangeUserInfo (look "oldpass" `mplus` return "no old password") + fromData = liftM3 ChangeUserInfo ( (look "oldpass") `mplus` (return "no old password") ) hunk ./src/Model.hs 33 + +data TablePagination = TablePagination { currentPage ::Int, + resultsPerPage :: Int } +instance FromData TablePagination where + fromData = liftM2 TablePagination ( return . read =<< look "pagp" `mplus` return "1" ) + ( return . read =<< look "rsperpage" `mplus` return "10" ) + + hunk ./src/View.hs 84 -paintTable :: [[String]] -> String -paintTable cells = table . concat . map (tr . concat) . ( (map . map) td ) $ cells +paintTable :: Maybe [String] -> [[String]] -> String +paintTable mbHeaderCells tablecells = table trows + where trows = maybe rows ( (++rows) . paintHeaderTr) mbHeaderCells + rows = paintTrs $ tablecells + hunk ./src/View.hs 90 +paintHeaderTr hc = tr . concat . (map (td {-. biggerfont -} ) ) $ hc +paintTrs cells = concat . map (tr . concat) . ( (map . map) td ) $ cells + +biggerfont x = "" ++ x ++ "" hunk ./templates/menubar.st 17 - $! td is for alignment only !$ - $ userMenu $ + $! td is for alignment only, an ugly hack, and it renders bad if you resize the window. + how can I do this better? !$ + $ userMenu $ hunk ./templates/menubar.st 23 + +$! + + + + + +
div 1
div 2
+!$ + + hunk ./templates/prerequisites.st 8 -
  • A modern operating system. You should be able to develop haskell applications using windows, mac, or linux. For the record, I work with the latest ubuntu linux distribution, which is currently hardy heron.
  • +
  • A modern operating system. You should be able to develop HAppS applications using windows, mac, or linux. + + hunk ./todo 3 + Link to happs mailing list thread about windows install in prerequisites.st "see here". + + fix basedomain issue in Controller.hs + hunk ./todo 11 + requires table output. can ST play nicely with html tables? If it can't, may have to think seriously about + abandoning ST for hunk ./todo 43 + user menu/login box in header should right align without ugly td spacer that breaks when you resize windows. +