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

Safe HaskellNone
LanguageHaskell2010

Yesod.Colonnade

Contents

Synopsis

Build Encoding

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

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

Content wrapped by a

-> a

Value

-> Cell site 

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

Apply Encoding

table Source #

Arguments

:: Foldable f 
=> [(Text, Text)]

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:

table [("class","table table-striped")] ...

tableHeadless Source #

Arguments

:: Foldable f 
=> [(Text, Text)]

Attributes of table element

-> Colonnade Headless (Cell site) a

How to encode data as a row

-> f a

Rows of data

-> WidgetT site IO () 

definitionTable Source #

Arguments

:: [(Text, Text)]

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.

listItems 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.