From b462eea9dea4fe17f20179049473a3451baa61d1 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Tue, 6 Jul 2010 20:12:55 +0000 Subject: [PATCH] webyesod: rename "transactions" page to "journal" --- Hledger/Cli/Commands/Web.hs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Hledger/Cli/Commands/Web.hs b/Hledger/Cli/Commands/Web.hs index 51a9ecdd7..e76c1e76b 100644 --- a/Hledger/Cli/Commands/Web.hs +++ b/Hledger/Cli/Commands/Web.hs @@ -78,13 +78,13 @@ instance Yesod HledgerWebApp where approot = appRoot mkYesod "HledgerWebApp" [$parseRoutes| / IndexPage GET /style.css StyleCss GET -/transactions TransactionsPage GET POST +/journal JournalPage GET POST /register RegisterPage GET /balance BalancePage GET |] getIndexPage :: Handler HledgerWebApp () -getIndexPage = redirect RedirectTemporary TransactionsPage +getIndexPage = redirect RedirectTemporary JournalPage getStyleCss :: Handler HledgerWebApp () getStyleCss = do @@ -94,8 +94,8 @@ getStyleCss = do header "Content-Type" "text/css" return $ RepPlain $ toContent s -getTransactionsPage :: Handler HledgerWebApp RepHtml -getTransactionsPage = withLatestJournalRender (const showTransactions) +getJournalPage :: Handler HledgerWebApp RepHtml +getJournalPage = withLatestJournalRender (const showTransactions) getRegisterPage :: Handler HledgerWebApp RepHtml getRegisterPage = withLatestJournalRender showRegisterReport @@ -143,7 +143,7 @@ template here msg a p title content = [$hamlet| |] where m = fromMaybe (string "") msg navbar' = navbar here a p - addform' | here == TransactionsPage = addform + addform' | here == JournalPage = addform | otherwise = nulltemplate stylesheet = StyleCss metacontent = "text/html; charset=utf-8" @@ -164,12 +164,12 @@ navbar here a p = [$hamlet| navlinks :: HledgerWebAppRoutes -> String -> String -> Hamlet HledgerWebAppRoutes navlinks here a p = [$hamlet| #navlinks - ^transactionslink^ | $ + ^journallink^ | $ ^registerlink^ | $ ^balancelink^ |] where - transactionslink = navlink here "transactions" TransactionsPage + journallink = navlink here "journal" JournalPage registerlink = navlink here "register" RegisterPage balancelink = navlink here "balance" BalancePage navlink here s dest = [$hamlet|%a.$style$!href=@?u@ $string.s$|] @@ -280,8 +280,8 @@ transactionfields n = [$hamlet| acctvar = numbered "accountname" amtvar = numbered "amount" -postTransactionsPage :: Handler HledgerWebApp RepPlain -postTransactionsPage = do +postJournalPage :: Handler HledgerWebApp RepPlain +postJournalPage = do today <- liftIO getCurrentDay -- get form input values, or basic validation errors. E means an Either value. dateE <- runFormPost $ catchFormError $ notEmpty $ required $ input "date" @@ -321,7 +321,7 @@ postTransactionsPage = do Left errs -> do -- save current form values in session setMessage $ string $ intercalate "; " $ map (intercalate ", " . map (\(a,b) -> a++": "++b)) errs - redirect RedirectTemporary TransactionsPage + redirect RedirectTemporary JournalPage Right t -> do let t' = txnTieKnot t -- XXX move into balanceTransaction @@ -330,5 +330,5 @@ postTransactionsPage = do -- liftIO $ putValue "hledger" "journal" j' liftIO $ journalAddTransaction j t' setMessage $ string $ printf "Added transaction:\n%s" (show t') - redirect RedirectTemporary TransactionsPage + redirect RedirectTemporary JournalPage