web: hide run-time hamlet experiments for now

This commit is contained in:
Simon Michael 2010-11-27 01:08:22 +00:00
parent d00ae908de
commit 4a7ad12271
3 changed files with 15 additions and 7 deletions

View File

@ -1,7 +1,7 @@
%script!type=text/javascript %script!type=text/javascript
$$(document).ready(function() { $$(document).ready(function() {
/* dhtmlxcombo setup */ /* dhtmlxcombo setup */
window.dhx_globalImgPath="../static/images/"; window.dhx_globalImgPath="../static/";
var desccombo = new dhtmlXCombo("description"); var desccombo = new dhtmlXCombo("description");
var acct1combo = new dhtmlXCombo("account1"); var acct1combo = new dhtmlXCombo("account1");
var acct2combo = new dhtmlXCombo("account2"); var acct2combo = new dhtmlXCombo("account2");
@ -43,3 +43,5 @@
%td!colspan=4 %td!colspan=4
%input!type=hidden!name=action!value=add %input!type=hidden!name=action!value=add
%input!type=submit!name=submit!value="add transaction" %input!type=submit!name=submit!value="add transaction"
$if manyfiles
\ to: ^journalselect.files^

View File

@ -10,7 +10,7 @@ module Hledger.Web.App
) )
where where
import Control.Applicative ((<$>), (<*>)) import Control.Applicative ((<$>), (<*>))
import Control.Failure -- import Control.Failure
-- import qualified Data.ByteString.Lazy as L -- import qualified Data.ByteString.Lazy as L
import Data.Either import Data.Either
-- import System.Directory -- import System.Directory
@ -24,8 +24,8 @@ import Yesod.Helpers.Static
-- import Yesod.Helpers.Auth -- import Yesod.Helpers.Auth
-- import Yesod.Mail -- import Yesod.Mail
-- import Yesod.WebRoutes -- import Yesod.WebRoutes
import Text.Hamlet (defaultHamletSettings) -- import Text.Hamlet (defaultHamletSettings)
import Text.Hamlet.RT -- import Text.Hamlet.RT
import Hledger.Cli.Add (appendToJournalFile) import Hledger.Cli.Add (appendToJournalFile)
import Hledger.Cli.Balance import Hledger.Cli.Balance
@ -101,8 +101,8 @@ mkYesod "App" [$parseRoutes|
/accounts AccountsOnlyR GET /accounts AccountsOnlyR GET
/journal JournalR GET POST /journal JournalR GET POST
/register RegisterR GET POST /register RegisterR GET POST
/addformrt AddformRTR GET
|] |]
-- /addformrt AddformRTR GET
type Handler = GHandler App App type Handler = GHandler App App
@ -429,6 +429,8 @@ helplink :: String -> String -> Hamlet AppRoute
helplink topic label = [$hamlet|%a!href=$u$!target=hledgerhelp $label$|] helplink topic label = [$hamlet|%a!href=$u$!target=hledgerhelp $label$|]
where u = manualurl ++ if null topic then "" else '#':topic where u = manualurl ++ if null topic then "" else '#':topic
{-
-- | Render a runtime template with the provided runtime data as html. -- | Render a runtime template with the provided runtime data as html.
renderHamletFileRT :: FilePath -> HamletMap AppRoute -> Handler Html renderHamletFileRT :: FilePath -> HamletMap AppRoute -> Handler Html
renderHamletFileRT hfile hmap = do renderHamletFileRT hfile hmap = do
@ -472,6 +474,8 @@ hdstringlist ss = HDList [ [([], hdstring s)] | s <- ss ]
-- hamletToHamletRT :: Failure HamletException m => Hamlet AppRoute -> m HamletRT -- hamletToHamletRT :: Failure HamletException m => Hamlet AppRoute -> m HamletRT
-- hamletToHamletRT h = stringToHamletRT $ show $ unsafeByteString $ renderHamlet show h -- hamletToHamletRT h = stringToHamletRT $ show $ unsafeByteString $ renderHamlet show h
-}
---------------------------------------------------------------------- ----------------------------------------------------------------------
-- handlers/views -- handlers/views
---------------------------------------------------------------------- ----------------------------------------------------------------------
@ -1029,7 +1033,7 @@ mixedAmountAsHtml b = preEscapedString $ addclass $ intercalate "<br>" $ lines $
-- hamletToRepHtml $ pageLayout td $ editform td s -- hamletToRepHtml $ pageLayout td $ editform td s
---------------------------------------------------------------------- ----------------------------------------------------------------------
{-
-- | An add form with template files reloaded at runtime. -- | An add form with template files reloaded at runtime.
getAddformRTR :: Handler RepHtml getAddformRTR :: Handler RepHtml
getAddformRTR = do getAddformRTR = do
@ -1076,6 +1080,8 @@ getAddformRTR = do
,(["deschelp"], hdstring "eg: supermarket (optional)") ,(["deschelp"], hdstring "eg: supermarket (optional)")
,(["postingfields1"], HDHtml pfields1) ,(["postingfields1"], HDHtml pfields1)
,(["postingfields2"], HDHtml pfields2) ,(["postingfields2"], HDHtml pfields2)
,(["manyfiles"], HDBool $ (length $ files $ j) > 1)
-- ,(["files"], ... $ files $ j)
] :: HamletMap AppRoute) ] :: HamletMap AppRoute)
hamletToRepHtml $ pageLayout td $ htmlAsHamlet addform hamletToRepHtml $ pageLayout td $ htmlAsHamlet addform
-}