web: highlight whatever is in the url hash, i.e. transactions

This commit is contained in:
Thomas R. Koll 2015-12-18 09:21:14 +01:00
parent 8a725e7e61
commit b6c3ba1caf
3 changed files with 31 additions and 20 deletions

View File

@ -60,25 +60,26 @@ journalTransactionsReportAsHtml _ vd (_,items) = [hamlet|
-- .#{datetransition}
itemAsHtml :: ViewData -> (Int, Bool, Bool, Bool, TransactionsReportItem) -> HtmlUrl AppRoute
itemAsHtml VD{..} (n, _, _, _, (torig, _, split, _, amt, _)) = [hamlet|
<tr ##{tindex torig} .item.#{evenodd}.#{firstposting} style="vertical-align:top;" title="#{show torig}">
<td.date>#{date}
<td.description colspan=2>#{elideRight 60 desc}
<td.amount style="text-align:right;">
$if showamt
\#{mixedAmountAsHtml amt}
$forall p' <- tpostings torig
<tr .item.#{evenodd}.posting title="#{show torig}">
<td.date>
<td.description>
<td.account>
&nbsp;
<a href="@?{acctlink (paccount p')}##{tindex torig}" title="#{paccount p'}">#{elideAccountName 40 $ paccount p'}
<td.amount style="text-align:right;">#{mixedAmountAsHtml $ pamount p'}
<tr.#{evenodd}>
<td>&nbsp;
<td>
<td>
<td>
<tbody ##{tindex torig}>
<tr .item.#{evenodd}.#{firstposting} style="vertical-align:top;" title="#{show torig}">
<td.date>#{date}
<td.description colspan=2>#{elideRight 60 desc}
<td.amount style="text-align:right;">
$if showamt
\#{mixedAmountAsHtml amt}
$forall p' <- tpostings torig
<tr .item.#{evenodd}.posting title="#{show torig}">
<td.date>
<td.description>
<td.account>
&nbsp;
<a href="@?{acctlink (paccount p')}##{tindex torig}" title="#{paccount p'}">#{elideAccountName 40 $ paccount p'}
<td.amount style="text-align:right;">#{mixedAmountAsHtml $ pamount p'}
<tr.#{evenodd}>
<td>&nbsp;
<td>
<td>
<td>
|]
where
acctlink a = (RegisterR, [("q", pack $ accountQuery a)])

View File

@ -25,6 +25,9 @@ a:link, a:visited { color:#00e; }
#editform textarea { background-color:#eee; }
.negative { color:#800; }
.help { }
.highlighted {
background-color: #F4F466 !important;
}
#sidebar .hoverlinks { visibility:hidden; }
/* #sidebar .mouseover { background-color:rgba(208,208,208,0.5); } */
@ -119,7 +122,9 @@ body { margin:0; }
.description { padding-left:1em; white-space:normal; }
.account { padding-left:1em; white-space:normal; }
.amount { padding-left:1em; white-space:nowrap; }
.balance { padding-left:1em; padding-right:0.3em; white-space:nowrap; }
.balance { padding-left:1em; white-space:nowrap; }
tr td:last-child { padding-right:0.3em; }
tr td:first-child { padding-left:0.3em; }
.amount, .balance { width:2em; } /* minimise width */
.positive { }

View File

@ -26,6 +26,11 @@ $(document).ready(function() {
$('body, #addform input, #addform select').bind('keydown', 'ctrl+-', addformDeletePosting);
$('#addform tr.posting:last > td:first input').bind('keydown', 'tab', addformAddPostingWithTab);
// highlight the entry from the url hash
if (window.location.hash && $(window.location.hash)[0]) {
$(window.location.hash).addClass('highlighted');
}
});
//----------------------------------------------------------------------