diff --git a/Hledger/Cli/Commands/Web.hs b/Hledger/Cli/Commands/Web.hs index 65992cdab..cc1b23a74 100644 --- a/Hledger/Cli/Commands/Web.hs +++ b/Hledger/Cli/Commands/Web.hs @@ -415,7 +415,9 @@ getLedgerPage = do let args = appArgs app fspec' = optsToFilterSpec opts args t br = balanceReportAsHtml opts td $ balanceReport opts fspec' j - rr = registerReportAsHtml opts td $ registerReport opts fspec j + rr = if null a && null p + then nulltemplate + else registerReportAsHtml opts td $ registerReport opts fspec j td = mktd{here=here, title="hledger", msg=msg, a=a, p=p} hamletToRepHtml $ pageLayout td [$hamlet| %div.ledger @@ -499,7 +501,10 @@ registerReportAsHtml _ td items = [$hamlet| p' = if null p then "" else printf "&p=%s" p --mixedAmountAsHtml = intercalate ", " . lines . show -mixedAmountAsHtml = preEscapedString . intercalate "
" . lines . show +mixedAmountAsHtml b = preEscapedString $ addclass $ intercalate "
" $ lines $ show b + where addclass = printf "%s" c + c = case isNegativeMixedAmount b of Just True -> "negative amount" + _ -> "positive amount" ---------------------------------------------------------------------- diff --git a/data/web/style.css b/data/web/style.css index 0ea2d8a1e..112d39f9d 100644 --- a/data/web/style.css +++ b/data/web/style.css @@ -12,7 +12,7 @@ body { margin:0; } .navlinkcurrent { font-weight:bold; } .nav2 { font-size:small; } #filterform { font-size:small; display:inline; margin-left:1em; } -.filtering { background-color:#eee; font-weight:bold; } +.filtering { background-color:#ddd; font-weight:bold; } #stopfilterlink { font-size:small; } .toprightlink { font-size:small; margin-left:1em; float:right; } #messages { color:red; background-color:#ffeeee; margin:0.5em;} @@ -33,14 +33,15 @@ body { margin:0; } /* for -fweb610 */ /* #hledgerorglink, #helplink { float:right; margin-left:1em; } */ -.current { font-weight:bold; background-color:#eee; } +.current { font-weight:bold; background-color:#ddd; } .description { padding-left:1em; } .account { white-space:nowrap; padding-left:1em; } .amount { white-space:nowrap; padding-left:1em; } .balance { white-space:nowrap; padding-left:1em; } /* don't let fields get too small in emptyish reports */ -.description { width:4em; } .account, .amount, .balance { width:2em; } +.positive { } +.negative { color:red; } /* .odd { background-color:#e8e8e8; } */ /* .even { background-color:#e8f8e8; } */ /* .even { background-color:#f0fff0; } */