mtweb

package module
v0.0.0-...-65313d4 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: MIT Imports: 11 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

mtweb

MiTo Team's GoLang toolset for web application development

Documentation

Index

Constants

View Source
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"
)
View Source
const IconTimestamp = "clock"

Variables

View Source
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

func NewIconBtnR(icon string, label any, routeRef any, routeArgs ...any) *dhtmlbs.BtnElement

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 RenderError(message any) *dhtml.HtmlPiece

func RenderErrorf

func RenderErrorf(message string, args ...any) *dhtml.HtmlPiece

func RenderInfo

func RenderInfo(message any) *dhtml.HtmlPiece

func RenderInfof

func RenderInfof(message string, args ...any) *dhtml.HtmlPiece

func RenderWarning

func RenderWarning(message any) *dhtml.HtmlPiece

func RenderWarningf

func RenderWarningf(message string, args ...any) *dhtml.HtmlPiece

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 (*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

Jump to

Keyboard shortcuts

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