mirror of
https://github.com/simonmichael/hledger.git
synced 2024-12-28 21:02:04 +03:00
web: alternate background color per transaction, not posting, on register view
(doesn't yet work for successive identical transactions)
This commit is contained in:
parent
9fac61eb0d
commit
2320a1610b
@ -6,5 +6,5 @@
|
||||
<th.amount align=right>Amount
|
||||
<th.balance align=right>#{balancelabel}
|
||||
|
||||
$forall i <- numbered items
|
||||
$forall i <- numberTransactions items
|
||||
^{itemAsHtml vd i}
|
||||
|
@ -445,3 +445,13 @@ getMessageOr mnewmsg = do
|
||||
return $ maybe oldmsg (Just . toHtml) mnewmsg
|
||||
|
||||
numbered = zip [1..]
|
||||
|
||||
-- Add incrementing transaction numbers to a list of register report items starting at 1.
|
||||
numberTransactions :: [RegisterReportItem] -> [(Int,RegisterReportItem)]
|
||||
numberTransactions [] = []
|
||||
numberTransactions is = number 0 is
|
||||
where
|
||||
number _ [] = []
|
||||
number n (i@(Just _, _, _):is) = (n+1,i):(number (n+1) is)
|
||||
number n (i@(Nothing, _, _):is) = (n,i):(number n is)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user