ui/web: -E toggles zeroes at startup, with opposite default to cli

This commit is contained in:
Simon Michael 2018-03-29 22:35:06 +01:00
parent dc4def835c
commit 178e3a234b
12 changed files with 28 additions and 25 deletions

View File

@ -147,7 +147,7 @@ m4_define({{_reportingoptions_}}, {{
: hide/aggregate accounts or postings more than NUM levels deep
`-E --empty`
: show items with zero amount, normally hidden (except in hledger-ui/hledger-web)
: show items with zero amount, normally hidden (and vice-versa in hledger-ui/hledger-web)
`-B --cost`
: convert amounts to their cost at transaction time

View File

@ -108,8 +108,8 @@ runBrickUi uopts@UIOpts{cliopts_=copts@CliOpts{reportopts_=ropts}} j = do
[v | (k,v) <- rawopts_ copts, k=="args", not $ any (`isPrefixOf` v) ["depth","date"]],
-- always disable boring account name eliding, unlike the CLI, for a more regular tree
no_elide_=True,
-- show items with zero amount by default, unlike the CLI
empty_=True,
-- flip the default for items with zero amounts, show them by default
empty_=not $ empty_ ropts,
-- show historical balances by default, unlike the CLI
balancetype_=HistoricalBalance
}

View File

@ -172,7 +172,7 @@ hide/aggregate accounts or postings more than NUM levels deep
.RE
.TP
.B \f[C]\-E\ \-\-empty\f[]
show items with zero amount, normally hidden (except in
show items with zero amount, normally hidden (and vice\-versa in
hledger\-ui/hledger\-web)
.RS
.RE

View File

@ -122,7 +122,7 @@ the data.
hide/aggregate accounts or postings more than NUM levels deep
'-E --empty'
show items with zero amount, normally hidden (except in
show items with zero amount, normally hidden (and vice-versa in
hledger-ui/hledger-web)
'-B --cost'
@ -379,17 +379,17 @@ Tag Table:
Node: Top71
Node: OPTIONS827
Ref: #options924
Node: KEYS4133
Ref: #keys4228
Node: SCREENS7187
Ref: #screens7272
Node: Accounts screen7362
Ref: #accounts-screen7490
Node: Register screen9720
Ref: #register-screen9875
Node: Transaction screen11949
Ref: #transaction-screen12107
Node: Error screen12977
Ref: #error-screen13099
Node: KEYS4141
Ref: #keys4236
Node: SCREENS7195
Ref: #screens7280
Node: Accounts screen7370
Ref: #accounts-screen7498
Node: Register screen9728
Ref: #register-screen9883
Node: Transaction screen11957
Ref: #transaction-screen12115
Node: Error screen12985
Ref: #error-screen13107

End Tag Table

View File

@ -118,7 +118,7 @@ OPTIONS
hide/aggregate accounts or postings more than NUM levels deep
-E --empty
show items with zero amount, normally hidden (except in
show items with zero amount, normally hidden (and vice-versa in
hledger-ui/hledger-web)
-B --cost

View File

@ -73,7 +73,10 @@ sidebar vd@VD{..} =
|]
where
journalcurrent = if here == JournalR then "inacct" else "" :: String
accounts = balanceReportAsHtml opts vd $ balanceReport (reportopts_ $ cliopts_ opts){empty_=True} am j
ropts = reportopts_ $ cliopts_ opts
-- flip the default for items with zero amounts, show them by default
ropts' = ropts{empty_=not $ empty_ ropts}
accounts = balanceReportAsHtml opts vd $ balanceReport ropts' am j
showmd = if showsidebar then "col-md-4" else "col-any-0" :: String
showsm = if showsidebar then "col-sm-4" else "" :: String

View File

@ -227,7 +227,7 @@ hide/aggregate accounts or postings more than NUM levels deep
.RE
.TP
.B \f[C]\-E\ \-\-empty\f[]
show items with zero amount, normally hidden (except in
show items with zero amount, normally hidden (and vice\-versa in
hledger\-ui/hledger\-web)
.RS
.RE

View File

@ -167,7 +167,7 @@ options as shown above.
hide/aggregate accounts or postings more than NUM levels deep
'-E --empty'
show items with zero amount, normally hidden (except in
show items with zero amount, normally hidden (and vice-versa in
hledger-ui/hledger-web)
'-B --cost'

View File

@ -163,7 +163,7 @@ OPTIONS
hide/aggregate accounts or postings more than NUM levels deep
-E --empty
show items with zero amount, normally hidden (except in
show items with zero amount, normally hidden (and vice-versa in
hledger-ui/hledger-web)
-B --cost

View File

@ -282,7 +282,7 @@ hide/aggregate accounts or postings more than NUM levels deep
.RE
.TP
.B \f[C]\-E\ \-\-empty\f[]
show items with zero amount, normally hidden (except in
show items with zero amount, normally hidden (and vice\-versa in
hledger\-ui/hledger\-web)
.RS
.RE

View File

@ -225,7 +225,7 @@ by most hledger commands, run 'hledger -h'.
hide/aggregate accounts or postings more than NUM levels deep
'-E --empty'
show items with zero amount, normally hidden (except in
show items with zero amount, normally hidden (and vice-versa in
hledger-ui/hledger-web)
'-B --cost'

View File

@ -192,7 +192,7 @@ OPTIONS
hide/aggregate accounts or postings more than NUM levels deep
-E --empty
show items with zero amount, normally hidden (except in
show items with zero amount, normally hidden (and vice-versa in
hledger-ui/hledger-web)
-B --cost