Documentation ¶
Overview ¶
Package bootstrap3 implements some helper functions intended to be used with the Bootstrap front-end framework, version 3. See http://twitter.github.io/bootstrap/ for more details.
This package defines the "bootstrap" asset, which serves bootstrap from http://www.bootstrapcdn.com. It receives a single argument with the desired bootstrap version. Only version 3 is supported. e.g.
bootstrap: 3.0.0
This asset also supports the following options:
nojs (bool): disables loading bootstrap's javascript library e.g. bootstrap|nojs: 3.0.0
See gnd.la/template and gnd.la/template/assets for more information about template functions and the assets pipeline.
Importing this package will also register FormRenderer as the default gnd.la/form renderer and PaginatorRenderer as the default gnd.la/html/paginator renderer.
Index ¶
- Constants
- type Alignment
- type FormRenderer
- func (r *FormRenderer) BeginField(w io.Writer, field *form.Field) error
- func (r *FormRenderer) BeginInput(w io.Writer, field *form.Field, placeholder string, pos int) error
- func (r *FormRenderer) BeginLabel(w io.Writer, field *form.Field, label string, pos int) error
- func (r *FormRenderer) EndField(w io.Writer, field *form.Field) error
- func (r *FormRenderer) EndInput(w io.Writer, field *form.Field, pos int) error
- func (r *FormRenderer) EndLabel(w io.Writer, field *form.Field, pos int) error
- func (r *FormRenderer) FieldAttributes(field *form.Field, pos int) (html.Attrs, error)
- func (r *FormRenderer) InputColumns(size Size) int
- func (r *FormRenderer) LabelAttributes(field *form.Field, pos int) (html.Attrs, error)
- func (r *FormRenderer) SetInputColumns(size Size, columns int)
- func (r *FormRenderer) WriteAddOn(w io.Writer, field *form.Field, addon *form.AddOn) error
- func (r *FormRenderer) WriteError(w io.Writer, field *form.Field, err error) error
- func (r *FormRenderer) WriteHelp(w io.Writer, field *form.Field, help string) error
- type PaginatorRenderer
- type Size
Constants ¶
const ( ExtraSmall = iota - 2 Small Medium Large )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FormRenderer ¶
type FormRenderer struct {
// contains filtered or unexported fields
}
FormRenderer implements a gnd.la/form renderer using bootstrap.
func (*FormRenderer) BeginField ¶
func (*FormRenderer) BeginInput ¶
func (*FormRenderer) BeginLabel ¶
func (*FormRenderer) FieldAttributes ¶
func (*FormRenderer) InputColumns ¶
func (r *FormRenderer) InputColumns(size Size) int
InputColumns returns the number of input columns for the given ize. See also SetInputColumns.
func (*FormRenderer) LabelAttributes ¶
func (*FormRenderer) SetInputColumns ¶
func (r *FormRenderer) SetInputColumns(size Size, columns int)
SetInputColumns sets the number of grid columns used for the input fields with the given size. This is frequently used in conjunction with .form-horizontal.
func (*FormRenderer) WriteAddOn ¶
func (*FormRenderer) WriteError ¶
type PaginatorRenderer ¶
type PaginatorRenderer struct {
Size Size
}
PaginatorRenderer implements a gnd.la/html/paginator Renderer using bootstrap. The size attribute might be used to alter the size of the pager. Note that currently bootstrap paginators might be only Medium (the default), Small or Large.
func (*PaginatorRenderer) Root ¶
func (r *PaginatorRenderer) Root() *html.Node