mirror of
https://github.com/simonmichael/hledger.git
synced 2024-12-28 21:02:04 +03:00
web: begin account mouseover links
This commit is contained in:
parent
9a5e5da3aa
commit
efbea9d682
@ -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');
|
||||
|
@ -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 */
|
||||
|
@ -2,5 +2,9 @@
|
||||
<td.account.#{depthclass}
|
||||
#{indent}
|
||||
<a href="@?{accturl}">#{adisplay}
|
||||
<div.accountmouseover
|
||||
<a href="@?{acctsurl}">subs
|
||||
<a href="@?{acctsonlyurl}">only
|
||||
|
||||
<td.balance align=right>#{mixedAmountAsHtml abal}
|
||||
<td.numpostings align=right>(#{numpostingsinacct acct})
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user