hledger-web 1.3.2 → 1.4
raw patch · 10 files changed
+127/−144 lines, 10 filesdep −ghc-primdep −old-localedep ~hledgerdep ~hledger-libdep ~megaparsecPVP ok
version bump matches the API change (PVP)
Dependencies removed: ghc-prim, old-locale
Dependency ranges changed: hledger, hledger-lib, megaparsec, shakespeare, time
API changes (from Hackage documentation)
Files
- CHANGES +13/−0
- Handler/AddForm.hs +2/−2
- Handler/JournalR.hs +1/−1
- Hledger/Web/Main.hs +8/−8
- Hledger/Web/WebOptions.hs +7/−1
- Import.hs +1/−14
- doc/hledger-web.1 +16/−23
- doc/hledger-web.1.info +20/−20
- doc/hledger-web.1.txt +26/−22
- hledger-web.cabal +33/−53
CHANGES view
@@ -2,6 +2,19 @@ See also the hledger and the project change logs. +# 1.4 (2017/9/30)++* a @FILE argument reads flags & args from FILE, one per line++* enable --pivot and --anon options, like hledger CLI (#474) (Jakub Zárybnický)++* web: Make "Add transaction" button tabbable (#430) (Jakub Zárybnický)++* accept -NUM as a shortcut for --depth NUM++* deps: drop oldtime flag, require time 1.5+, remove ghc < 7.6 support++ # 1.3.2 (2017/8/25) * remove unnecessary bound to satisfy hackage server
Handler/AddForm.hs view
@@ -20,9 +20,9 @@ import Text.Megaparsec.Compat (digitChar, eof, some, string, runParser, ParseError, MPErr) import Hledger.Utils-import Hledger.Data hiding (num)+import Hledger.Data import Hledger.Read-import Hledger.Cli hiding (num)+import Hledger.Cli.Commands.Add (appendToJournalFileOrStdout) -- Part of the data required from the add form.
Handler/JournalR.hs view
@@ -37,7 +37,7 @@ <div .row> <h2 #contenttitle>#{title} <!-- p>Journal entries record movements of commodities between accounts. -->- <a #addformlink role="button" style="cursor:pointer; margin-top:1em;" data-toggle="modal" data-target="#addmodal" title="Add a new transaction to the journal" >Add a transaction+ <a #addformlink role="button" style="cursor:pointer; margin-top:1em;" data-toggle="modal" data-target="#addmodal" title="Add a new transaction to the journal" href="#">Add a transaction <div .table-responsive> ^{maincontent} |]
Hledger/Web/Main.hs view
@@ -43,10 +43,7 @@ runWith :: WebOpts -> IO () runWith opts- | "h" `inRawOpts` (rawopts_ $ cliopts_ opts) = putStr (showModeUsage webmode) >> exitSuccess- | "help" `inRawOpts` (rawopts_ $ cliopts_ opts) = printHelpForTopic (topicForMode webmode) >> exitSuccess- | "man" `inRawOpts` (rawopts_ $ cliopts_ opts) = runManForTopic (topicForMode webmode) >> exitSuccess- | "info" `inRawOpts` (rawopts_ $ cliopts_ opts) = runInfoForTopic (topicForMode webmode) >> exitSuccess+ | "help" `inRawOpts` (rawopts_ $ cliopts_ opts) = putStr (showModeUsage webmode) >> exitSuccess | "version" `inRawOpts` (rawopts_ $ cliopts_ opts) = putStrLn prognameandversion >> exitSuccess | "binary-filename" `inRawOpts` (rawopts_ $ cliopts_ opts) = putStrLn (binaryfilename progname) | otherwise = do@@ -54,16 +51,19 @@ withJournalDo' opts web withJournalDo' :: WebOpts -> (WebOpts -> Journal -> IO ()) -> IO ()-withJournalDo' opts cmd = do- f <- head `fmap` journalFilePathFromOpts (cliopts_ opts) -- XXX head should be safe for now+withJournalDo' opts@WebOpts {cliopts_ = cliopts} cmd = do+ f <- head `fmap` journalFilePathFromOpts cliopts -- XXX head should be safe for now -- https://github.com/simonmichael/hledger/issues/202 -- -f- gives [Error#yesod-core] <stdin>: hGetContents: illegal operation (handle is closed) for some reason -- Also we may be writing to this file. Just disallow it. when (f == "-") $ error' "hledger-web doesn't support -f -, please specify a file path" - readJournalFile Nothing Nothing True f >>=- either error' (cmd opts . journalApplyAliases (aliasesFromOpts $ cliopts_ opts))+ let fn = cmd opts .+ pivotByOpts cliopts .+ anonymiseByOpts cliopts .+ journalApplyAliases (aliasesFromOpts cliopts)+ readJournalFile Nothing Nothing True f >>= either error' fn -- | The web command. web :: WebOpts -> Journal -> IO ()
Hledger/Web/WebOptions.hs view
@@ -7,6 +7,7 @@ import Data.Functor.Compat ((<$>)) #endif import Data.Maybe+import System.Environment import Hledger.Cli hiding (progname,version,prognameandversion) import Settings@@ -92,5 +93,10 @@ else Right () getHledgerWebOpts :: IO WebOpts-getHledgerWebOpts = processArgs webmode >>= return . decodeRawOpts >>= rawOptsToWebOpts+--getHledgerWebOpts = processArgs webmode >>= return . decodeRawOpts >>= rawOptsToWebOpts+getHledgerWebOpts = do+ args <- getArgs >>= expandArgsAt+ let args' = replaceNumericFlags args + let cmdargopts = either usageError id $ process webmode args'+ rawOptsToWebOpts $ decodeRawOpts cmdargopts
Import.hs view
@@ -17,17 +17,4 @@ import Settings.Development as Import import Settings.StaticFiles as Import -#if __GLASGOW_HASKELL__ >= 704-import Data.Monoid as Import (-#if !MIN_VERSION_base(4,8,0)- Monoid (mappend, mempty, mconcat),-#endif- (<>))-#else-import Data.Monoid as Import- (Monoid (mappend, mempty, mconcat))--infixr 5 <>-(<>) :: Monoid m => m -> m -> m-(<>) = mappend-#endif+import Data.Monoid as Import ((<>))
doc/hledger-web.1 view
@@ -1,5 +1,5 @@ -.TH "hledger\-web" "1" "August 2017" "hledger\-web 1.3.1" "hledger User Manuals"+.TH "hledger\-web" "1" "September 2017" "hledger\-web 1.4" "hledger User Manuals" @@ -144,8 +144,8 @@ .RS .RE .TP-.B \f[C]\-\-pivot\ TAGNAME\f[]-use some other field/tag for account names+.B \f[C]\-\-pivot\ FIELDNAME\f[]+use some other field or tag for the account name .RS .RE .TP@@ -198,7 +198,7 @@ .RE .TP .B \f[C]\-\-date2\f[]-show, and match with \-b/\-e/\-p/date:, secondary dates instead+match the secondary date instead (see command help for other effects) .RS .RE .TP@@ -222,8 +222,8 @@ .RS .RE .TP-.B \f[C]\-\-depth=N\f[]-hide accounts/postings deeper than N+.B \f[C]\-NUM\ \-\-depth=NUM\f[]+hide/aggregate accounts or postings more than NUM levels deep .RS .RE .TP@@ -244,29 +244,18 @@ .RS .RE .PP+When a reporting option appears more than once in the command line, the+last one takes precedence.+.PP+Some reporting options can also be written as query arguments.+.PP hledger help options: .TP-.B \f[C]\-h\f[]+.B \f[C]\-h\ \-\-help\f[] show general usage (or after COMMAND, command usage) .RS .RE .TP-.B \f[C]\-\-help\f[]-show this program\[aq]s manual as plain text (or after an add\-on-COMMAND, the add\-on\[aq]s manual)-.RS-.RE-.TP-.B \f[C]\-\-man\f[]-show this program\[aq]s manual with man-.RS-.RE-.TP-.B \f[C]\-\-info\f[]-show this program\[aq]s manual with info-.RS-.RE-.TP .B \f[C]\-\-version\f[] show version .RS@@ -276,6 +265,10 @@ show debug output (levels 1\-9, default: 1) .RS .RE+.PP+A \@FILE argument will be expanded to the contents of FILE, which should+contain one command line option/argument per line.+(To prevent this, insert a \f[C]\-\-\f[] argument before.) .SH ENVIRONMENT .PP \f[B]LEDGER_FILE\f[] The journal file path when not specified with
doc/hledger-web.1.info view
@@ -3,8 +3,8 @@ File: hledger-web.1.info, Node: Top, Next: OPTIONS, Up: (dir) -hledger-web(1) hledger-web 1.3.1-********************************+hledger-web(1) hledger-web 1.4+****************************** hledger-web is hledger's web interface. It starts a simple web application for browsing and adding transactions, and optionally opens@@ -112,9 +112,9 @@ '--anon' anonymize accounts and payees-'--pivot TAGNAME'+'--pivot FIELDNAME' - use some other field/tag for account names+ use some other field or tag for the account name '-I --ignore-assertions' ignore any failing balance assertions@@ -148,7 +148,8 @@ (overrides the flags above) '--date2' - show, and match with -b/-e/-p/date:, secondary dates instead+ match the secondary date instead (see command help for other+ effects) '-U --unmarked' include only unmarked postings/txns (can combine with -P or -C)@@ -161,9 +162,9 @@ '-R --real' include only non-virtual postings-'--depth=N'+'-NUM --depth=NUM' - hide accounts/postings deeper than N+ hide/aggregate accounts or postings more than NUM levels deep '-E --empty' show items with zero amount, normally hidden@@ -176,21 +177,16 @@ convert amounts to their market value on the report end date (using the most recent applicable market price, if any) - hledger help options:--'-h'+ When a reporting option appears more than once in the command line,+the last one takes precedence. - show general usage (or after COMMAND, command usage)-'--help'+ Some reporting options can also be written as query arguments. - show this program's manual as plain text (or after an add-on- COMMAND, the add-on's manual)-'--man'+ hledger help options: - show this program's manual with man-'--info'+'-h --help' - show this program's manual with info+ show general usage (or after COMMAND, command usage) '--version' show version@@ -198,10 +194,14 @@ show debug output (levels 1-9, default: 1) + A @FILE argument will be expanded to the contents of FILE, which+should contain one command line option/argument per line. (To prevent+this, insert a '--' argument before.)+ Tag Table: Node: Top74-Node: OPTIONS3160-Ref: #options3247+Node: OPTIONS3156+Ref: #options3243 End Tag Table
doc/hledger-web.1.txt view
@@ -110,8 +110,8 @@ --anon anonymize accounts and payees - --pivot TAGNAME- use some other field/tag for account names+ --pivot FIELDNAME+ use some other field or tag for the account name -I --ignore-assertions ignore any failing balance assertions@@ -144,7 +144,8 @@ (overrides the flags above) --date2- show, and match with -b/-e/-p/date:, secondary dates instead+ match the secondary date instead (see command help for other+ effects) -U --unmarked include only unmarked postings/txns (can combine with -P or -C)@@ -158,30 +159,29 @@ -R --real include only non-virtual postings - --depth=N- hide accounts/postings deeper than N+ -NUM --depth=NUM+ hide/aggregate accounts or postings more than NUM levels deep -E --empty show items with zero amount, normally hidden -B --cost- convert amounts to their cost at transaction time (using the+ convert amounts to their cost at transaction time (using the transaction price, if any) -V --value- convert amounts to their market value on the report end date+ convert amounts to their market value on the report end date (using the most recent applicable market price, if any) - hledger help options:-- -h show general usage (or after COMMAND, command usage)+ When a reporting option appears more than once in the command line, the+ last one takes precedence. - --help show this program's manual as plain text (or after an add-on- COMMAND, the add-on's manual)+ Some reporting options can also be written as query arguments. - --man show this program's manual with man+ hledger help options: - --info show this program's manual with info+ -h --help+ show general usage (or after COMMAND, command usage) --version show version@@ -189,19 +189,23 @@ --debug[=N] show debug output (levels 1-9, default: 1) + A @FILE argument will be expanded to the contents of FILE, which should+ contain one command line option/argument per line. (To prevent this,+ insert a -- argument before.)+ ENVIRONMENT LEDGER_FILE The journal file path when not specified with -f. Default:- ~/.hledger.journal (on windows, perhaps C:/Users/USER/.hledger.jour-+ ~/.hledger.journal (on windows, perhaps C:/Users/USER/.hledger.jour- nal). FILES- Reads data from one or more files in hledger journal, timeclock, time-- dot, or CSV format specified with -f, or $LEDGER_FILE, or- $HOME/.hledger.journal (on windows, perhaps+ Reads data from one or more files in hledger journal, timeclock, time-+ dot, or CSV format specified with -f, or $LEDGER_FILE, or+ $HOME/.hledger.journal (on windows, perhaps C:/Users/USER/.hledger.journal). BUGS- The need to precede options with -- when invoked from hledger is awk-+ The need to precede options with -- when invoked from hledger is awk- ward. -f- doesn't work (hledger-web can't read from stdin).@@ -215,7 +219,7 @@ REPORTING BUGS- Report bugs at http://bugs.hledger.org (or on the #hledger IRC channel+ Report bugs at http://bugs.hledger.org (or on the #hledger IRC channel or hledger mail list) @@ -229,7 +233,7 @@ SEE ALSO- hledger(1), hledger-ui(1), hledger-web(1), hledger-api(1),+ hledger(1), hledger-ui(1), hledger-web(1), hledger-api(1), hledger_csv(5), hledger_journal(5), hledger_timeclock(5), hledger_time- dot(5), ledger(1) @@ -237,4 +241,4 @@ -hledger-web 1.3.1 August 2017 hledger-web(1)+hledger-web 1.4 September 2017 hledger-web(1)
hledger-web.cabal view
@@ -3,7 +3,7 @@ -- see: https://github.com/sol/hpack name: hledger-web-version: 1.3.2+version: 1.4 synopsis: Web interface for the hledger accounting tool description: This is hledger's web interface. It provides a more user-friendly and collaborative UI than the@@ -23,7 +23,7 @@ maintainer: Simon Michael <simon@joyful.com> license: GPL-3 license-file: LICENSE-tested-with: GHC==7.10.3, GHC==8.0+tested-with: GHC==7.10.3, GHC==8.0.2, GHC==8.2.1 build-type: Simple cabal-version: >= 1.10 @@ -113,11 +113,6 @@ manual: False default: False -flag oldtime- description: If building with time < 1.5, also depend on old-locale. Set automatically by cabal.- manual: False- default: False- flag threaded description: Build with support for multithreaded execution. manual: False@@ -125,10 +120,10 @@ library ghc-options: -Wall -fno-warn-unused-do-bind -fno-warn-name-shadowing -fno-warn-missing-signatures -fno-warn-type-defaults -fno-warn-orphans- cpp-options: -DVERSION="1.3.2"+ cpp-options: -DVERSION="1.4" build-depends:- hledger-lib >= 1.3.1 && < 1.4- , hledger >= 1.3.1 && < 1.4+ hledger-lib >= 1.4 && < 1.5+ , hledger >= 1.4 && < 1.5 , base >=4.8 && <5 , base-compat >=0.8.1 , blaze-html@@ -145,9 +140,10 @@ , HUnit , conduit-extra >=1.1 , safe >=0.2- , shakespeare >=2.0+ , shakespeare >=2.0.2.2 && < 2.1 , template-haskell , text >=1.2 && <1.3+ , time >=1.5 , transformers , wai , wai-extra@@ -161,18 +157,11 @@ , json , megaparsec >=5.0 && < 6.2 , mtl+ , parsec >=3 if (flag(dev)) || (flag(library-only)) cpp-options: -DDEVELOPMENT- if flag(oldtime)- build-depends:- time <1.5- , old-locale- else- build-depends:- time >=1.5- if impl(ghc <7.6)- build-depends:- ghc-prim+ if flag(dev)+ ghc-options: -O0 exposed-modules: Application Foundation@@ -199,10 +188,10 @@ hs-source-dirs: app ghc-options: -Wall -fno-warn-unused-do-bind -fno-warn-name-shadowing -fno-warn-missing-signatures -fno-warn-type-defaults -fno-warn-orphans- cpp-options: -DVERSION="1.3.2"+ cpp-options: -DVERSION="1.4" build-depends:- hledger-lib >= 1.3.1 && < 1.4- , hledger >= 1.3.1 && < 1.4+ hledger-lib >= 1.4 && < 1.5+ , hledger >= 1.4 && < 1.5 , base >=4.8 && <5 , base-compat >=0.8.1 , blaze-html@@ -219,9 +208,10 @@ , HUnit , conduit-extra >=1.1 , safe >=0.2- , shakespeare >=2.0+ , shakespeare >=2.0.2.2 && < 2.1 , template-haskell , text >=1.2 && <1.3+ , time >=1.5 , transformers , wai , wai-extra@@ -233,26 +223,18 @@ , yesod-form , yesod-static , json+ , megaparsec >=5.0 && < 6.2+ , mtl , parsec >=3 , hledger-web+ if (flag(dev)) || (flag(library-only))+ cpp-options: -DDEVELOPMENT+ if flag(dev)+ ghc-options: -O0 if flag(library-only) buildable: False if flag(threaded) ghc-options: -threaded- if flag(dev)- ghc-options: -O0- if flag(dev)- cpp-options: -DDEVELOPMENT- if flag(oldtime)- build-depends:- time <1.5- , old-locale- else- build-depends:- time >=1.5- if impl(ghc <7.6)- build-depends:- ghc-prim default-language: Haskell2010 test-suite test@@ -261,10 +243,10 @@ hs-source-dirs: tests ghc-options: -Wall -fno-warn-unused-do-bind -fno-warn-name-shadowing -fno-warn-missing-signatures -fno-warn-type-defaults -fno-warn-orphans- cpp-options: -DVERSION="1.3.2"+ cpp-options: -DVERSION="1.4" build-depends:- hledger-lib >= 1.3.1 && < 1.4- , hledger >= 1.3.1 && < 1.4+ hledger-lib >= 1.4 && < 1.5+ , hledger >= 1.4 && < 1.5 , base >=4.8 && <5 , base-compat >=0.8.1 , blaze-html@@ -281,9 +263,10 @@ , HUnit , conduit-extra >=1.1 , safe >=0.2- , shakespeare >=2.0+ , shakespeare >=2.0.2.2 && < 2.1 , template-haskell , text >=1.2 && <1.3+ , time >=1.5 , transformers , wai , wai-extra@@ -295,19 +278,16 @@ , yesod-form , yesod-static , json+ , megaparsec >=5.0 && < 6.2+ , mtl+ , parsec >=3 , hledger-web , hspec , yesod-test- if flag(oldtime)- build-depends:- time <1.5- , old-locale- else- build-depends:- time >=1.5- if impl(ghc <7.6)- build-depends:- ghc-prim+ if (flag(dev)) || (flag(library-only))+ cpp-options: -DDEVELOPMENT+ if flag(dev)+ ghc-options: -O0 other-modules: HomeTest TestImport