-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A web interface for the hledger accounting tool. -- -- 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. @package hledger-web @version 0.21 module Settings.Development development :: Bool production :: Bool -- | Settings are centralized, as much as possible, into this file. This -- includes database connection settings, static file locations, etc. In -- addition, you can configure a number of different aspects of Yesod by -- overriding methods in the Yesod typeclass. That instance is declared -- in the Foundation.hs file. module Settings hledgerorgurl :: String manualurl :: String -- | The default TCP port to listen on. May be overridden with --port. defport :: Int defbaseurl :: Int -> String -- | The location of static files on your system. This is a file system -- path. The default value works properly with your scaffolded site. staticDir :: FilePath -- | The base URL for your static files. As you can see by the default -- value, this can simply be static appended to your application -- root. A powerful optimization can be serving static files from a -- separate domain name. This allows you to use a web server optimized -- for static files, more easily set expires and cache values, and avoid -- possibly costly transference of cookies on static files. For more -- information, please see: -- http:code.google.comspeedpage-speeddocsrequest.html#ServeFromCookielessDomain -- -- If you change the resource pattern for StaticR in Foundation.hs, you -- will have to make a corresponding change here. -- -- To see how this value is used, see urlRenderOverride in Foundation.hs staticRoot :: AppConfig DefaultEnv x -> Text -- | Settings for widgetFile, such as which template languages to -- support and default Hamlet settings. widgetFileSettings :: WidgetFileSettings widgetFile :: String -> Q Exp data Extra Extra :: Text -> Maybe Text -> Extra extraCopyright :: Extra -> Text -- | Google Analytics extraAnalytics :: Extra -> Maybe Text parseExtra :: DefaultEnv -> Object -> Parser Extra instance Show Extra module Settings.StaticFiles -- | use this to create your static file serving site staticSite :: IO -- Static.Static staticSite = if development then Static.staticDevel -- staticDir else Static.static staticDir -- -- | This generates easy references to files in the static directory at -- compile time, giving you compile-time verification that referenced -- files exist. Warning: any files added to your static directory during -- run-time can't be accessed this way. You'll have to use their FilePath -- or URL to access them. $(staticFiles Settings.staticDir) staticSite :: IO Static img_glyphicons_halflings_png :: StaticRoute img_glyphicons_halflings_white_png :: StaticRoute css_bootstrap_css :: StaticRoute style_css :: StaticRoute select2_png :: StaticRoute select2_min_js :: StaticRoute select2_css :: StaticRoute select2_spinner_gif :: StaticRoute jquery_url_js :: StaticRoute jquery_js :: StaticRoute jquery_flot_js :: StaticRoute hledger_js :: StaticRoute favicon_ico :: StaticRoute excanvas_min_js :: StaticRoute module Foundation -- | The site argument for your application. This can be a good place to -- keep settings and values requiring initialization before your -- application starts running, such as database connections. Every -- handler will have access to the data present here. data App App :: AppConfig DefaultEnv Extra -> Static -> Manager -> WebOpts -> IORef Journal -> App settings :: App -> AppConfig DefaultEnv Extra -- | Settings for static file serving. getStatic :: App -> Static httpManager :: App -> Manager appOpts :: App -> WebOpts appJournal :: App -> IORef Journal data AppMessage MsgHello :: AppMessage type Handler = HandlerT App IO type Widget = WidgetT App IO () resourcesApp :: [ResourceTree String] -- | A convenience alias. type AppRoute = Route App type Form x = Html -> MForm (HandlerT App IO) (FormResult x, Widget) -- | Get the Extra value, used to hold data from the settings.yml -- file. getExtra :: Handler Extra instance Show (Route App) instance Eq (Route App) instance Read (Route App) instance RenderMessage App FormMessage instance Yesod App instance RouteAttrs App instance RenderRoute App instance ParseRoute App instance RenderMessage App AppMessage module Import -- | Site root and misc. handlers. module Handler.RootR getRootR :: Handler RepHtml -- | Web handler utilities. module Handler.Utils -- | A bundle of data useful for hledger-web request handlers and -- templates. data ViewData VD :: WebOpts -> AppRoute -> Maybe Html -> Day -> Journal -> String -> Query -> [QueryOpt] -> Query -> [QueryOpt] -> Bool -> ViewData -- | the command-line options at startup opts :: ViewData -> WebOpts -- | the current route here :: ViewData -> AppRoute -- | the current UI message if any, possibly from the current request msg :: ViewData -> Maybe Html -- | today's date (for queries containing relative dates) today :: ViewData -> Day -- | the up-to-date parsed unfiltered journal j :: ViewData -> Journal -- | the current q parameter, the main query expression q :: ViewData -> String -- | a query parsed from the q parameter m :: ViewData -> Query -- | query options parsed from the q parameter qopts :: ViewData -> [QueryOpt] -- | a query parsed from the accounts sidebar query expr (a -- parameter) am :: ViewData -> Query -- | query options parsed from the accounts sidebar query expr aopts :: ViewData -> [QueryOpt] -- | current p parameter, 1 or 0 shows/hides all postings where applicable showpostings :: ViewData -> Bool -- | Make a default ViewData, using day 0 as today's date. nullviewdata :: ViewData -- | Make a ViewData using the given date and request parameters, and -- defaults elsewhere. viewdataWithDateAndParams :: Day -> String -> String -> String -> ViewData -- | Gather data used by handlers and templates in the current request. getViewData :: Handler ViewData -- | Get the message set by the last request, or the newer message -- provided, if any. getMessageOr :: Maybe String -> Handler (Maybe Html) numbered :: [a] -> [(Int, a)] dayToJsTimestamp :: Day -> Integer chomp :: String -> String -- | Common page components and rendering helpers. For global page layout, -- see Application.hs. module Handler.Common -- | Global toolbar/heading area. topbar :: ViewData -> HtmlUrl AppRoute -- | The sidebar used on most views. sidebar :: ViewData -> HtmlUrl AppRoute -- | ] where u' = (dest, if null q then [] else [(q, pack q)]) style -- | dest == here = navlinkcurrent | otherwise = navlink :: -- Text -- -- ] -- -- Search form for entering custom queries to filter journal data. searchform :: ViewData -> HtmlUrl AppRoute -- | Add transaction form. addform :: Text -> ViewData -> HtmlUrl AppRoute -- | Edit journal form. editform :: ViewData -> HtmlUrl AppRoute -- | Import journal form. importform :: HtmlUrl AppRoute journalselect :: [(FilePath, String)] -> HtmlUrl AppRoute -- | Link to a topic in the manual. helplink :: String -> String -> HtmlUrl AppRoute nulltemplate :: HtmlUrl AppRoute -- | Render an AccountsReport as html. accountsReportAsHtml :: WebOpts -> ViewData -> AccountsReport -> HtmlUrl AppRoute accountQuery :: AccountName -> String accountOnlyQuery :: AccountName -> String accountUrl :: AppRoute -> AccountName -> (AppRoute, [(Text, Text)]) -- | Render an EntriesReport as html for the journal entries view. entriesReportAsHtml :: WebOpts -> ViewData -> EntriesReport -> HtmlUrl AppRoute -- | Render a TransactionsReport as html for the formatted journal -- view. journalTransactionsReportAsHtml :: WebOpts -> ViewData -> TransactionsReport -> HtmlUrl AppRoute registerReportHtml :: WebOpts -> ViewData -> TransactionsReport -> HtmlUrl AppRoute registerItemsHtml :: WebOpts -> ViewData -> TransactionsReport -> HtmlUrl AppRoute -- | Generate javascript/html for a register balance line chart based on -- the provided TransactionsReportItems. registerChartHtml :: -- forall t (t1 :: * -> *) t2 t3 t4 t5. Data.Foldable.Foldable t1 -- => t1 (Transaction, t2, t3, t4, t5, MixedAmount) -> t -> -- Text.Blaze.Internal.HtmlM () registerChartHtml :: [[TransactionsReportItem]] -> HtmlUrl AppRoute numberTransactionsReportItems :: [TransactionsReportItem] -> [(Int, Bool, Bool, Bool, TransactionsReportItem)] mixedAmountAsHtml :: MixedAmount -> Html -- | POST helpers. module Handler.Post -- | Handle a post from any of the edit forms. handlePost :: Handler RepHtml -- | Handle a post from the transaction add form. handleAdd :: Handler RepHtml -- | Handle a post from the journal edit form. handleEdit :: Handler RepHtml -- | Handle a post from the journal import form. handleImport :: Handler RepHtml -- | /journal handlers. module Handler.JournalR -- | The formatted journal view, with sidebar. getJournalR :: Handler RepHtml postJournalR :: Handler RepHtml -- | journaledit handlers. module Handler.JournalEditR -- | The journal editform, no sidebar. getJournalEditR :: Handler RepHtml postJournalEditR :: Handler RepHtml -- | journalentries handlers. module Handler.JournalEntriesR -- | The journal entries view, with sidebar. getJournalEntriesR :: Handler RepHtml postJournalEntriesR :: Handler RepHtml -- | /register handlers. module Handler.RegisterR -- | The main journal/account register view, with accounts sidebar. getRegisterR :: Handler RepHtml postRegisterR :: Handler RepHtml module Application makeApplication :: WebOpts -> Journal -> AppConfig DefaultEnv Extra -> IO Application getApplicationDev :: IO (Int, Application) makeFoundation :: AppConfig DefaultEnv Extra -> IO App instance YesodDispatch App