bootstrap3

package
v0.0.0-...-3518944 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2017 License: MPL-2.0 Imports: 8 Imported by: 0

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

View Source
const (
	ExtraSmall = iota - 2
	Small
	Medium
	Large
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Alignment

type Alignment int
const (
	Left Alignment = iota
	Center
	Right
)

type FormRenderer

type FormRenderer struct {
	// contains filtered or unexported fields
}

FormRenderer implements a gnd.la/form renderer using bootstrap.

func (*FormRenderer) BeginField

func (r *FormRenderer) BeginField(w io.Writer, field *form.Field) error

func (*FormRenderer) BeginInput

func (r *FormRenderer) BeginInput(w io.Writer, field *form.Field, placeholder string, pos int) error

func (*FormRenderer) BeginLabel

func (r *FormRenderer) BeginLabel(w io.Writer, field *form.Field, label string, pos int) error

func (*FormRenderer) EndField

func (r *FormRenderer) EndField(w io.Writer, field *form.Field) error

func (*FormRenderer) EndInput

func (r *FormRenderer) EndInput(w io.Writer, field *form.Field, pos int) error

func (*FormRenderer) EndLabel

func (r *FormRenderer) EndLabel(w io.Writer, field *form.Field, pos int) error

func (*FormRenderer) FieldAttributes

func (r *FormRenderer) FieldAttributes(field *form.Field, pos int) (html.Attrs, error)

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 (r *FormRenderer) LabelAttributes(field *form.Field, pos int) (html.Attrs, error)

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 (r *FormRenderer) WriteAddOn(w io.Writer, field *form.Field, addon *form.AddOn) error

func (*FormRenderer) WriteError

func (r *FormRenderer) WriteError(w io.Writer, field *form.Field, err error) error

func (*FormRenderer) WriteHelp

func (r *FormRenderer) WriteHelp(w io.Writer, field *form.Field, help string) error

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) Node

func (r *PaginatorRenderer) Node(page int, flags paginator.PageFlags) *html.Node

func (*PaginatorRenderer) Root

func (r *PaginatorRenderer) Root() *html.Node

type Size

type Size int

func (Size) String

func (s Size) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL