hledger-web 1.32.3 → 1.33
raw patch · 9 files changed
+151/−92 lines, 9 filesdep ~basedep ~hledgerdep ~hledger-lib
Dependency ranges changed: base, hledger, hledger-lib, safe
Files
- CHANGES.md +32/−6
- Hledger/Web/Handler/RegisterR.hs +4/−3
- Hledger/Web/Widget/Common.hs +1/−1
- hledger-web.1 +11/−2
- hledger-web.cabal +12/−12
- hledger-web.info +34/−25
- hledger-web.txt +50/−41
- static/hledger.css +5/−0
- templates/balance-report.hamlet +2/−2
CHANGES.md view
@@ -1,10 +1,10 @@ <!--- _ -__ _____| |__ -\ \ /\ / / _ \ '_ \ + _+__ _____| |__+\ \ /\ / / _ \ '_ \ \ V V / __/ |_) |- \_/\_/ \___|_.__/ - + \_/\_/ \___|_.__/+ Breaking changes Fixes@@ -21,6 +21,33 @@ User-visible changes in hledger-web. See also the hledger changelog. +# 1.33 2024-04-18++Fixes++- Exclude base64 >=1.0 to avoid compilation failure. [#2166]++- Preserve line breaks when showing an error message. [#2163] (Martijn van der Ven)++Improvements++- Zero amounts are now shown with their commodity symbol.+ This was mainly to make the sidebar more informative,+ but also affects and hopefully helps amounts displayed elsewhere.+ [#2140]++- Amounts in the sidebar now also have the `amount` HTML class.++- Allow building with GHC 9.8.++- Require safe >=0.3.20.++Docs++- Mention the `-E/--empty` flag for hiding zeros,+ the non-display of costs,+ and non-zeros that look like zero because of hidden costs.+ # 1.32.3 2024-01-28 - Use hledger-1.32.3@@ -45,7 +72,6 @@ rather than "any of our IPv4 or IPv6 addresses" and 3000, # 1.32.1 2023-12-07- - Use hledger-1.32.1 # 1.32 2023-12-01
Hledger/Web/Handler/RegisterR.hs view
@@ -11,6 +11,7 @@ import Data.List (intersperse, nub, partition) import qualified Data.Text as T+import Safe (tailDef) import Text.Hamlet (hamletFile) import Hledger@@ -44,7 +45,7 @@ addCommas xs = zip xs $ zip (map (T.unpack . accountSummarisedName . paccount) xs) $- tail $ (", "<$xs) ++ [""]+ tailDef [""] $ (", "<$xs) items = styleAmounts (journalCommodityStylesWith HardRounding j) $ accountTransactionsReport rspec{_rsQuery=q} j acctQuery@@ -108,8 +109,8 @@ charttitle = if null title then "" else title ++ ":" colorForCommodity = fromMaybe 0 . flip lookup commoditiesIndex commoditiesIndex = zip (map fst percommoditytxnreports) [0..] :: [(CommoditySymbol,Int)]- simpleMixedAmountQuantity = maybe 0 aquantity . listToMaybe . amounts . mixedAmountStripPrices- showZeroCommodity = wbUnpack . showMixedAmountB oneLine{displayCost=False,displayZeroCommodity=True}+ simpleMixedAmountQuantity = maybe 0 aquantity . listToMaybe . amounts . mixedAmountStripCosts+ showZeroCommodity = wbUnpack . showMixedAmountB oneLineNoCostFmt{displayCost=False,displayZeroCommodity=True} shownull c = if null c then " " else c nodatelink = (RegisterR, [("q", T.unwords $ removeDates q)])
Hledger/Web/Widget/Common.hs view
@@ -95,7 +95,7 @@ mixedAmountAsHtml :: MixedAmount -> HtmlUrl a mixedAmountAsHtml b _ =- for_ (lines (showMixedAmountWithoutPrice False b)) $ \t -> do+ for_ (lines (showMixedAmountWith noCostFmt{displayZeroCommodity=True} b)) $ \t -> do H.span ! A.class_ c $ toHtml t H.br where
hledger-web.1 view
@@ -1,5 +1,5 @@ -.TH "HLEDGER\-WEB" "1" "January 2024" "hledger-web-1.32.3 " "hledger User Manuals"+.TH "HLEDGER\-WEB" "1" "April 2024" "hledger-web-1.33 " "hledger User Manuals" @@ -12,7 +12,7 @@ .PD \f[CR]hledger web \-\- [\-\-serve|\-\-serve\-api] [OPTS] [ARGS]\f[R] .SH DESCRIPTION-This manual is for hledger\[aq]s web interface, version 1.32.3.+This manual is for hledger\[aq]s web interface, version 1.33. See also the hledger manual for common concepts and file formats. .PP hledger is a robust, user\-friendly, cross\-platform set of programs for@@ -128,6 +128,15 @@ Query options and arguments may be used to set an initial filter, which although not shown in the UI, will restrict the data shown, in addition to any search query entered in the UI.+.PP+Note that hledger\-web shows accounts with zero balances by default,+like \f[CR]hledger\-ui\f[R] (and unlike \f[CR]hledger\f[R]).+Using the \f[CR]\-E/\-\-empty\f[R] flag at startup will hide them.+.PP+If you see accounts which appear to have a zero balance, but cannot be+hidden with \f[CR]\-E\f[R]: these have a mixed\-cost balance which looks+like zero when costs are hidden.+Currently hledger\-web does not show costs at all. .SS General help options .TP \f[CR]\-h \-\-help\f[R]
hledger-web.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: hledger-web-version: 1.32.3+version: 1.33 synopsis: Web user interface for the hledger accounting system description: A simple web user interface for the hledger accounting system, providing a more modern UI than the command-line or terminal interfaces.@@ -151,12 +151,12 @@ hs-source-dirs: ./ ghc-options: -Wall -Wredundant-constraints -Wincomplete-record-updates -Wincomplete-uni-patterns- cpp-options: -DVERSION="1.32.3"+ cpp-options: -DVERSION="1.33" build-depends: Decimal >=0.5.1 , aeson >=1 && <2.3- , base >=4.14 && <4.19- , base64+ , base >=4.14 && <4.20+ , base64 <1 , blaze-html , blaze-markup , bytestring@@ -171,8 +171,8 @@ , extra >=1.6.3 , filepath , hjsmin- , hledger >=1.32.3 && <1.33- , hledger-lib >=1.32.3 && <1.33+ , hledger ==1.33.*+ , hledger-lib ==1.33.* , hspec , http-client , http-conduit@@ -180,7 +180,7 @@ , megaparsec >=7.0.0 && <9.7 , mtl >=2.2.1 , network- , safe >=0.3.19+ , safe >=0.3.20 , shakespeare >=2.0.2.2 , template-haskell , text >=1.2.4.1@@ -213,9 +213,9 @@ hs-source-dirs: app ghc-options: -Wall -Wredundant-constraints -Wincomplete-record-updates -Wincomplete-uni-patterns- cpp-options: -DVERSION="1.32.3"+ cpp-options: -DVERSION="1.33" build-depends:- base >=4.14 && <4.19+ base >=4.14 && <4.20 , hledger-web default-language: Haskell2010 if (flag(dev)) || (flag(library-only))@@ -225,7 +225,7 @@ if flag(library-only) buildable: False if flag(threaded)- ghc-options: -threaded+ ghc-options: -threaded -with-rtsopts=-T test-suite test type: exitcode-stdio-1.0@@ -233,9 +233,9 @@ hs-source-dirs: test ghc-options: -Wall -Wredundant-constraints -Wincomplete-record-updates -Wincomplete-uni-patterns- cpp-options: -DVERSION="1.32.3"+ cpp-options: -DVERSION="1.33" build-depends:- base >=4.14 && <4.19+ base >=4.14 && <4.20 , hledger-web default-language: Haskell2010 if (flag(dev)) || (flag(library-only))
hledger-web.info view
@@ -16,7 +16,7 @@ 'hledger-web [--serve|--serve-api] [OPTS] [ARGS]' 'hledger web -- [--serve|--serve-api] [OPTS] [ARGS]' - This manual is for hledger's web interface, version 1.32.3. See also+ This manual is for hledger's web interface, version 1.33. See also the hledger manual for common concepts and file formats. hledger is a robust, user-friendly, cross-platform set of programs@@ -142,6 +142,15 @@ although not shown in the UI, will restrict the data shown, in addition to any search query entered in the UI. + Note that hledger-web shows accounts with zero balances by default,+like 'hledger-ui' (and unlike 'hledger'). Using the '-E/--empty' flag+at startup will hide them.++ If you see accounts which appear to have a zero balance, but cannot+be hidden with '-E': these have a mixed-cost balance which looks like+zero when costs are hidden. Currently hledger-web does not show costs+at all.+ * Menu: * General help options::@@ -629,30 +638,30 @@ Tag Table: Node: Top223-Node: OPTIONS2577-Ref: #options2682-Node: General help options5256-Ref: #general-help-options5406-Node: General input options5688-Ref: #general-input-options5874-Node: General reporting options6531-Ref: #general-reporting-options6696-Node: PERMISSIONS10086-Ref: #permissions10225-Node: EDITING UPLOADING DOWNLOADING11437-Ref: #editing-uploading-downloading11618-Node: RELOADING12452-Ref: #reloading12586-Node: JSON API13019-Ref: #json-api13134-Node: DEBUG OUTPUT18622-Ref: #debug-output18747-Node: Debug output18774-Ref: #debug-output-118875-Node: ENVIRONMENT19292-Ref: #environment19411-Node: BUGS19528-Ref: #bugs19612+Node: OPTIONS2575+Ref: #options2680+Node: General help options5645+Ref: #general-help-options5795+Node: General input options6077+Ref: #general-input-options6263+Node: General reporting options6920+Ref: #general-reporting-options7085+Node: PERMISSIONS10475+Ref: #permissions10614+Node: EDITING UPLOADING DOWNLOADING11826+Ref: #editing-uploading-downloading12007+Node: RELOADING12841+Ref: #reloading12975+Node: JSON API13408+Ref: #json-api13523+Node: DEBUG OUTPUT19011+Ref: #debug-output19136+Node: Debug output19163+Ref: #debug-output-119264+Node: ENVIRONMENT19681+Ref: #environment19800+Node: BUGS19917+Ref: #bugs20001 End Tag Table
hledger-web.txt view
@@ -9,41 +9,41 @@ hledger web -- [--serve|--serve-api] [OPTS] [ARGS] DESCRIPTION- This manual is for hledger's web interface, version 1.32.3. See also- the hledger manual for common concepts and file formats.+ This manual is for hledger's web interface, version 1.33. See also the+ hledger manual for common concepts and file formats. - hledger is a robust, user-friendly, cross-platform set of programs for- tracking money, time, or any other commodity, using double-entry ac-- counting and a simple, editable file format. hledger is inspired by- and largely compatible with ledger(1), and largely interconvertible+ hledger is a robust, user-friendly, cross-platform set of programs for+ tracking money, time, or any other commodity, using double-entry ac-+ counting and a simple, editable file format. hledger is inspired by+ and largely compatible with ledger(1), and largely interconvertible with beancount(1). - hledger-web is a simple web application for browsing and adding trans-- actions. It provides a more user-friendly UI than the hledger CLI or- hledger-ui TUI, showing more at once (accounts, the current account+ hledger-web is a simple web application for browsing and adding trans-+ actions. It provides a more user-friendly UI than the hledger CLI or+ hledger-ui TUI, showing more at once (accounts, the current account register, balance charts) and allowing history-aware data entry, inter- active searching, and bookmarking. - hledger-web also lets you share a journal with multiple users, or even- the public web. There is no access control, so if you need that you- should put it behind a suitable web proxy. As a small protection- against data loss when running an unprotected instance, it writes a+ hledger-web also lets you share a journal with multiple users, or even+ the public web. There is no access control, so if you need that you+ should put it behind a suitable web proxy. As a small protection+ against data loss when running an unprotected instance, it writes a numbered backup of the main journal file (only) on every edit. - Like hledger, it reads from (and appends to) a journal file specified- by the LEDGER_FILE environment variable (defaulting to- $HOME/.hledger.journal); or you can specify files with -f options. It- can also read timeclock files, timedot files, or any CSV/SSV/TSV file+ Like hledger, it reads from (and appends to) a journal file specified+ by the LEDGER_FILE environment variable (defaulting to+ $HOME/.hledger.journal); or you can specify files with -f options. It+ can also read timeclock files, timedot files, or any CSV/SSV/TSV file with a date field. (See hledger(1) -> Input for details.) hledger-web can be run in three modes: o Transient mode (the default): your default web browser will be opened- to show the app if possible, and the app exits automatically after- two minutes of inactivity (no requests received and no open browser+ to show the app if possible, and the app exits automatically after+ two minutes of inactivity (no requests received and no open browser windows viewing it). - o With --serve: the app runs without stopping, and without opening a+ o With --serve: the app runs without stopping, and without opening a browser. o With --serve-api: only the JSON API is served.@@ -61,36 +61,36 @@ like --serve, but serve only the JSON web API, not the web UI --allow=view|add|edit- set the user's access level for changing data (default: add).- It also accepts sandstorm for use on that platform (reads per-+ set the user's access level for changing data (default: add).+ It also accepts sandstorm for use on that platform (reads per- missions from the X-Sandstorm-Permissions request header). --cors=ORIGIN- allow cross-origin requests from the specified origin; setting+ allow cross-origin requests from the specified origin; setting ORIGIN to "*" allows requests from any origin --host=IPADDR listen on this IP address (default: 127.0.0.1) - By default the server listens on IP address 127.0.0.1, which is acces-- sible only to requests from the local machine.. You can use --host to- listen on a different address configured on the machine, eg to allow- access from other machines. The special address 0.0.0.0 causes it to+ By default the server listens on IP address 127.0.0.1, which is acces-+ sible only to requests from the local machine.. You can use --host to+ listen on a different address configured on the machine, eg to allow+ access from other machines. The special address 0.0.0.0 causes it to listen on all addresses configured on the machine. --port=PORT listen on this TCP port (default: 5000) - Similarly, you can use --port to listen on a TCP port other than 5000.- This is useful if you want to run multiple hledger-web instances on a+ Similarly, you can use --port to listen on a TCP port other than 5000.+ This is useful if you want to run multiple hledger-web instances on a machine. --socket=SOCKETFILE- listen on the given unix socket instead of an IP address and+ listen on the given unix socket instead of an IP address and port (unix only; implies --serve) - When --socket is used, hledger-web creates and communicates via a- socket file instead of a TCP port. This can be more secure, respects+ When --socket is used, hledger-web creates and communicates via a+ socket file instead of a TCP port. This can be more secure, respects unix file permissions, and makes certain use cases easier, such as run- ning per-user instances behind an nginx reverse proxy. (Eg: proxy_pass http://unix:/tmp/hledger/${remote_user}.socket;.)@@ -98,21 +98,30 @@ --base-url=URL set the base url (default: http://IPADDR:PORT). - You can use --base-url to change the protocol, hostname, port and path- that appear in hledger-web's hyperlinks. This is useful eg when inte-- grating hledger-web within a larger website. The default is- http://HOST:PORT/ using the server's configured host address and TCP- port (or http://HOST if PORT is 80). Note this affects url generation+ You can use --base-url to change the protocol, hostname, port and path+ that appear in hledger-web's hyperlinks. This is useful eg when inte-+ grating hledger-web within a larger website. The default is+ http://HOST:PORT/ using the server's configured host address and TCP+ port (or http://HOST if PORT is 80). Note this affects url generation but not route parsing. - --test run hledger-web's tests and exit. hspec test runner args may+ --test run hledger-web's tests and exit. hspec test runner args may follow a --, eg: hledger-web --test -- --help hledger-web also supports many of hledger's general options. Query op-- tions and arguments may be used to set an initial filter, which al-- though not shown in the UI, will restrict the data shown, in addition+ tions and arguments may be used to set an initial filter, which al-+ though not shown in the UI, will restrict the data shown, in addition to any search query entered in the UI. + Note that hledger-web shows accounts with zero balances by default,+ like hledger-ui (and unlike hledger). Using the -E/--empty flag at+ startup will hide them.++ If you see accounts which appear to have a zero balance, but cannot be+ hidden with -E: these have a mixed-cost balance which looks like zero+ when costs are hidden. Currently hledger-web does not show costs at+ all.+ General help options -h --help show general or COMMAND help@@ -549,4 +558,4 @@ SEE ALSO hledger(1), hledger-ui(1), hledger-web(1), ledger(1) -hledger-web-1.32.3 January 2024 HLEDGER-WEB(1)+hledger-web-1.33 April 2024 HLEDGER-WEB(1)
static/hledger.css view
@@ -86,6 +86,11 @@ padding-left: 30px; } +#message {+ white-space: pre;+ overflow-x: auto;+}+ #sidebar-menu { overflow:hidden; border-right: 1px solid #ebebeb;
templates/balance-report.hamlet view
@@ -17,9 +17,9 @@ $if hasSubAccounts acct <a href="@?{(registerR, [("q", replaceInacct qparam $ accountOnlyQuery acct)])}" .only.hidden-sm.hidden-xs title="Show transactions affecting this account but not subaccounts">only- <td>+ <td .amount> ^{mixedAmountAsHtml abal} <tr .total> <td>- <td>+ <td .amount> ^{mixedAmountAsHtml total}