Documentation ¶
Index ¶
- Constants
- func New(f template.FuncMap) (*template.Template, error)
- func SetActive(a ActivableSlice, s string)
- type ActivableSlice
- type Alert
- type AlertBars
- type Badge
- type Color
- type FormInput
- type FormInputType
- type FormLabel
- type FormRadio
- type FormTextarea
- type FormValidation
- type HeadLink
- type LocalizedString
- type Login
- type Navbar
- type NavbarNode
- type Pagination
- type PaginationConfig
- type PaginationNode
- type Script
- type Sidebar
- type SidebarNode
Constants ¶
const LoginName = "login"
LoginName is the name of the login template.
Variables ¶
This section is empty.
Functions ¶
func SetActive ¶
func SetActive(a ActivableSlice, s string)
SetActive sets an active bit in a slice.
Types ¶
type ActivableSlice ¶
type ActivableSlice interface { GetChildren(i int) ActivableSlice GetMatcher(i int) *regexp.Regexp SetActive(i int, a bool) Len() int }
ActivableSlice a slice where each element has an active bit which can be set based on a string.
type FormInput ¶
type FormInput struct { ID string Type FormInputType Name string Placeholder string Label *FormLabel Value string Disabled bool Required bool Checked bool Validation *FormValidation }
FormInput is a templated form input.
type FormInputType ¶ added in v0.12.0
type FormInputType string
const ( // FormInputTypeCheckbox is a checkbox html input field. FormInputTypeCheckbox FormInputType = "checkbox" // FormInputTypeFile is a file html input field. FormInputTypeFile FormInputType = "file" // FormInputTypeHidden is a hidden html input field. FormInputTypeHidden FormInputType = "hidden" // FormInputTypePassword is a password html input field. FormInputTypePassword FormInputType = "password" // FormInputTypeRadio is a radio html input field. FormInputTypeRadio FormInputType = "radio" // FormInputTypeText is a text html input field. FormInputTypeText FormInputType = "text" )
type FormLabel ¶ added in v0.15.0
type FormLabel struct { Text LocalizedString Badge *Badge Class string }
type FormRadio ¶ added in v0.15.0
type FormRadio struct { ID string Name string Values map[string]LocalizedString Selected string Disabled bool Required bool Validation *FormValidation }
FormRadio is a templated form radio input.
func (*FormRadio) GetFormInputs ¶ added in v0.15.0
type FormTextarea ¶ added in v0.14.0
type FormTextarea struct { ID string Name string Rows int Label *FormLabel Value string Disabled bool Required bool Validation *FormValidation }
FormTextarea is a templated form textarea.
type FormValidation ¶
FormValidation is a validation response to a form input.
type HeadLink ¶
type HeadLink struct { HRef string Rel string Integrity string CrossOrigin string Sizes string Type string }
HeadLink is the data for a header link.
type LocalizedString ¶ added in v0.16.0
type Login ¶ added in v0.18.0
type Login struct { HeadLinks []HeadLink Language string TextLogin LocalizedString FormError *Alert FormInstance FormInput LogoHRef string }
Login contains the variables for the "login" template.
type Navbar ¶ added in v0.18.0
type Navbar []NavbarNode
Navbar is a navbar that can be added to a page.
func (*Navbar) ActivateFromPath ¶ added in v0.18.0
ActivateFromPath sets the active bool based on the match regex.
func (*Navbar) GetChildren ¶ added in v0.18.0
func (n *Navbar) GetChildren(i int) ActivableSlice
GetChildren returns the children of the node or nil if no children.
func (*Navbar) GetMatcher ¶ added in v0.18.0
GetMatcher returns the matcher of the node or nil if no matcher.
type NavbarNode ¶ added in v0.18.0
type NavbarNode struct {}
NavbarNode is an entry on a navbar, can be nested one level.
type Pagination ¶
type Pagination []PaginationNode
Pagination is a pagination element that can be added to a webpage.
func MakePagination ¶
func MakePagination(c *PaginationConfig) Pagination
MakePagination creates a pagination element from the provided parameters.
type PaginationConfig ¶
type PaginationConfig struct { Count int // item count DisplayCount int // how many items to display per page HRef string // href to add query to HRefCount int // count to include in the href, if 0 no count is added MaxPagination int // the max number of pages to show Page int // current page }
PaginationConfig contains the config to construct pagination.
type PaginationNode ¶
PaginationNode is an element in a pagination element.
type Sidebar ¶
type Sidebar []SidebarNode
Sidebar is a sidebar that can be added to a page.
func (*Sidebar) ActivateFromPath ¶
ActivateFromPath sets the active bool based on the match regex.
func (*Sidebar) GetChildren ¶
func (s *Sidebar) GetChildren(i int) ActivableSlice
GetChildren returns the children of the node or nil if no children.
func (*Sidebar) GetMatcher ¶
GetMatcher returns the matcher of the node or nil if no matcher.