templates

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2023 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Activate = template.Must(
	layout().ParseFS(Files,
		"auth/activate.html",
	),
).Lookup("focus")
View Source
var ActivationEmail = template.Must(
	layout().ParseFS(Files,
		"email/activation_code.html",
	),
).Lookup("base_email")
View Source
var Error = template.Must(
	template.ParseFS(Files,
		"error/error.html",
	))
View Source
var Files embed.FS
View Source
var Home = template.Must(
	layout().ParseFS(Files,
		"user/home.html",
	),
).Lookup("app")
View Source
var Layouts = template.Must(
	base().ParseFS(Files,
		"layout/*.html",
	),
)
View Source
var LoginForm = template.Must(
	layout().ParseFS(Files,
		"auth/login_form.html",
	),
).Lookup("focus")
View Source
var PasswordForm = template.Must(
	layout().ParseFS(Files,
		"auth/password_form.html",
	),
).Lookup("focus")
View Source
var PasswordResetEmail = template.Must(
	layout().ParseFS(Files,
		"email/password_reset_email.html",
	),
).Lookup("base_email")
View Source
var PasswordResetForm = template.Must(
	layout().ParseFS(Files,
		"auth/password_reset_form.html",
	),
).Lookup("focus")
View Source
var PasswordResetRequestForm = template.Must(
	layout().ParseFS(Files,
		"auth/password_reset_request_form.html",
	),
).Lookup("focus")
View Source
var PasswordResetRequestSuccess = template.Must(
	layout().ParseFS(Files,
		"auth/password_reset_request_success.html",
	),
).Lookup("focus")
View Source
var RegisterForm = template.Must(
	layout().ParseFS(Files,
		"auth/register_form.html",
	),
).Lookup("focus")
View Source
var SiteHome = template.Must(
	layout().ParseFS(Files,
		"site/home.html",
	),
).Lookup("app")
View Source
var SiteNew = template.Must(
	layout().ParseFS(Files,
		"site/new.html",
	),
).Lookup("focus")
View Source
var SiteNewGoal = template.Must(
	layout().ParseFS(Files,
		"site/new_goal.html",
	),
).Lookup("focus")
View Source
var SiteSettings = template.Must(
	layout().ParseFS(Files,
		"site/settings.html",
	),
).Lookup("app")
View Source
var UserSettings = template.Must(
	layout().ParseFS(Files,
		"auth/user_settings.html",
	),
).Lookup("app")

Functions

func Avatar

func Avatar(uid string, size uint, class ...string) template.HTML

func LogoText added in v0.0.13

func LogoText(size int, class ...string) template.HTML

func SetCSRF

func SetCSRF(ctx context.Context, x template.HTML) context.Context

func SetCaptcha

func SetCaptcha(ctx context.Context, x template.HTMLAttr) context.Context

Types

type Context

type Context struct {
	Title         string
	Header        Header
	USER          *models.User
	Data          map[string]any
	CSRF          template.HTML
	Captcha       template.HTMLAttr
	Errors        map[string]string
	Form          url.Values
	Code          uint64
	ResetLink     string
	Token         string
	Email         string
	Config        *config.Options
	HasPin        bool
	Flash         *flash.Flash
	Error         *Errors
	Site          *models.Site
	Goals         []*models.Goal
	IsFIrstSite   bool
	SitesOverview []models.SiteOverView
	HasGoals      bool
	Owner         *models.User
	Recipient     string
	Now           core.NowFunc
	Overview      *Overview
	Stats         *SiteStats
}

func New

func New(ctx context.Context, f ...func(c *Context)) *Context

func (*Context) GreetRecipient

func (t *Context) GreetRecipient() string

func (*Context) Home added in v0.0.13

func (t *Context) Home() string

func (*Context) ProfileOverview added in v0.0.13

func (t *Context) ProfileOverview() string

func (*Context) ProfileSites added in v0.0.13

func (t *Context) ProfileSites() string

type Errors

type Errors struct {
	Status     int
	StatusText string
}
type Header struct {
	Context    string
	Mode       string
	ContextRef string
}

type Metric added in v0.0.15

type Metric struct {
	Name     string
	Query    string
	Selected bool
	Value    uint64
}

func (*Metric) Select added in v0.0.15

func (m *Metric) Select() string

type Overview added in v0.0.13

type Overview struct {
	Global query.Global
	Sites  []SiteOverView
	Panel  string
}

type Period added in v0.0.15

type Period struct {
	Name     string
	Selected bool
	Query    string
}

type SiteOverView added in v0.0.13

type SiteOverView struct {
	Site   *models.Site
	Owner  string
	Global query.Global
}

type SiteStats added in v0.0.15

type SiteStats struct {
	Site     *models.Site
	Owner    string
	Metric   property.Metric
	Duration timex.Duration
	Global   query.Global
}

func (*SiteStats) Metrics added in v0.0.15

func (s *SiteStats) Metrics() []Metric

func (*SiteStats) Periods added in v0.0.15

func (s *SiteStats) Periods() []Period

Jump to

Keyboard shortcuts

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