Documentation
¶
Index ¶
- Constants
- func MakePagination(c *libtemplate.PaginationConfig) libtemplate.Pagination
- func New(tokz *token.Tokenizer) (*template.Template, error)
- type AdminAccount
- type AdminHome
- type AdminInstance
- type AdminInstanceView
- type Breadcrumb
- type Common
- func (t *Common) AddFooterExtraScript(s string)
- func (t *Common) AddFooterScript(s libtemplate.Script)
- func (t *Common) AddHeadLink(l libtemplate.HeadLink)
- func (t *Common) SetAccount(account *models.Account)
- func (t *Common) SetLanguage(l string)
- func (t *Common) SetLocalizer(l *language.Localizer)
- func (t *Common) SetNavbar(nodes Navbar)
- func (t *Common) SetNavbarDark(dark bool)
- type Error
- type Home
- type InitTemplate
- type Login
- type Navbar
- type NavbarNode
- type Settings
Constants ¶
const AdminAccountName = "admin_account"
AdminAccountName is the name of the admin block list template.
const AdminHomeName = "admin_home"
AdminHomeName is the name of the admin home template.
const AdminInstanceName = "admin_instance"
AdminInstanceName is the name of the admin block list template.
const AdminInstanceViewName = "admin_instance_view"
AdminInstanceViewName is the name of the admin block list template.
const ErrorName = "error"
ErrorName is the name of the error template.
const HomeName = "home"
HomeName is the name of the home template.
const LoginName = "login"
LoginName is the name of the login template.
const SettingsName = "settings"
SettingsName is the name of the home template.
Variables ¶
This section is empty.
Functions ¶
func MakePagination ¶
func MakePagination(c *libtemplate.PaginationConfig) libtemplate.Pagination
MakePagination creates a pagination element from the provided parameters.
Types ¶
type AdminAccount ¶
type AdminAccount struct {
Common
Accounts []*models.Account
Pagination libtemplate.Pagination
}
AdminAccount contains the variables for the admin block list template.
type AdminHome ¶
type AdminHome struct {
Common
}
AdminHome contains the variables for the admin home template.
type AdminInstance ¶
type AdminInstance struct {
Common
Instances []*models.Instance
Pagination libtemplate.Pagination
}
AdminInstance contains the variables for the admin block list template.
type AdminInstanceView ¶
type AdminInstanceView struct {
Common
Instance *models.Instance
Breadcrumbs *[]Breadcrumb
FormAddTeamMemberError *libtemplate.Alert
FormAddTeamMemberAction libtemplate.FormInput
FormAddTeamMemberAccount libtemplate.FormInput
FormDeleteTeamMemberError *libtemplate.Alert
FormDeleteTeamMemberAction libtemplate.FormInput
FormDeleteTeamMemberToken libtemplate.FormInput
FormTransferOwnershipError *libtemplate.Alert
FormTransferOwnershipAction libtemplate.FormInput
FormTransferOwnershipToken libtemplate.FormInput
FormToggleS3CDNError *libtemplate.Alert
FormToggleS3CDNAction libtemplate.FormInput
}
AdminInstanceView contains the variables for the admin block list template.
type Breadcrumb ¶
type Common ¶
type Common struct {
Language string
Localizer *language.Localizer
Account *models.Account
Alerts *[]libtemplate.Alert
HeadLinks []libtemplate.HeadLink
PageTitle string
}
Common contains the variables used in nearly every template.
func (*Common) AddFooterExtraScript ¶
AddFooterExtraScript adds a footer script to the template.
func (*Common) AddFooterScript ¶
func (t *Common) AddFooterScript(s libtemplate.Script)
AddFooterScript adds a footer script to the template.
func (*Common) AddHeadLink ¶
func (t *Common) AddHeadLink(l libtemplate.HeadLink)
AddHeadLink adds a headder link to the template.
func (*Common) SetAccount ¶
SetAccount sets the currently logged-in account.
func (*Common) SetLanguage ¶
SetLanguage sets the template's default language.
func (*Common) SetLocalizer ¶
SetLocalizer sets the localizer the template will use to generate text.
func (*Common) SetNavbarDark ¶
SetNavbarDark sets the navbar theme.
type Error ¶
type Error struct {
Common
Header string
Image string
SubHeader string
Paragraph string
ButtonHRef string
ButtonLabel string
}
Error contains the variables for the error template.
type InitTemplate ¶
type InitTemplate interface {
AddHeadLink(l libtemplate.HeadLink)
SetAccount(account *models.Account)
SetLanguage(l string)
SetLocalizer(l *language.Localizer)
}
InitTemplate are the functions a template implementing Common will have.
type Navbar ¶
type Navbar []NavbarNode
Navbar is a navbar that can be added to a page.
func (*Navbar) ActivateFromPath ¶
ActivateFromPath sets the active bool based on the match regex.
func (*Navbar) GetChildren ¶
func (n *Navbar) GetChildren(i int) libtemplate.ActivableSlice
GetChildren returns the children of the node or nil if no children.
func (*Navbar) GetMatcher ¶
GetMatcher returns the matcher of the node or nil if no matcher.
type NavbarNode ¶
type NavbarNode struct {
}
NavbarNode is an entry on a navbar, can be nested one level.
type Settings ¶
type Settings struct {
Common
FormGeneralAccount libtemplate.FormInput
FormGeneralIsMod libtemplate.FormInput
FormGeneralIsAdmin libtemplate.FormInput
}
Settings contains the variables for the home template.