templates

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: AGPL-3.0 Imports: 17 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 AddSnippet = template.Must(
	layout().ParseFS(Files,
		"site/snippet.html",
	),
).Lookup("focus")
View Source
var EditSharedLinkForm = template.Must(
	layout().ParseFS(Files,
		"site/edit_shared_link.html",
	),
).Lookup("focus")
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 InviteExistingUser = template.Must(
	layout().ParseFS(Files,
		"email/existing_user_invitation.html",
	),
).Lookup("base_email")
View Source
var InviteMemberForm = template.Must(
	layout().ParseFS(Files,
		"site/invite_member_form.html",
	),
).Lookup("focus")
View Source
var InviteNewUser = template.Must(
	layout().ParseFS(Files,
		"email/new_user_invitation.html",
	),
).Lookup("base_email")
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 SharedLinkForm = template.Must(
	layout().ParseFS(Files,
		"site/new_shared_link.html",
	),
).Lookup("focus")
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 Stats = template.Must(
	layout().ParseFS(Files,
		"stats/stats.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 PATH added in v0.0.13

func PATH(b string, a ...string) string

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
	HasInvitation bool
	HasPin        bool
	Flash         *flash.Flash
	NewSite       *NewSite
	Error         *Errors
	Site          *models.Site
	Goals         []*models.Goal
	IsFIrstSite   bool
	SitesOverview []models.SiteOverView
	HasGoals      bool
	Owner         *models.User
	Recipient     string
	SharedLink    *models.SharedLink
	Stats         *timeseries.Stats
	Now           core.NowFunc
	Invite        *Invite
	Overview      *Overview
}

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) InviteURL added in v0.0.11

func (t *Context) InviteURL() 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

func (*Context) SharedLinkURL

func (t *Context) SharedLinkURL(site *models.Site, link *models.SharedLink) string

func (*Context) SiteIndex

func (t *Context) SiteIndex() (o [][]models.SiteOverView)

func (*Context) Snippet

func (t *Context) Snippet() string

type Errors

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

type Invite added in v0.0.11

type Invite struct {
	Email string
	ID    uint64
}

type NewSite

type NewSite struct {
	IsFirstSite bool
}

type Overview added in v0.0.13

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

type SiteOverView added in v0.0.13

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

Jump to

Keyboard shortcuts

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