view

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2025 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Create = Templates.View("create_category",
	DIV(
		InputText(args.FormName.Name(), attr.Name(args.FormName.Name())),
		InputSubmit("", attr.Value("save")),
	),
)
View Source
var Table = Templates.ListView("list_category",
	TR(
		TD(TablePos.ID),
		TD(TablePos.Name),
		TD(TablePos.EditLink.String()),
		TD(TablePos.DeleteLink.String()),
	),
	TablePos.rows,
	DIV(
		TablePos.CreateLink.String(),
		TABLE(
			THEAD(
				TR(
					TH(
						SPAN("ID"),
						SPAN(html.Classes("icon", "is-small"),
							I(html.Classes("fas", "fa-arrow-down"), ATTR("aria-hidden", "true")),
							TablePos.SortByIDLink.String(),
						),
					),
					TH(
						SPAN("Name"),
						SPAN(html.Classes("icon", "is-small"),
							I(html.Classes("fas", "fa-arrow-down"), ATTR("aria-hidden", "true")),
							TablePos.SortByNameLink.String(),
						),
					),
					TH(),
					TH(),
				),
			),
			TBODY(TablePos.rows),
		),
	),
)
View Source
var TablePos = struct {
	CreateLink     html.Pos
	EditLink       html.Pos
	DeleteLink     html.Pos
	ID             html.Pos
	Name           html.Pos
	rows           html.Pos
	SortByIDLink   html.Pos
	SortByNameLink html.Pos
}{
	HTML("create-url").Position(),
	HTML("edit-url").Position(),
	HTML("delete-url").Position(),
	Text("id").Position(),
	Text("name").Position(),
	HTML("rows").Position(),
	HTML("sort-by-id-url").Position(),
	HTML("sort-by-name-url").Position(),
}
View Source
var Templates = crudl.Templates(embedfsys, path.Relative("cached_templates/"))
View Source
var Update = Templates.View("update_category",
	DIV(
		InputText(
			args.FormName.Name(),
			attr.Value(UpdatePos.Name.String()),
		),
		InputSubmit("", attr.Value("save")),
	),
)
View Source
var UpdatePos = struct {
	Name html.Pos
}{
	Text("name").Position(),
}

Functions

func Content

func Content(inner ...any) *html.Element

func Layout

func Layout(title string, inner ...any) html.HTML
func Modal(inner ...any) *html.Element

func WrapInCard

func WrapInCard(title string, inner ...any) *html.Element

Types

This section is empty.

Jump to

Keyboard shortcuts

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