template

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NamespacesURI   = "(\\/namespaces\\/?|\\/n\\/[_\\-a-zA-Z0-9.]+\\/[\\-a-zA-Z0-9\\/]*\\/?)"
	CronURI         = "\\/cron\\/?"
	InvitesURI      = "^\\/invites\\/?"
	BuildsURI       = "(^\\/builds\\/?|^\\/builds\\/create$|^\\/b/[_\\-a-zA-Z0-9.]+\\/[0-9]+\\/?[a-z]*)"
	SettingsURI     = "\\/settings\\/?"
	RepositoriesURI = "\\/repos\\/?"
)

Functions

func Active

func Active(condition bool) string

func FileInput

func FileInput(f Form) string

func IndentJSON added in v1.1.0

func IndentJSON(s string) string

func Match

func Match(uri, pattern string) bool

func NewDashboard

func NewDashboard(d Dashboard, url *url.URL, u *user.User, a Alert, csrf template.HTML) *baseDashboard

func Render

func Render(p Page) string

func RenderAlert

func RenderAlert(a Alert, url string) string

func RenderCode

func RenderCode(c string) string

func RenderPaginator

func RenderPaginator(url *url.URL, p database.Paginator) string

func RenderSearch

func RenderSearch(uri, search, prompt string) string

func RenderShortStatus

func RenderShortStatus(s runner.Status) string

func RenderSize

func RenderSize(n int64) string

func RenderStatus

func RenderStatus(s runner.Status) string

func StreamFileInput

func StreamFileInput(qw422016 *qt422016.Writer, f Form)

func StreamRender

func StreamRender(qw422016 *qt422016.Writer, p Page)

func StreamRenderAlert

func StreamRenderAlert(qw422016 *qt422016.Writer, a Alert, url string)

func StreamRenderCode

func StreamRenderCode(qw422016 *qt422016.Writer, c string)

func StreamRenderPaginator

func StreamRenderPaginator(qw422016 *qt422016.Writer, url *url.URL, p database.Paginator)

func StreamRenderSearch

func StreamRenderSearch(qw422016 *qt422016.Writer, uri, search, prompt string)

func StreamRenderShortStatus

func StreamRenderShortStatus(qw422016 *qt422016.Writer, s runner.Status)

func StreamRenderStatus

func StreamRenderStatus(qw422016 *qt422016.Writer, s runner.Status)

func WriteFileInput

func WriteFileInput(qq422016 qtio422016.Writer, f Form)

func WriteRender

func WriteRender(qq422016 qtio422016.Writer, p Page)

func WriteRenderAlert

func WriteRenderAlert(qq422016 qtio422016.Writer, a Alert, url string)

func WriteRenderCode

func WriteRenderCode(qq422016 qtio422016.Writer, c string)

func WriteRenderPaginator

func WriteRenderPaginator(qq422016 qtio422016.Writer, url *url.URL, p database.Paginator)

func WriteRenderSearch

func WriteRenderSearch(qq422016 qtio422016.Writer, uri, search, prompt string)

func WriteRenderShortStatus

func WriteRenderShortStatus(qq422016 qtio422016.Writer, s runner.Status)

func WriteRenderStatus

func WriteRenderStatus(qq422016 qtio422016.Writer, s runner.Status)

Types

type Alert

type Alert struct {
	Level   Level
	Close   bool
	HTML    bool
	Message string
}

type BasePage

type BasePage struct {
	URL  *url.URL
	User *user.User
}

func (*BasePage) Body

func (p *BasePage) Body() string

func (*BasePage) Footer

func (p *BasePage) Footer() string

func (*BasePage) StreamBody

func (p *BasePage) StreamBody(qw422016 *qt422016.Writer)

func (*BasePage) StreamFooter

func (p *BasePage) StreamFooter(qw422016 *qt422016.Writer)

func (*BasePage) StreamTitle

func (p *BasePage) StreamTitle(qw422016 *qt422016.Writer)

func (*BasePage) Title

func (p *BasePage) Title() string

func (*BasePage) WriteBody

func (p *BasePage) WriteBody(qq422016 qtio422016.Writer)

func (*BasePage) WriteFooter

func (p *BasePage) WriteFooter(qq422016 qtio422016.Writer)

func (*BasePage) WriteTitle

func (p *BasePage) WriteTitle(qq422016 qtio422016.Writer)

type Dashboard

type Dashboard interface {
	Title() string

	StreamTitle(qw422016 *qt422016.Writer)

	WriteTitle(qq422016 qtio422016.Writer)

	Body() string

	StreamBody(qw422016 *qt422016.Writer)

	WriteBody(qq422016 qtio422016.Writer)

	Footer() string

	StreamFooter(qw422016 *qt422016.Writer)

	WriteFooter(qq422016 qtio422016.Writer)

	Actions() string

	StreamActions(qw422016 *qt422016.Writer)

	WriteActions(qq422016 qtio422016.Writer)

	Header() string

	StreamHeader(qw422016 *qt422016.Writer)

	WriteHeader(qq422016 qtio422016.Writer)

	Navigation() string

	StreamNavigation(qw422016 *qt422016.Writer)

	WriteNavigation(qq422016 qtio422016.Writer)
}

type Error

type Error struct {
	BasePage

	Code    int
	Message string
}

func (*Error) Body

func (p *Error) Body() string

func (*Error) Footer

func (p *Error) Footer() string

func (*Error) StreamBody

func (p *Error) StreamBody(qw422016 *qt422016.Writer)

func (*Error) StreamFooter

func (p *Error) StreamFooter(qw422016 *qt422016.Writer)

func (*Error) StreamTitle

func (p *Error) StreamTitle(qw422016 *qt422016.Writer)

func (*Error) Title

func (p *Error) Title() string

func (*Error) WriteBody

func (p *Error) WriteBody(qq422016 qtio422016.Writer)

func (*Error) WriteFooter

func (p *Error) WriteFooter(qq422016 qtio422016.Writer)

func (*Error) WriteTitle

func (p *Error) WriteTitle(qq422016 qtio422016.Writer)

type FileForm

type FileForm struct {
	Form
}

func (*FileForm) Actions

func (p *FileForm) Actions() string

func (*FileForm) Body

func (p *FileForm) Body() string

func (*FileForm) Header

func (p *FileForm) Header() string

func (*FileForm) StreamActions

func (p *FileForm) StreamActions(qw422016 *qt422016.Writer)

func (*FileForm) StreamBody

func (p *FileForm) StreamBody(qw422016 *qt422016.Writer)

func (*FileForm) StreamHeader

func (p *FileForm) StreamHeader(qw422016 *qt422016.Writer)

func (*FileForm) StreamTitle

func (p *FileForm) StreamTitle(qw422016 *qt422016.Writer)

func (*FileForm) Title

func (p *FileForm) Title() string

func (*FileForm) WriteActions

func (p *FileForm) WriteActions(qq422016 qtio422016.Writer)

func (*FileForm) WriteBody

func (p *FileForm) WriteBody(qq422016 qtio422016.Writer)

func (*FileForm) WriteHeader

func (p *FileForm) WriteHeader(qq422016 qtio422016.Writer)

func (*FileForm) WriteTitle

func (p *FileForm) WriteTitle(qq422016 qtio422016.Writer)

type Form

type Form struct {
	CSRF   template.HTML
	Errors *webutil.Errors
	Fields map[string]string
}

func (Form) Error

func (f Form) Error(field string) string

func (Form) StreamError

func (f Form) StreamError(qw422016 *qt422016.Writer, field string)

func (Form) WriteError

func (f Form) WriteError(qq422016 qtio422016.Writer, field string)

type InternalError

type InternalError struct {
	Error

	Stack string
}

func (*InternalError) Body

func (p *InternalError) Body() string

func (*InternalError) StreamBody

func (p *InternalError) StreamBody(qw422016 *qt422016.Writer)

func (*InternalError) WriteBody

func (p *InternalError) WriteBody(qq422016 qtio422016.Writer)

type Level

type Level uint8
const (
	Success Level = iota
	Warn
	Danger
)

func (Level) String

func (l Level) String() string

type Page

type Page interface {
	Title() string

	StreamTitle(qw422016 *qt422016.Writer)

	WriteTitle(qq422016 qtio422016.Writer)

	Body() string

	StreamBody(qw422016 *qt422016.Writer)

	WriteBody(qq422016 qtio422016.Writer)

	Footer() string

	StreamFooter(qw422016 *qt422016.Writer)

	WriteFooter(qq422016 qtio422016.Writer)
}

type Section

type Section interface {
	Title() string

	StreamTitle(qw422016 *qt422016.Writer)

	WriteTitle(qq422016 qtio422016.Writer)

	Header() string

	StreamHeader(qw422016 *qt422016.Writer)

	WriteHeader(qq422016 qtio422016.Writer)

	Actions() string

	StreamActions(qw422016 *qt422016.Writer)

	WriteActions(qq422016 qtio422016.Writer)

	Body() string

	StreamBody(qw422016 *qt422016.Writer)

	WriteBody(qq422016 qtio422016.Writer)
}

Jump to

Keyboard shortcuts

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