yesod-colonnade-0.4: Helper functions for using yesod with colonnade

Safe HaskellNone
LanguageHaskell2010

Yesod.Colonnade

Contents

Description

Build HTML tables using yesod and colonnade. To learn how to use this module, first read the documentation for colonnade, and then read the documentation for blaze-colonnade. This library and blaze-colonnade are entirely distinct; neither depends on the other. However, the interfaces they expose are very similar, and the explanations provided counterpart are sufficient to understand this library.

Synopsis

Build

data Cell site Source #

The attributes that will be applied to a td and the HTML content that will go inside it.

Constructors

Cell 

Fields

Instances

IsString (Cell site) Source # 

Methods

fromString :: String -> Cell site #

Monoid (Cell site) Source # 

Methods

mempty :: Cell site #

mappend :: Cell site -> Cell site -> Cell site #

mconcat :: [Cell site] -> Cell site #

cell :: WidgetT site IO () -> Cell site Source #

Create a Cell from a Widget

stringCell :: String -> Cell site Source #

Create a Cell from a String

textCell :: Text -> Cell site Source #

Create a Cell from a Text

builderCell :: Builder -> Cell site Source #

Create a Cell from a text builder

anchorCell Source #

Arguments

:: (a -> Route site)

Route that will go in href attribute

-> (a -> WidgetT site IO ())

Content wrapped by a tag

-> a

Value

-> Cell site 

Creata a Cell whose content is hyperlinked by wrapping it in an <a>.

Apply

encodeHeadedWidgetTable Source #

Arguments

:: Foldable f 
=> Attribute

Attributes of table element

-> Colonnade Headed (WidgetT site IO ()) a

How to encode data as columns

-> f a

Rows of data

-> WidgetT site IO () 

encodeHeadlessWidgetTable Source #

Arguments

:: Foldable f 
=> Attribute

Attributes of <table> element

-> Colonnade Headless (WidgetT site IO ()) a

How to encode data as columns

-> f a

Rows of data

-> WidgetT site IO () 

encodeHeadedCellTable Source #

Arguments

:: Foldable f 
=> Attribute

Attributes of table element

-> Colonnade Headed (Cell site) a

How to encode data as a row

-> f a

Rows of data

-> WidgetT site IO () 

If you are using the bootstrap css framework, then you may want to call this with the first argument as:

encodeHeadedCellTable (HA.class_ "table table-striped") ...

encodeHeadlessCellTable Source #

Arguments

:: Foldable f 
=> Attribute

Attributes of table element

-> Colonnade Headless (Cell site) a

How to encode data as columns

-> f a

Rows of data

-> WidgetT site IO () 

encodeDefinitionTable Source #

Arguments

:: Attribute

Attributes of table element.

-> Colonnade Headed (Cell site) a

How to encode data as a row

-> a

The value to display

-> WidgetT site IO () 

A two-column table with the header content displayed in the first column and the data displayed in the second column. Note that the generated HTML table does not have a thead.

encodeListItems Source #

Arguments

:: (WidgetT site IO () -> WidgetT site IO ())

Wrapper for items, often ul

-> (WidgetT site IO () -> WidgetT site IO () -> WidgetT site IO ())

Combines header with data

-> Colonnade Headed (Cell site) a

How to encode data as a row

-> a

The value to display

-> WidgetT site IO () 

This determines the attributes that are added to the individual lis by concatenating the header's attributes with the data's attributes.