packages feed

hledger-web 0.26 → 0.27

raw patch · 13 files changed

+403/−368 lines, 13 filesdep ~basedep ~conduit-extradep ~hledgerPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base, conduit-extra, hledger, hledger-lib, hledger-web, shakespeare, time, yesod

API changes (from Hackage documentation)

- Application: instance YesodDispatch App
- Foundation: am :: ViewData -> Query
- Foundation: aopts :: ViewData -> [QueryOpt]
- Foundation: appJournal :: App -> IORef Journal
- Foundation: appOpts :: App -> WebOpts
- Foundation: getStatic :: App -> Static
- Foundation: here :: ViewData -> AppRoute
- Foundation: httpManager :: App -> Manager
- Foundation: instance Eq (Route App)
- Foundation: instance ParseRoute App
- Foundation: instance Read (Route App)
- Foundation: instance RenderMessage App AppMessage
- Foundation: instance RenderMessage App FormMessage
- Foundation: instance RenderRoute App
- Foundation: instance RouteAttrs App
- Foundation: instance Show (Route App)
- Foundation: instance Show Markup
- Foundation: instance Show ViewData
- Foundation: instance Yesod App
- Foundation: j :: ViewData -> Journal
- Foundation: m :: ViewData -> Query
- Foundation: msg :: ViewData -> Maybe Html
- Foundation: opts :: ViewData -> WebOpts
- Foundation: q :: ViewData -> String
- Foundation: qopts :: ViewData -> [QueryOpt]
- Foundation: settings :: App -> AppConfig DefaultEnv Extra
- Foundation: showpostings :: ViewData -> Bool
- Foundation: showsidebar :: ViewData -> Bool
- Foundation: today :: ViewData -> Day
- Handler.AddForm: addFormDate :: AddForm -> Day
- Handler.AddForm: addFormDescription :: AddForm -> Maybe Text
- Handler.AddForm: addFormJournalFile :: AddForm -> Maybe Text
- Handler.AddForm: instance Show AddForm
- Hledger.Web.Options: WebOpts :: Bool -> String -> Int -> Maybe String -> CliOpts -> WebOpts
- Hledger.Web.Options: base_url_ :: WebOpts -> String
- Hledger.Web.Options: checkWebOpts :: WebOpts -> IO WebOpts
- Hledger.Web.Options: cliopts_ :: WebOpts -> CliOpts
- Hledger.Web.Options: data WebOpts
- Hledger.Web.Options: defbaseurlexample :: String
- Hledger.Web.Options: defwebopts :: WebOpts
- Hledger.Web.Options: getHledgerWebOpts :: IO WebOpts
- Hledger.Web.Options: instance Show WebOpts
- Hledger.Web.Options: port_ :: WebOpts -> Int
- Hledger.Web.Options: progname :: String
- Hledger.Web.Options: prognameandversion :: String
- Hledger.Web.Options: server_ :: WebOpts -> Bool
- Hledger.Web.Options: static_root_ :: WebOpts -> Maybe String
- Hledger.Web.Options: toWebOpts :: RawOpts -> IO WebOpts
- Hledger.Web.Options: version :: String
- Hledger.Web.Options: webflags :: [Flag [([Char], [Char])]]
- Hledger.Web.Options: webmode :: Mode [([Char], [Char])]
- Settings: extraAnalytics :: Extra -> Maybe Text
- Settings: extraCopyright :: Extra -> Text
- Settings: extraStaticRoot :: Extra -> Maybe Text
- Settings: instance Show Extra
+ Application: instance Yesod.Core.Class.Dispatch.YesodDispatch Foundation.App
+ Foundation: [am] :: ViewData -> Query
+ Foundation: [aopts] :: ViewData -> [QueryOpt]
+ Foundation: [appJournal] :: App -> IORef Journal
+ Foundation: [appOpts] :: App -> WebOpts
+ Foundation: [getStatic] :: App -> Static
+ Foundation: [here] :: ViewData -> AppRoute
+ Foundation: [httpManager] :: App -> Manager
+ Foundation: [j] :: ViewData -> Journal
+ Foundation: [m] :: ViewData -> Query
+ Foundation: [msg] :: ViewData -> Maybe Html
+ Foundation: [opts] :: ViewData -> WebOpts
+ Foundation: [q] :: ViewData -> String
+ Foundation: [qopts] :: ViewData -> [QueryOpt]
+ Foundation: [settings] :: App -> AppConfig DefaultEnv Extra
+ Foundation: [showpostings] :: ViewData -> Bool
+ Foundation: [showsidebar] :: ViewData -> Bool
+ Foundation: [today] :: ViewData -> Day
+ Foundation: instance GHC.Classes.Eq (Yesod.Routes.Class.Route Foundation.App)
+ Foundation: instance GHC.Read.Read (Yesod.Routes.Class.Route Foundation.App)
+ Foundation: instance GHC.Show.Show (Yesod.Routes.Class.Route Foundation.App)
+ Foundation: instance GHC.Show.Show Foundation.ViewData
+ Foundation: instance GHC.Show.Show Text.Blaze.Internal.Markup
+ Foundation: instance Text.Shakespeare.I18N.RenderMessage Foundation.App Foundation.AppMessage
+ Foundation: instance Text.Shakespeare.I18N.RenderMessage Foundation.App Yesod.Form.Types.FormMessage
+ Foundation: instance Yesod.Core.Class.Yesod.Yesod Foundation.App
+ Foundation: instance Yesod.Routes.Class.ParseRoute Foundation.App
+ Foundation: instance Yesod.Routes.Class.RenderRoute Foundation.App
+ Foundation: instance Yesod.Routes.Class.RouteAttrs Foundation.App
+ Handler.AddForm: [addFormDate] :: AddForm -> Day
+ Handler.AddForm: [addFormDescription] :: AddForm -> Maybe Text
+ Handler.AddForm: [addFormJournalFile] :: AddForm -> Maybe Text
+ Handler.AddForm: instance GHC.Show.Show Handler.AddForm.AddForm
+ Hledger.Web.WebOptions: WebOpts :: Bool -> Int -> String -> Maybe String -> CliOpts -> WebOpts
+ Hledger.Web.WebOptions: [base_url_] :: WebOpts -> String
+ Hledger.Web.WebOptions: [cliopts_] :: WebOpts -> CliOpts
+ Hledger.Web.WebOptions: [file_url_] :: WebOpts -> Maybe String
+ Hledger.Web.WebOptions: [port_] :: WebOpts -> Int
+ Hledger.Web.WebOptions: [server_] :: WebOpts -> Bool
+ Hledger.Web.WebOptions: checkWebOpts :: WebOpts -> WebOpts
+ Hledger.Web.WebOptions: data WebOpts
+ Hledger.Web.WebOptions: defbaseurlexample :: String
+ Hledger.Web.WebOptions: defwebopts :: WebOpts
+ Hledger.Web.WebOptions: getHledgerWebOpts :: IO WebOpts
+ Hledger.Web.WebOptions: instance GHC.Show.Show Hledger.Web.WebOptions.WebOpts
+ Hledger.Web.WebOptions: progname :: String
+ Hledger.Web.WebOptions: prognameandversion :: String
+ Hledger.Web.WebOptions: rawOptsToWebOpts :: RawOpts -> IO WebOpts
+ Hledger.Web.WebOptions: version :: String
+ Hledger.Web.WebOptions: webflags :: [Flag [([Char], [Char])]]
+ Hledger.Web.WebOptions: webmode :: Mode [([Char], [Char])]
+ Settings: [extraAnalytics] :: Extra -> Maybe Text
+ Settings: [extraCopyright] :: Extra -> Text
+ Settings: [extraStaticRoot] :: Extra -> Maybe Text
+ Settings: instance GHC.Show.Show Settings.Extra

Files

Application.hs view
@@ -36,11 +36,11 @@ import Handler.RegisterR import Handler.SidebarR -import Hledger.Web.Options (WebOpts(..), defwebopts)+import Hledger.Web.WebOptions (WebOpts(..), defwebopts) import Hledger.Data (Journal, nulljournal) import Hledger.Read (readJournalFile) import Hledger.Utils (error')-import Hledger.Cli.Options (defcliopts, journalFilePathFromOpts)+import Hledger.Cli.CliOptions (defcliopts, journalFilePathFromOpts)  -- This line actually creates our YesodDispatch instance. It is the second half -- of the call to mkYesodData which occurs in Foundation.hs. Please see the
CHANGES view
@@ -1,6 +1,23 @@ User-visible changes in hledger-web. See also hledger's change log. +0.27 (unreleased)++- Fix keyboard shortcut for adding a transaction (Carlos Lopez-Camey)++- Clear the form when clicking 'Add a transaction' (just like the shortcut) (Carlos Lopez-Camey)++- Disallow -f- (reading from standard input) which currently doesn't work (#202)++- Fix broken links when using --base-url (#235)++- Fix the --file-url option (#285)++- Show fewer "other accounts" in the account register: to reduce+  clutter in the "other accounts" field, if there are both real and+  virtual postings to other accounts, show only the accounts posted to+  by real postings.+  0.26 (2015/7/12) 
Foundation.hs view
@@ -30,7 +30,7 @@ import Text.Blaze.Html.Renderer.String (renderHtml) import Text.Hamlet (hamletFile) -import Hledger.Web.Options+import Hledger.Web.WebOptions import Hledger.Data.Types -- import Hledger.Web.Settings -- import Hledger.Web.Settings.StaticFiles
Handler/Common.hs view
@@ -21,8 +21,8 @@ import Hledger.Data import Hledger.Query import Hledger.Reports-import Hledger.Cli.Options-import Hledger.Web.Options+import Hledger.Cli.CliOptions+import Hledger.Web.WebOptions  ------------------------------------------------------------------------------- -- Common page layout
Handler/JournalR.hs view
@@ -3,6 +3,7 @@  module Handler.JournalR where +import Data.Text (pack) import Import  import Handler.AddForm@@ -12,8 +13,8 @@ import Hledger.Query import Hledger.Reports import Hledger.Utils-import Hledger.Cli.Options-import Hledger.Web.Options+import Hledger.Cli.CliOptions+import Hledger.Web.WebOptions  -- | The formatted journal view, with sidebar. getJournalR :: Handler Html@@ -34,7 +35,7 @@   hledgerLayout vd "journal" [hamlet|        <h2#contenttitle>#{title}        <!-- p>Journal entries record movements of commodities between accounts. -->-       <a#addformlink role="button" style="cursor:pointer;" data-toggle="modal" data-target="#addmodal"  title="Add a new transaction to the journal" style="margin-top:1em;">Add a transaction+       <a#addformlink role="button" style="cursor:pointer;" onClick="addformReset(true);" data-toggle="modal" data-target="#addmodal"  title="Add a new transaction to the journal" style="margin-top:1em;">Add a transaction        ^{maincontent}      |] @@ -71,7 +72,7 @@   <td.description>   <td.account>    &nbsp;-   <a href="/register?q=inacct:'#{paccount p'}'##{date}" title="#{paccount p'}">#{elideAccountName 40 $ paccount p'}+   <a href="@?{acctlink (paccount p')}##{date}" title="#{paccount p'}">#{elideAccountName 40 $ paccount p'}   <td.amount style="text-align:right;">#{mixedAmountAsHtml $ pamount p'} <tr.#{evenodd}>  <td>&nbsp;@@ -80,6 +81,7 @@  <td> |]      where+       acctlink a = (RegisterR, [("q", pack $ accountQuery a)])        evenodd = if even n then "even" else "odd" :: String        -- datetransition | newm = "newmonth"        --                | newd = "newday"
Handler/RegisterR.hs view
@@ -17,8 +17,8 @@ import Hledger.Query import Hledger.Reports import Hledger.Utils-import Hledger.Cli.Options-import Hledger.Web.Options+import Hledger.Cli.CliOptions+import Hledger.Web.WebOptions  -- | The main journal/account register view, with accounts sidebar. getRegisterR :: Handler Html@@ -74,7 +74,7 @@    itemAsHtml VD{..} (n, newd, newm, _, (torig, tacct, split, acct, amt, bal)) = [hamlet|  <tr ##{date} .item.#{evenodd}.#{firstposting}.#{datetransition} title="#{show torig}" style="vertical-align:top;">- <td.date><a href="/journal##{date}">#{date}+ <td.date><a href="@{JournalR}##{date}">#{date}  <td.description title="#{show torig}">#{elideRight 30 desc}  <td.account>#{elideRight 40 acct}  <td.amount style="text-align:right; white-space:nowrap;">
Hledger/Web.hs view
@@ -3,19 +3,19 @@ -}  module Hledger.Web (-                     module Hledger.Web.Options,+                     module Hledger.Web.WebOptions,                      module Hledger.Web.Main,                      tests_Hledger_Web               ) where import Test.HUnit -import Hledger.Web.Options+import Hledger.Web.WebOptions import Hledger.Web.Main  tests_Hledger_Web :: Test tests_Hledger_Web = TestList  [- --  tests_Hledger_Web_Options+ --  tests_Hledger_Web_WebOptions  -- ,tests_Hledger_Web_Main  ]
Hledger/Web/Main.hs view
@@ -32,7 +32,7 @@ import Hledger import Hledger.Utils.UTF8IOCompat (putStrLn) import Hledger.Cli hiding (progname,prognameandversion)-import Hledger.Web.Options+import Hledger.Web.WebOptions   main :: IO ()@@ -52,10 +52,16 @@  withJournalDo' :: WebOpts -> (WebOpts -> Journal -> IO ()) -> IO () withJournalDo' opts cmd = do-  -- XXX head should be safe for now-  (head `fmap` journalFilePathFromOpts (cliopts_ opts)) >>= readJournalFile Nothing Nothing True >>=-    either error' (cmd opts . journalApplyAliases (aliasesFromOpts $ cliopts_ opts))+  f <- head `fmap` journalFilePathFromOpts (cliopts_ opts) -- 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))+ -- | The web command. web :: WebOpts -> Journal -> IO () web opts j = do@@ -63,21 +69,21 @@   let j' = filterJournalTransactions (queryFromOpts d $ reportopts_ $ cliopts_ opts) j       p = port_ opts       u = base_url_ opts-      staticRoot' = pack <$> static_root_ opts+      staticRoot = pack <$> file_url_ opts   _ <- printf "Starting web app on port %d with base url %s\n" p u   app <- makeApplication opts j' AppConfig{appEnv = Development                                           ,appPort = p                                           ,appRoot = pack u                                           ,appHost = fromString "*4"-                                          ,appExtra = Extra "" Nothing staticRoot'+                                          ,appExtra = Extra "" Nothing staticRoot                                           }   if server_ opts    then do     putStrLn "Press ctrl-c to quit"     hFlush stdout-    runSettings (setPort p defaultSettings) app+    Network.Wai.Handler.Warp.runSettings (setPort p defaultSettings) app    else do     putStrLn "Starting web browser if possible"     putStrLn "Web app will auto-exit after a few minutes with no browsers (or press ctrl-c)"     hFlush stdout-    runUrlPort p "" app+    Network.Wai.Handler.Launch.runUrlPort p "" app
− Hledger/Web/Options.hs
@@ -1,90 +0,0 @@-{-# LANGUAGE CPP #-}-module Hledger.Web.Options-where-import Prelude-#if !MIN_VERSION_base(4,8,0)-import Control.Applicative ((<$>))-#endif-import Data.Maybe-import System.Console.CmdArgs-import System.Console.CmdArgs.Explicit--import Hledger.Cli hiding (progname,version,prognameandversion)-import Settings--progname, version :: String-progname = "hledger-web"-#ifdef VERSION-version = VERSION-#else-version = ""-#endif-prognameandversion :: String-prognameandversion = progname ++ " " ++ version :: String--defbaseurlexample :: String-defbaseurlexample = (reverse $ drop 4 $ reverse $ defbaseurl defport) ++ "PORT"--webflags :: [Flag [([Char], [Char])]]-webflags = [-  flagNone ["server"]   (setboolopt "server") ("log requests, and don't browse or auto-exit")- ,flagReq  ["port"]     (\s opts -> Right $ setopt "port" s opts) "PORT" ("set the tcp port (default: "++show defport++")")- ,flagReq  ["base-url"] (\s opts -> Right $ setopt "base-url" s opts) "BASEURL" ("set the base url (default: "++defbaseurlexample++")")- ,flagReq  ["file-url"] (\s opts -> Right $ setopt "file-url" s opts) "FILEURL" ("set the static files url (default: BASEURL/static)")- ]--webmode :: Mode [([Char], [Char])]-webmode =  (mode "hledger-web" [("command","web")]-            "start serving the hledger web interface"-            (argsFlag "[PATTERNS]") []){-              modeGroupFlags = Group {-                                groupUnnamed = webflags-                               ,groupHidden = [flagNone ["binary-filename"] (setboolopt "binary-filename") "show the download filename for this executable, and exit"]-                               ,groupNamed = [generalflagsgroup1]-                               }-             ,modeHelpSuffix=[-                  -- "Reads your ~/.hledger.journal file, or another specified by $LEDGER_FILE or -f, and starts the full-window curses ui."-                 ]-           }---- hledger-web options, used in hledger-web and above-data WebOpts = WebOpts {-     server_   :: Bool-    ,base_url_ :: String-    ,port_     :: Int-    ,static_root_ :: Maybe String-    ,cliopts_  :: CliOpts- } deriving (Show)--defwebopts :: WebOpts-defwebopts = WebOpts-    def-    def-    def-    def-    def---- instance Default WebOpts where def = defwebopts--toWebOpts :: RawOpts -> IO WebOpts-toWebOpts rawopts = do-  cliopts <- rawOptsToCliOpts rawopts-  let p = fromMaybe defport $ maybeintopt "port" rawopts-  return defwebopts {-              port_ = p-             ,server_ = boolopt "server" rawopts-             ,base_url_ = maybe (defbaseurl p) stripTrailingSlash $ maybestringopt "base-url" rawopts-             ,static_root_ = stripTrailingSlash <$> maybestringopt "static-root" rawopts-             ,cliopts_   = cliopts-             }-  where-    stripTrailingSlash = reverse . dropWhile (=='/') . reverse -- yesod don't like it--checkWebOpts :: WebOpts -> IO WebOpts-checkWebOpts opts = do-  _ <- checkCliOpts $ cliopts_ opts-  return opts--getHledgerWebOpts :: IO WebOpts-getHledgerWebOpts = processArgs webmode >>= return . decodeRawOpts >>= toWebOpts >>= checkWebOpts-
+ Hledger/Web/WebOptions.hs view
@@ -0,0 +1,88 @@+{-# LANGUAGE CPP #-}+module Hledger.Web.WebOptions+where+import Prelude+#if !MIN_VERSION_base(4,8,0)+import Data.Functor.Compat ((<$>))+#endif+import Data.Maybe+import System.Console.CmdArgs+import System.Console.CmdArgs.Explicit++import Hledger.Cli hiding (progname,version,prognameandversion)+import Settings++progname, version :: String+progname = "hledger-web"+#ifdef VERSION+version = VERSION+#else+version = ""+#endif+prognameandversion :: String+prognameandversion = progname ++ " " ++ version :: String++defbaseurlexample :: String+defbaseurlexample = (reverse $ drop 4 $ reverse $ defbaseurl defport) ++ "PORT"++webflags :: [Flag [([Char], [Char])]]+webflags = [+  flagNone ["server"]   (setboolopt "server") ("log requests, and don't browse or auto-exit")+ ,flagReq  ["port"]     (\s opts -> Right $ setopt "port" s opts) "PORT" ("set the tcp port (default: "++show defport++")")+ ,flagReq  ["base-url"] (\s opts -> Right $ setopt "base-url" s opts) "BASEURL" ("set the base url (default: "++defbaseurlexample++")")+ ,flagReq  ["file-url"] (\s opts -> Right $ setopt "file-url" s opts) "FILEURL" ("set the static files url (default: BASEURL/static)")+ ]++webmode :: Mode [([Char], [Char])]+webmode =  (mode "hledger-web" [("command","web")]+            "start serving the hledger web interface"+            (argsFlag "[PATTERNS]") []){+              modeGroupFlags = Group {+                                groupUnnamed = webflags+                               ,groupHidden = [flagNone ["binary-filename"] (setboolopt "binary-filename") "show the download filename for this executable, and exit"]+                               ,groupNamed = [generalflagsgroup1]+                               }+             ,modeHelpSuffix=[+                  -- "Reads your ~/.hledger.journal file, or another specified by $LEDGER_FILE or -f, and starts the full-window curses ui."+                 ]+           }++-- hledger-web options, used in hledger-web and above+data WebOpts = WebOpts {+     server_   :: Bool+    ,port_     :: Int+    ,base_url_ :: String+    ,file_url_ :: Maybe String+    ,cliopts_  :: CliOpts+ } deriving (Show)++defwebopts :: WebOpts+defwebopts = WebOpts+    def+    def+    def+    def+    def++-- instance Default WebOpts where def = defwebopts++rawOptsToWebOpts :: RawOpts -> IO WebOpts+rawOptsToWebOpts rawopts = checkWebOpts <$> do+  cliopts <- rawOptsToCliOpts rawopts+  let p = fromMaybe defport $ maybeintopt "port" rawopts+  return defwebopts {+              port_ = p+             ,server_ = boolopt "server" rawopts+             ,base_url_ = maybe (defbaseurl p) stripTrailingSlash $ maybestringopt "base-url" rawopts+             ,file_url_ = stripTrailingSlash <$> maybestringopt "file-url" rawopts+             ,cliopts_   = cliopts+             }+  where+    stripTrailingSlash = reverse . dropWhile (=='/') . reverse -- yesod don't like it++checkWebOpts :: WebOpts -> WebOpts+checkWebOpts = id++getHledgerWebOpts :: IO WebOpts+getHledgerWebOpts = processArgs webmode >>= return . decodeRawOpts >>= rawOptsToWebOpts+
hledger-web.cabal view
@@ -1,288 +1,300 @@+-- This file has been generated from package.yaml by hpack version 0.5.4.+--+-- see: https://github.com/sol/hpack+ name:           hledger-web-version: 0.26+version:        0.27 stability:      stable category:       Finance-synopsis:       A web interface for the hledger accounting tool.-description:    -                hledger is a library and set of user tools for working-                with financial data (or anything that can be tracked in a-                double-entry accounting ledger.) It is a haskell port and-                friendly fork of John Wiegley's Ledger. hledger provides-                command-line, curses and web interfaces, and aims to be a-                reliable, practical tool for daily use.-+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+    command-line or curses-style interfaces.+    hledger is a cross-platform program for tracking money, time, or+    any other commodity, using double-entry accounting and a simple,+    editable file format. It is inspired by and largely compatible+    with ledger(1).  hledger provides command-line, curses and web+    interfaces, and aims to be a reliable, practical tool for daily+    use. license:        GPL license-file:   LICENSE author:         Simon Michael <simon@joyful.com> maintainer:     Simon Michael <simon@joyful.com> homepage:       http://hledger.org-bug-reports:    http://hledger.org/bugs-tested-with:    GHC==7.8.4, GHC==7.10.1-cabal-version:  >= 1.8+bug-reports:    http://bugs.hledger.org+cabal-version:  >= 1.10 build-type:     Simple-extra-tmp-files:+tested-with:    GHC==7.6.3, GHC==7.8.4, GHC==7.10.2+ extra-source-files:-                messages/en.msg-                config/favicon.ico-                config/keter.yaml-                config/robots.txt-                config/routes-                config/settings.yml-                static/css/bootstrap-theme.css-                static/css/bootstrap-theme.css.map-                static/css/bootstrap-theme.min.css-                static/css/bootstrap.css-                static/css/bootstrap.css.map-                static/css/bootstrap.min.css-                static/fonts/glyphicons-halflings-regular.eot-                static/fonts/glyphicons-halflings-regular.svg-                static/fonts/glyphicons-halflings-regular.ttf-                static/fonts/glyphicons-halflings-regular.woff-                static/js/bootstrap.js-                static/js/bootstrap.min.js-                static/js/excanvas.js-                static/js/excanvas.min.js-                static/js/jquery.cookie.js-                static/js/jquery.flot.canvas.js-                static/js/jquery.flot.canvas.min.js-                static/js/jquery.flot.categories.js-                static/js/jquery.flot.categories.min.js-                static/js/jquery.flot.crosshair.js-                static/js/jquery.flot.crosshair.min.js-                static/js/jquery.flot.errorbars.js-                static/js/jquery.flot.errorbars.min.js-                static/js/jquery.flot.fillbetween.js-                static/js/jquery.flot.fillbetween.min.js-                static/js/jquery.flot.image.js-                static/js/jquery.flot.image.min.js-                static/js/jquery.flot.js-                static/js/jquery.flot.min.js-                static/js/jquery.flot.navigate.js-                static/js/jquery.flot.navigate.min.js-                static/js/jquery.flot.pie.js-                static/js/jquery.flot.pie.min.js-                static/js/jquery.flot.resize.js-                static/js/jquery.flot.resize.min.js-                static/js/jquery.flot.selection.js-                static/js/jquery.flot.selection.min.js-                static/js/jquery.flot.stack.js-                static/js/jquery.flot.stack.min.js-                static/js/jquery.flot.symbol.js-                static/js/jquery.flot.symbol.min.js-                static/js/jquery.flot.threshold.js-                static/js/jquery.flot.threshold.min.js-                static/js/jquery.flot.time.js-                static/js/jquery.flot.time.min.js-                static/js/jquery.flot.tooltip.js-                static/js/jquery.flot.tooltip.min.js-                static/js/jquery.hotkeys.js-                static/js/jquery.js-                static/js/jquery.min.js-                static/js/jquery.url.js-                static/js/typeahead.bundle.js-                static/js/typeahead.bundle.min.js-                static/hledger.css-                static/hledger.js-                templates/default-layout-wrapper.hamlet-                templates/default-layout.hamlet-                templates/homepage.hamlet-                templates/homepage.julius-                templates/homepage.lucius-                templates/normalize.lucius-                tests/HomeTest.hs-                tests/TestImport.hs-                CHANGES+      CHANGES+      config/favicon.ico+      config/keter.yaml+      config/robots.txt+      config/routes+      config/settings.yml+      messages/en.msg+      static/css/bootstrap-theme.css+      static/css/bootstrap-theme.css.map+      static/css/bootstrap-theme.min.css+      static/css/bootstrap.css+      static/css/bootstrap.css.map+      static/css/bootstrap.min.css+      static/fonts/glyphicons-halflings-regular.eot+      static/fonts/glyphicons-halflings-regular.svg+      static/fonts/glyphicons-halflings-regular.ttf+      static/fonts/glyphicons-halflings-regular.woff+      static/hledger.css+      static/hledger.js+      static/js/bootstrap.js+      static/js/bootstrap.min.js+      static/js/excanvas.js+      static/js/excanvas.min.js+      static/js/jquery.cookie.js+      static/js/jquery.flot.canvas.js+      static/js/jquery.flot.canvas.min.js+      static/js/jquery.flot.categories.js+      static/js/jquery.flot.categories.min.js+      static/js/jquery.flot.crosshair.js+      static/js/jquery.flot.crosshair.min.js+      static/js/jquery.flot.errorbars.js+      static/js/jquery.flot.errorbars.min.js+      static/js/jquery.flot.fillbetween.js+      static/js/jquery.flot.fillbetween.min.js+      static/js/jquery.flot.image.js+      static/js/jquery.flot.image.min.js+      static/js/jquery.flot.js+      static/js/jquery.flot.min.js+      static/js/jquery.flot.navigate.js+      static/js/jquery.flot.navigate.min.js+      static/js/jquery.flot.pie.js+      static/js/jquery.flot.pie.min.js+      static/js/jquery.flot.resize.js+      static/js/jquery.flot.resize.min.js+      static/js/jquery.flot.selection.js+      static/js/jquery.flot.selection.min.js+      static/js/jquery.flot.stack.js+      static/js/jquery.flot.stack.min.js+      static/js/jquery.flot.symbol.js+      static/js/jquery.flot.symbol.min.js+      static/js/jquery.flot.threshold.js+      static/js/jquery.flot.threshold.min.js+      static/js/jquery.flot.time.js+      static/js/jquery.flot.time.min.js+      static/js/jquery.flot.tooltip.js+      static/js/jquery.flot.tooltip.min.js+      static/js/jquery.hotkeys.js+      static/js/jquery.js+      static/js/jquery.min.js+      static/js/jquery.url.js+      static/js/typeahead.bundle.js+      static/js/typeahead.bundle.min.js+      templates/default-layout-wrapper.hamlet+      templates/default-layout.hamlet+      templates/homepage.hamlet+      templates/homepage.julius+      templates/homepage.lucius+      templates/normalize.lucius  source-repository head-    type:     git+    type: git     location: https://github.com/simonmichael/hledger  flag threaded-    Description:   Build with support for multithreaded execution.-    Default:       True+  default: True+  description:+    Build with support for multithreaded execution.  flag dev-    Description:   Turn on development settings, like auto-reload templates.-    Default:       False+  default: False+  description:+    Turn on development settings, like auto-reload templates.  flag library-only-    Description:   Build for use with "yesod devel"-    Default:       False+  default: False+  description:+    Build for use with "yesod devel"  flag old-locale-  description: A compatibility flag, set automatically by cabal.-               If false then depend on time >= 1.5, -               if true then depend on time < 1.5 together with old-locale.   default: False+  description:+    A compatibility flag, set automatically by cabal.+    If false then depend on time >= 1.5, +    if true then depend on time < 1.5 together with old-locale.  library-    cpp-options:   -DVERSION="0.26"+    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="0.27"     if flag(dev) || flag(library-only)         cpp-options: -DDEVELOPMENT- -    ghc-options: -Wall -fno-warn-unused-do-bind -fno-warn-name-shadowing -fno-warn-missing-signatures-    ghc-options: -fno-warn-type-defaults -fno-warn-orphans- -    extensions:-                CPP-                MultiParamTypeClasses-                NoImplicitPrelude-                OverloadedStrings-                QuasiQuotes-                RecordWildCards-                TemplateHaskell-                TypeFamilies-                -- seem to not be needed at present:-                -- GADTs-                -- GeneralizedNewtypeDeriving-                -- FlexibleContexts-                -- EmptyDataDecls-                -- NoMonomorphismRestriction--    exposed-modules: Application-                     Foundation-                     Import-                     Settings-                     Settings.StaticFiles-                     Settings.Development-                     Handler.AddForm-                     Handler.Common-                     Handler.JournalR-                     Handler.RegisterR-                     Handler.RootR-                     Handler.SidebarR-                     Handler.Utils-    -- other-modules:-                     Hledger.Web-                     Hledger.Web.Main-                     Hledger.Web.Options-                     -- Setup -- stops yesod devel complaining, requires build-depends: Cabal     build-depends:-                     hledger              == 0.26-                   , hledger-lib          == 0.26-                   , base                 >= 4 && < 5-                   , base-compat          >= 0.8.1-                   , blaze-html-                   , blaze-markup-                   , bytestring-                   , clientsession-                   , cmdargs              >= 0.10 && < 0.11-                   , data-default-                   , directory-                   , filepath-                   , hjsmin-                   , http-conduit-                   , http-client-                   , HUnit-                   , conduit-extra        >= 1.1-                   , parsec               >= 3-                   , safe                 >= 0.2-                   , shakespeare          >= 2.0-                   , template-haskell-                   , text-                   , transformers-                   , wai-                   , wai-extra-                   , wai-handler-launch   >= 1.3-                   , warp-                   , yaml-                   , yesod                >= 1.4 && < 1.5-                   , yesod-core-                   , yesod-form-                   , yesod-static-                   , json-                   -- required by extra ghci utilities:-                   -- , fsnotify-                   -- , hsdev-                   -- , mtl-  if flag(old-locale)-    build-depends: time < 1.5, old-locale-  else-    build-depends: time >= 1.5-+          hledger-lib == 0.27+        , hledger == 0.27+        , base               >= 4 && < 5+        , base-compat        >= 0.8.1+        , blaze-html+        , blaze-markup+        , bytestring+        , clientsession+        , cmdargs            >= 0.10 && < 0.11+        , data-default+        , directory+        , filepath+        , hjsmin+        , http-conduit+        , http-client+        , HUnit+        , conduit-extra      >= 1.1+        , parsec             >= 3+        , safe               >= 0.2+        , shakespeare        >= 2.0+        , template-haskell+        , text+        , transformers+        , wai+        , wai-extra+        , wai-handler-launch >= 1.3+        , warp+        , yaml+        , yesod              >= 1.4 && < 1.5+        , yesod-core+        , yesod-form+        , yesod-static+        , json -executable         hledger-web-    if flag(library-only)-        Buildable: False+    if flag(old-locale)+      build-depends: time < 1.5, old-locale+    else+      build-depends: time >= 1.5 -    cpp-options:   -DVERSION="0.26"-    if flag(dev)-        cpp-options: -DDEVELOPMENT+    exposed-modules:+          Application+          Foundation+          Handler.AddForm+          Handler.Common+          Handler.JournalR+          Handler.RegisterR+          Handler.RootR+          Handler.SidebarR+          Handler.Utils+          Hledger.Web+          Hledger.Web.Main+          Hledger.Web.WebOptions+          Import+          Settings+          Settings.Development+          Settings.StaticFiles+    default-language: Haskell2010 -    ghc-options: -Wall -fno-warn-unused-do-bind -fno-warn-name-shadowing -fno-warn-missing-signatures-    ghc-options: -fno-warn-type-defaults -fno-warn-orphans+executable hledger-web+    if flag(library-only)+      buildable: False+    main-is: main.hs+    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     if flag(threaded)-        ghc-options: -threaded+      ghc-options: -threaded     if flag(dev)-        ghc-options:   -O0+      ghc-options:   -O0+    cpp-options: -DVERSION="0.27"+    if flag(dev)+      cpp-options: -DDEVELOPMENT+    build-depends:+          hledger-lib == 0.27+        , hledger == 0.27+        , base               >= 4 && < 5+        , base-compat        >= 0.8.1+        , blaze-html+        , blaze-markup+        , bytestring+        , clientsession+        , cmdargs            >= 0.10 && < 0.11+        , data-default+        , directory+        , filepath+        , hjsmin+        , http-conduit+        , http-client+        , HUnit+        , conduit-extra      >= 1.1+        , parsec             >= 3+        , safe               >= 0.2+        , shakespeare        >= 2.0+        , template-haskell+        , text+        , transformers+        , wai+        , wai-extra+        , wai-handler-launch >= 1.3+        , warp+        , yaml+        , yesod              >= 1.4 && < 1.5+        , yesod-core+        , yesod-form+        , yesod-static+        , json+        , hledger-web == 0.27 -    extensions: -                CPP-                MultiParamTypeClasses-                NoImplicitPrelude-                OverloadedStrings-                QuasiQuotes-                RecordWildCards-                TemplateHaskell-                TypeFamilies+    if flag(old-locale)+      build-depends: time < 1.5, old-locale+    else+      build-depends: time >= 1.5 -    hs-source-dirs:  app-    main-is:         main.hs+    default-language: Haskell2010 +test-suite test+    type: exitcode-stdio-1.0+    main-is: main.hs+    other-modules:+          HomeTest+          TestImport+    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="0.27"     build-depends:-                     hledger-lib          == 0.26-                   , hledger              == 0.26-                   , hledger-web          == 0.26-                   , base                 >= 4 && < 5-                   , base-compat          >= 0.8.1-                   , blaze-html-                   , blaze-markup-                   , bytestring-                   , clientsession-                   , cmdargs              >= 0.10 && < 0.11-                   , data-default-                   , directory-                   , filepath-                   , hjsmin-                   , http-conduit-                   , http-client-                   , HUnit-                   , conduit-extra-                   , parsec               >= 3-                   , safe                 >= 0.2-                   , shakespeare          >= 2.0 && < 2.1-                   , template-haskell-                   , text-                   , transformers-                   , wai-                   , wai-extra-                   , wai-handler-launch   >= 1.3-                   , warp-                   , yaml-                   , yesod                >= 1.4 && < 1.5-                   , yesod-core-                   , yesod-form-                   , yesod-static-                   , json-                   -- required by extra ghci utilities:-                   -- , fsnotify-                   -- , hsdev-                   -- , mtl-  if flag(old-locale)-    build-depends: time < 1.5, old-locale-  else-    build-depends: time >= 1.5+          hledger-lib == 0.27+        , hledger == 0.27+        , base               >= 4 && < 5+        , base-compat        >= 0.8.1+        , blaze-html+        , blaze-markup+        , bytestring+        , clientsession+        , cmdargs            >= 0.10 && < 0.11+        , data-default+        , directory+        , filepath+        , hjsmin+        , http-conduit+        , http-client+        , HUnit+        , conduit-extra      >= 1.1+        , parsec             >= 3+        , safe               >= 0.2+        , shakespeare        >= 2.0+        , template-haskell+        , text+        , transformers+        , wai+        , wai-extra+        , wai-handler-launch >= 1.3+        , warp+        , yaml+        , yesod              >= 1.4 && < 1.5+        , yesod-core+        , yesod-form+        , yesod-static+        , json+        , hledger-web+        , hspec+        , yesod-test -test-suite test-    type:              exitcode-stdio-1.0-    ghc-options: -Wall -fno-warn-unused-do-bind -fno-warn-name-shadowing -fno-warn-missing-signatures-    ghc-options: -fno-warn-type-defaults -fno-warn-orphans-    hs-source-dirs:    tests-    main-is:           main.hs-    build-depends: -                     hledger-web          == 0.26-                   , base-                   , base-compat          >= 0.8.1-                   , hspec-                   , yesod-                   , yesod-test+    if flag(old-locale)+      build-depends: time < 1.5, old-locale+    else+      build-depends: time >= 1.5++    default-language: Haskell2010
static/hledger.js view
@@ -6,7 +6,7 @@ $(document).ready(function() {    // show add form if ?add=1-  if ($.url.param('add')) { addformShow(showmsg=true); }+  if ($.url.param('add')) { addformShow(true); }    // sidebar account hover handlers   $('#sidebar td a').mouseenter(function(){ $(this).parent().addClass('mouseover'); });@@ -127,7 +127,7 @@ // ADD FORM  function addformShow(showmsg) {-  showmsg = typeof showmsg !== 'undefined' ? a : false;+  showmsg = typeof showmsg !== 'undefined' ? showmsg : false;   addformReset(showmsg);   $('#addmodal')     .on('shown.bs.modal', function (e) {@@ -138,7 +138,7 @@  // Make sure the add form is empty and clean for display. function addformReset(showmsg) {-  showmsg = typeof showmsg !== 'undefined' ? a : false;+  showmsg = typeof showmsg !== 'undefined' ? showmsg : false;   if ($('form#addform').length > 0) {     if (!showmsg) $('div#message').html('');     $('form#addform')[0].reset();
tests/main.hs view
@@ -9,7 +9,7 @@ import Yesod.Test import Test.Hspec (hspec) import Application (makeFoundation)-import Hledger.Web.Options (defwebopts)+import Hledger.Web.WebOptions (defwebopts)  import HomeTest