html

package
v0.0.0-...-c56566d Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SiteData = &Site{
	Title: "Wadoh",
}

Functions

func ErrorFromContext

func ErrorFromContext(ctx context.Context) error

func FlashFromContext

func FlashFromContext(ctx context.Context) string

func NewErrorContext

func NewErrorContext(parent context.Context, err error) context.Context

func NewFlashContext

func NewFlashContext(parent context.Context, s string) context.Context

func StaticFs

func StaticFs() fs.FS

func TemplatesFS

func TemplatesFS() fs.FS

Types

type DevicesDetailBlock

type DevicesDetailBlock struct {
	Title      string
	Device     *devices.Device
	DetailPane *DevicesDetailPaneBlock
}

func (*DevicesDetailBlock) Renderer

func (b *DevicesDetailBlock) Renderer(fs fs.FS, site *Site) (string, RenderFunc)

type DevicesDetailPaneBlock

type DevicesDetailPaneBlock struct {
	Device *devices.Device

	SubAPIKey     bool
	SubTryMessage bool
	SubWebhook    bool
	SubMore       bool
}

func (*DevicesDetailPaneBlock) Renderer

func (t *DevicesDetailPaneBlock) Renderer(fs fs.FS, site *Site) (string, RenderFunc)

type DevicesListBlock

type DevicesListBlock struct {
	Title   string
	Devices []devices.Device
}

func (*DevicesListBlock) Renderer

func (b *DevicesListBlock) Renderer(fs fs.FS, site *Site) (string, RenderFunc)

type DevicesNewTmpl

type DevicesNewTmpl struct {
}

func (*DevicesNewTmpl) Renderer

func (t *DevicesNewTmpl) Renderer(fs fs.FS, site *Site) (string, RenderFunc)

type DevicesTmpl

type DevicesTmpl struct {
	Title  string
	List   *DevicesListBlock
	Detail *DevicesDetailBlock
}

func (*DevicesTmpl) Renderer

func (t *DevicesTmpl) Renderer(fs fs.FS, site *Site) (string, RenderFunc)

type ErrorTmpl

type ErrorTmpl struct {
	Message string
	Code    string
	Status  int
}

func (*ErrorTmpl) Renderer

func (t *ErrorTmpl) Renderer(fs fs.FS, site *Site) (string, RenderFunc)

type LoginTmpl

type LoginTmpl struct {
	Title string
}

func (*LoginTmpl) Renderer

func (lt *LoginTmpl) Renderer(fs fs.FS, site *Site) (string, RenderFunc)

type RenderFunc

type RenderFunc func(ctx context.Context, base *template.Template, w io.Writer) error

type Renderable

type Renderable interface {
	Renderer(fs.FS, *Site) (layout string, fn RenderFunc)
}

type Site

type Site struct {
	Title string
}

type Templates

type Templates struct {
	// contains filtered or unexported fields
}

func NewTemplates

func NewTemplates() *Templates

func (*Templates) R

func (t *Templates) R(ctx context.Context, w io.Writer, r Renderable) error

R renders Renderable

func (*Templates) RenderPartial

func (t *Templates) RenderPartial(w io.Writer, name string, data interface{}) error

RenderPartial renders partial rawly.

type UsersDetailBlock

type UsersDetailBlock struct {
	User *users.User
}

func (*UsersDetailBlock) Renderer

func (t *UsersDetailBlock) Renderer(fs fs.FS, site *Site) (string, RenderFunc)

type UsersListBlock

type UsersListBlock struct {
	Rows *UsersRowsBlock
}

func (*UsersListBlock) Renderer

func (t *UsersListBlock) Renderer(fs fs.FS, site *Site) (string, RenderFunc)

type UsersRowsBlock

type UsersRowsBlock struct {
	Users []users.User
}

func (*UsersRowsBlock) Renderer

func (p *UsersRowsBlock) Renderer(fs fs.FS, site *Site) (layout string, renderFn RenderFunc)

type UsersTmpl

type UsersTmpl struct {
	Title  string
	List   *UsersListBlock
	Detail *UsersDetailBlock
}

func (*UsersTmpl) Renderer

func (t *UsersTmpl) Renderer(fs fs.FS, site *Site) (string, RenderFunc)

Jump to

Keyboard shortcuts

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