Documentation
¶
Index ¶
- Constants
- Variables
- func NewDefaultSubmitBtn() *dhtmlform.FormControlElement
- func NewDeleteBtn(href, confirmMessage string) *dhtmlbs.BtnElement
- func NewEditBtn(href string) *dhtmlbs.BtnElement
- func NewIconBtn(href, icon string, label any) *dhtmlbs.BtnElement
- func NewIconBtnR(icon string, label any, routeRef any, routeArgs ...any) *dhtmlbs.BtnElement
- func NewIconSubmitBtn(icon, label string) *dhtmlform.FormControlElement
- func NewSmBtn(href, icon string) *dhtmlbs.BtnElement
- func NewSmBtnR(icon string, routeRef any, routeArgs ...any) *dhtmlbs.BtnElement
- func RenderError(message any) *dhtml.HtmlPiece
- func RenderErrorf(message string, args ...any) *dhtml.HtmlPiece
- func RenderInfo(message any) *dhtml.HtmlPiece
- func RenderInfof(message string, args ...any) *dhtml.HtmlPiece
- func RenderWarning(message any) *dhtml.HtmlPiece
- func RenderWarningf(message string, args ...any) *dhtml.HtmlPiece
- func SetDefaultFAClass(class string)
- type AssetsRouteControllerType
- type BtnPanelElement
- func (e *BtnPanelElement) AddBtn(btn *dhtmlbs.BtnElement) *BtnPanelElement
- func (e *BtnPanelElement) AddIconBtn(href, icon, label string) *BtnPanelElement
- func (e *BtnPanelElement) Class(v any) *BtnPanelElement
- func (e *BtnPanelElement) GetTags() dhtml.TagList
- func (e *BtnPanelElement) IsEmpty() bool
- type IconElement
- type PageBuilderBase
- func (p *PageBuilderBase) GetDocument() *dhtml.HtmlDocument
- func (p *PageBuilderBase) GetMain() *dhtml.HtmlPiece
- func (p *PageBuilderBase) GetTitle() string
- func (p *PageBuilderBase) Main(v any) *PageBuilderBase
- func (p *PageBuilderBase) NewFormContext() *dhtmlform.FormContext
- func (p *PageBuilderBase) Render() (string, error)
- func (p *PageBuilderBase) Title(title string) *PageBuilderBase
- type TableElement
- type TimestampElement
- func (e *TimestampElement) Class(v ...any) *TimestampElement
- func (e *TimestampElement) Format(tsFormat string) *TimestampElement
- func (e *TimestampElement) GetTags() dhtml.TagList
- func (e *TimestampElement) Icon(icon string) *TimestampElement
- func (e *TimestampElement) SmallMuted() *TimestampElement
Constants ¶
const ( FaIconList = "list" FaIconAdd = "plus" FaIconView = "eye" FaIconEdit = "edit" FaIconDelete = "trash" FaIconCount = "abacus" FaIconDevMode = "person-digging" FaIconSearch = "magnifying-glass" FaIconHome = "home" FaIconBack = "arrow-left-from-arc" FaIconYes = "check" FaIconNo = "ban" FaIconReload = "rotate-right" FaIconUpdate = "rotate" FaIconOptions = "cog" FaIconInfo = "circle-info" FaIconWarning = "triangle-exclamation" FaIconError = "square-xmark" )
const IconTimestamp = "clock"
Variables ¶
var AssetsRoute mbr.Route
This route should be added to root route controller. Example: func (c *RootController) MtWebAssets() mbr.Route { return mtweb.AssetsRoute }
Functions ¶
func NewDefaultSubmitBtn ¶
func NewDefaultSubmitBtn() *dhtmlform.FormControlElement
func NewDeleteBtn ¶
func NewDeleteBtn(href, confirmMessage string) *dhtmlbs.BtnElement
func NewEditBtn ¶
func NewEditBtn(href string) *dhtmlbs.BtnElement
func NewIconBtn ¶
func NewIconBtn(href, icon string, label any) *dhtmlbs.BtnElement
func NewIconBtnR ¶
Same as NewIconBtn but with route args instead of raw href
func NewIconSubmitBtn ¶
func NewIconSubmitBtn(icon, label string) *dhtmlform.FormControlElement
func NewSmBtn ¶
func NewSmBtn(href, icon string) *dhtmlbs.BtnElement
small btm a-la "edit" but with custom icon
func NewSmBtnR ¶
func NewSmBtnR(icon string, routeRef any, routeArgs ...any) *dhtmlbs.BtnElement
Same as NewSmBtn but with route args instead of raw href
func RenderError ¶
func RenderInfo ¶
func RenderWarning ¶
func SetDefaultFAClass ¶
func SetDefaultFAClass(class string)
Types ¶
type AssetsRouteControllerType ¶
type AssetsRouteControllerType struct {
mbr.ControllerBase
}
func (*AssetsRouteControllerType) MtWebAssets ¶
func (c *AssetsRouteControllerType) MtWebAssets() mbr.Route
type BtnPanelElement ¶
type BtnPanelElement struct {
// contains filtered or unexported fields
}
=================== Buttons panel ====================
func NewBtnPanel ¶
func NewBtnPanel() *BtnPanelElement
func (*BtnPanelElement) AddBtn ¶
func (e *BtnPanelElement) AddBtn(btn *dhtmlbs.BtnElement) *BtnPanelElement
func (*BtnPanelElement) AddIconBtn ¶
func (e *BtnPanelElement) AddIconBtn(href, icon, label string) *BtnPanelElement
func (*BtnPanelElement) Class ¶
func (e *BtnPanelElement) Class(v any) *BtnPanelElement
func (*BtnPanelElement) GetTags ¶
func (e *BtnPanelElement) GetTags() dhtml.TagList
func (*BtnPanelElement) IsEmpty ¶
func (e *BtnPanelElement) IsEmpty() bool
type IconElement ¶
type IconElement struct {
Name string
// contains filtered or unexported fields
}
func Icon ¶
func Icon(icon_name string) *IconElement
func IconNo ¶
func IconNo() *IconElement
func IconYes ¶
func IconYes() *IconElement
func IconYesNo ¶
func IconYesNo(v any) *IconElement
func IconYesNoLabel ¶
func IconYesNoLabel(v any, labels ...any) *IconElement
Yes/No icon with label. First arg is value itself. Second arg - label is for YES value Third arg - label is for NO value Fourth arg - title is for YES icon Fifth arg - title is for NO icon
func IconYesNoTitle ¶
func IconYesNoTitle(v any, yesTitle, noTitle string) *IconElement
func (*IconElement) Class ¶
func (i *IconElement) Class(v ...any) *IconElement
Classes applied to icon itself
func (*IconElement) ElementClass ¶
func (i *IconElement) ElementClass(v ...any) *IconElement
func (*IconElement) GetTags ¶
func (i *IconElement) GetTags() dhtml.TagList
func (*IconElement) Label ¶
func (i *IconElement) Label(v any) *IconElement
func (*IconElement) Title ¶
func (i *IconElement) Title(s string) *IconElement
type PageBuilderBase ¶
type PageBuilderBase struct {
Ctx *mbr.MbrContext
Regions dhtml.NamedHtmlPieces
RenderF func() error
BuildHeadTitleF func() string
// contains filtered or unexported fields
}
func NewPageBuilderBase ¶
func NewPageBuilderBase(ctx *mbr.MbrContext) PageBuilderBase
func (*PageBuilderBase) GetDocument ¶
func (p *PageBuilderBase) GetDocument() *dhtml.HtmlDocument
very root html document element, to be used for rendering page content
func (*PageBuilderBase) GetMain ¶
func (p *PageBuilderBase) GetMain() *dhtml.HtmlPiece
contents of the "main" region
func (*PageBuilderBase) GetTitle ¶
func (p *PageBuilderBase) GetTitle() string
func (*PageBuilderBase) Main ¶
func (p *PageBuilderBase) Main(v any) *PageBuilderBase
Adds piece to "main" region by Default every page builder has at least one region called "main"
func (*PageBuilderBase) NewFormContext ¶
func (p *PageBuilderBase) NewFormContext() *dhtmlform.FormContext
Builds new dhtml.FormContext to be used with form builder
func (*PageBuilderBase) Render ¶
func (p *PageBuilderBase) Render() (string, error)
Renders the page to HTML string
func (*PageBuilderBase) Title ¶
func (p *PageBuilderBase) Title(title string) *PageBuilderBase
Sets page's title
type TableElement ¶
type TableElement struct {
dhtml.TableElement
// contains filtered or unexported fields
}
Bootstrap styled table with some some utilities
func NewTable ¶
func NewTable() *TableElement
func (*TableElement) CountTitle ¶
func (t *TableElement) CountTitle(v string) *TableElement
Sets title for count element. Count element is not rendered if title is empty string.
func (*TableElement) GetTags ¶
func (t *TableElement) GetTags() (out dhtml.TagList)
type TimestampElement ¶
type TimestampElement struct {
// contains filtered or unexported fields
}
Clock icon with datetime
func NewTimestamp ¶
func NewTimestamp(ts time.Time) *TimestampElement
func (*TimestampElement) Class ¶
func (e *TimestampElement) Class(v ...any) *TimestampElement
Element classes.
func (*TimestampElement) Format ¶
func (e *TimestampElement) Format(tsFormat string) *TimestampElement
Set date and time format (default is time.DateTime).
func (*TimestampElement) GetTags ¶
func (e *TimestampElement) GetTags() dhtml.TagList
func (*TimestampElement) Icon ¶
func (e *TimestampElement) Icon(icon string) *TimestampElement
icon name. empty = no icon. default "clock".
func (*TimestampElement) SmallMuted ¶
func (e *TimestampElement) SmallMuted() *TimestampElement