yesod-paginator-0.9: A pagination approach for yesod

Safe HaskellNone




getCurrentPage :: Yesod m => HandlerT m IO IntSource

looks up the "p" GET param and converts it to an Int. returns a default of 1 when conversion fails.

paginationWidget :: Yesod m => PageWidgetConfig -> PageWidget mSource

A widget showing pagination links. Follows bootstrap principles. Utilizes a "p" GET param but leaves all other GET params intact.

defaultPageWidgetConfig :: PageWidgetConfigSource

Default widget config provided for easy overriding of only some fields.

type PageWidget m = Int -> Int -> Int -> WidgetT m IO ()Source

currentPage, itemsPerPage, totalItems -> widget

data PageWidgetConfig Source




prevText :: Text

The text for the 'previous page' link.

nextText :: Text

The text for the 'next page' link.

pageCount :: Int

The number of page links to show

ascending :: Bool

Whether to list pages in ascending order.

showEllipsis :: Bool

Whether to show an ellipsis if there are more pages than pageCount

listClasses :: [Text]

Additional classes for top level list