web: cleanup, hide unused support files

This commit is contained in:
Simon Michael 2010-11-27 00:36:30 +00:00
parent dc915edb9a
commit d00ae908de
6 changed files with 12 additions and 10 deletions

View File

@ -42,8 +42,8 @@ import Hledger.Web.Settings (
-- , runConnectionPool -- , runConnectionPool
-- , staticroot -- , staticroot
datadir datadir
, hamletFile -- , hamletFile
, cassiusFile -- , cassiusFile
-- , juliusFile -- , juliusFile
, hledgerorgurl , hledgerorgurl
, manualurl , manualurl
@ -92,10 +92,10 @@ data App = App
-- mkYesod (template haskell from yesod) defines types for the web app based on the routes. -- mkYesod (template haskell from yesod) defines types for the web app based on the routes.
-- /auth AuthR Auth getAuth -- /auth AuthR Auth getAuth
mkYesod "App" [$parseRoutes| mkYesod "App" [$parseRoutes|
/ IndexR GET
/favicon.ico FaviconR GET /favicon.ico FaviconR GET
/robots.txt RobotsR GET /robots.txt RobotsR GET
/static StaticR Static appStatic /static StaticR Static appStatic
/ IndexR GET
/journalonly JournalOnlyR GET POST /journalonly JournalOnlyR GET POST
/registeronly RegisterOnlyR GET /registeronly RegisterOnlyR GET
/accounts AccountsOnlyR GET /accounts AccountsOnlyR GET
@ -108,12 +108,14 @@ type Handler = GHandler App App
instance Yesod App where instance Yesod App where
approot = appRoot approot = appRoot
defaultLayout widget = do
mmsg <- getMessage -- defaultLayout widget = do
pc <- widgetToPageContent $ do -- mmsg <- getMessage
widget -- pc <- widgetToPageContent $ do
addCassius $(cassiusFile "default-layout") -- widget
hamletToRepHtml $(hamletFile "default-layout") -- addCassius $(cassiusFile "default-layout")
-- hamletToRepHtml $(hamletFile "default-layout")
-- authRoute _ = Just $ AuthR LoginR -- authRoute _ = Just $ AuthR LoginR
-- static file-serving optimisations, disable for the moment -- static file-serving optimisations, disable for the moment
@ -436,7 +438,7 @@ renderHamletFileRT hfile hmap = do
-- | Read a file from the app's templates directory. -- | Read a file from the app's templates directory.
readTemplateFile :: FilePath -> Handler String readTemplateFile :: FilePath -> Handler String
readTemplateFile hfile = do readTemplateFile hfile = do
dir <- ((</> "templates") . appDataDir) `fmap` getYesod dir <- appDataDir `fmap` getYesod
liftIO $ readFile $ dir </> hfile liftIO $ readFile $ dir </> hfile
-- what to do if rendering a runtime template fails. -- what to do if rendering a runtime template fails.