diff --git a/hledger-web/.hledger/web/static/hledger.js b/hledger-web/.hledger/web/static/hledger.js index da5f1394e..febc5cdec 100644 --- a/hledger-web/.hledger/web/static/hledger.js +++ b/hledger-web/.hledger/web/static/hledger.js @@ -7,8 +7,20 @@ $(document).ready(function() { if ($.url.param('add')) addformToggle(); else if ($.url.param('edit')) editformToggle(); + /* set up hover handlers for sidebar account links */ + $('.balancereport .account a').hover(displayMouseOver,hideMouseOver); }); +/* Display this element's *mouseover sibling */ +function displayMouseOver(ev) { + $(getTarget(ev)).next().style.display = 'block'; +} + +/* Display this element's *mouseover sibling */ +function hideMouseOver(ev) { + $(getTarget(ev)).next().style.display = 'none'; +} + function searchformToggle() { var a = document.getElementById('addform'); var e = document.getElementById('editform'); diff --git a/hledger-web/.hledger/web/static/style.css b/hledger-web/.hledger/web/static/style.css index 97d552dd6..e8a320abd 100644 --- a/hledger-web/.hledger/web/static/style.css +++ b/hledger-web/.hledger/web/static/style.css @@ -25,6 +25,7 @@ body { backgroun .balancereport .inacct { background-color:#eee; font-weight:bold; } .notinacct, .notinacct :link, .notinacct :visited, .notinacct .negative { /*color:#aaa;*/ } .balancereport .numpostings { padding-left:1em; color:#aaa; } +.balancereport .accountmouseover { background-color:rgba(0,0,138,0.5); display:none; position:relative; } /*------------------------------------------------------------------------------------------*/ /* 2. font families & sizes */ diff --git a/hledger-web/.hledger/web/templates/balancereportitem.hamlet b/hledger-web/.hledger/web/templates/balancereportitem.hamlet index 968d22400..9753bd2e0 100644 --- a/hledger-web/.hledger/web/templates/balancereportitem.hamlet +++ b/hledger-web/.hledger/web/templates/balancereportitem.hamlet @@ -2,5 +2,9 @@ #{adisplay} + subs + only + #{mixedAmountAsHtml abal} (#{numpostingsinacct acct}) diff --git a/hledger-web/Handlers.hs b/hledger-web/Handlers.hs index e07ec0c6e..603c2f9dc 100644 --- a/hledger-web/Handlers.hs +++ b/hledger-web/Handlers.hs @@ -122,6 +122,12 @@ getAccountsJsonR = do accountUrl :: String -> String accountUrl a = "inacct:" ++ quoteIfSpaced a -- (accountNameToAccountRegex a) +accountsUrl :: String -> String +accountsUrl a = "inaccts:" ++ quoteIfSpaced a -- (accountNameToAccountRegex a) + +accountsOnlyUrl :: String -> String +accountsOnlyUrl a = "inacctsonly:" ++ quoteIfSpaced a -- (accountNameToAccountRegex a) + -- | Render a balance report as HTML. balanceReportAsHtml :: [Opt] -> ViewData -> BalanceReport -> Hamlet AppRoute balanceReportAsHtml _ vd@VD{here=here,q=q,m=m,qopts=qopts,j=j} (items,total) = $(Settings.hamletFile "balancereport") @@ -139,6 +145,8 @@ balanceReportAsHtml _ vd@VD{here=here,q=q,m=m,qopts=qopts,j=j} (items,total) = $ Nothing -> "" :: String indent = preEscapedString $ concat $ replicate (2 * aindent) " " accturl = (here, [("q", pack $ accountUrl acct)]) + acctsurl = (here, [("q", pack $ accountsUrl acct)]) + acctsonlyurl = (here, [("q", pack $ accountsOnlyUrl acct)]) -- | Render a journal report as HTML. journalReportAsHtml :: [Opt] -> ViewData -> JournalReport -> Hamlet AppRoute