Safe Haskell | None |
---|---|
Language | Haskell2010 |
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
- data App = App {}
- type Handler = HandlerFor App
- type Widget = WidgetFor App ()
- resourcesApp :: [ResourceTree String]
- type AppRoute = Route App
- type Form x = Html -> MForm (HandlerFor App) (FormResult x, Widget)
- data ViewData = VD {}
- getViewData :: Handler ViewData
- checkServerSideUiEnabled :: Handler ()
- shouldShowSidebar :: Handler Bool
- getCurrentJournal :: IORef Journal -> CliOpts -> Day -> Handler (Journal, Maybe String)
Documentation
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.
App | |
|
Instances
Creates the route datatype AppRoute. Every valid URL in your
Creates the associated type:
Creates the value resourcesApp which contains information on the
type Handler = HandlerFor App Source #
type Form x = Html -> MForm (HandlerFor App) (FormResult x, Widget) Source #
A bundle of data useful for hledger-web request handlers and templates.
VD | |
|
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.