mirror of
https://github.com/simonmichael/hledger.git
synced 2024-12-26 20:02:27 +03:00
web: highlight whatever is in the url hash, i.e. transactions
This commit is contained in:
parent
8a725e7e61
commit
b6c3ba1caf
@ -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>
|
||||
|
||||
<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>
|
||||
<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>
|
||||
|
||||
<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>
|
||||
<td>
|
||||
<td>
|
||||
<td>
|
||||
|]
|
||||
where
|
||||
acctlink a = (RegisterR, [("q", pack $ accountQuery a)])
|
||||
|
@ -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 { }
|
||||
|
||||
|
@ -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');
|
||||
}
|
||||
});
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user