hledger-web-1.12: Web interface for the hledger accounting tool

Safe HaskellNone
LanguageHaskell2010

Hledger.Web.Foundation

Contents

Description

Define the web application's foundation, in the usual Yesod style. See a default Yesod app's comments for more details of each part.

Synopsis

Documentation

data App Source #

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.

Constructors

App 

Fields

Instances
RouteAttrs App Source # 
Instance details

Defined in Hledger.Web.Foundation

Methods

routeAttrs :: Route App -> Set Text #

ParseRoute App Source # 
Instance details

Defined in Hledger.Web.Foundation

Methods

parseRoute :: ([Text], [(Text, Text)]) -> Maybe (Route App) #

RenderRoute App Source # 
Instance details

Defined in Hledger.Web.Foundation

Associated Types

data Route App :: Type #

Methods

renderRoute :: Route App -> ([Text], [(Text, Text)]) #

Yesod App Source # 
Instance details

Defined in Hledger.Web.Foundation

YesodDispatch App Source # 
Instance details

Defined in Hledger.Web.Application

RenderMessage App FormMessage Source # 
Instance details

Defined in Hledger.Web.Foundation

Methods

renderMessage :: App -> [Lang] -> FormMessage -> Text #

Eq (Route App) Source # 
Instance details

Defined in Hledger.Web.Foundation

Methods

(==) :: Route App -> Route App -> Bool #

(/=) :: Route App -> Route App -> Bool #

Read (Route App) Source # 
Instance details

Defined in Hledger.Web.Foundation

Show (Route App) Source # 
Instance details

Defined in Hledger.Web.Foundation

data Route App Source # 
Instance details

Defined in Hledger.Web.Foundation

Creates the route datatype AppRoute. Every valid URL in your

Creates the associated type:

Creates the value resourcesApp which contains information on the

type AppRoute = Route App Source #

A convenience alias.

data ViewData Source #

A bundle of data useful for hledger-web request handlers and templates.

Constructors

VD 

Fields

  • opts :: WebOpts

    the command-line options at startup

  • today :: Day

    today's date (for queries containing relative dates)

  • j :: Journal

    the up-to-date parsed unfiltered journal

  • q :: Text

    the current q parameter, the main query expression

  • m :: Query

    a query parsed from the q parameter

  • qopts :: [QueryOpt]

    query options parsed from the q parameter

  • caps :: [Capability]

    capabilities enabled for this request

Instances
Show ViewData Source # 
Instance details

Defined in Hledger.Web.Foundation

getViewData :: Handler ViewData Source #

Gather data used by handlers and templates in the current request.

shouldShowSidebar :: Handler Bool Source #

Find out if the sidebar should be visible. Show it, unless there is a showsidebar cookie set to "0", or a ?sidebar=0 query parameter.

getCurrentJournal :: IORef Journal -> CliOpts -> Day -> Handler (Journal, Maybe String) Source #

Update our copy of the journal if the file changed. If there is an error while reloading, keep the old one and return the error, and set a ui message.

Orphan instances

Show Markup Source # 
Instance details