templates

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2023 License: AGPL-3.0 Imports: 12 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 InviteMemberForm = template.Must(
	layout().ParseFS(Files,
		"site/invite_member_form.html",
	),
).Lookup("focus")
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 PasswordResetRequestForm = template.Must(
	layout().ParseFS(Files,
		"auth/password_reset_request_form.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 SiteLocked = template.Must(
	layout().ParseFS(Files,
		"stats/site_locked.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 Sites = template.Must(
	layout().ParseFS(Files,
		"plot/plot.html",
		"site/index.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")
View Source
var WaitingFirstPageView = template.Must(
	layout().ParseFS(Files,
		"stats/stats.html",
	),
).Lookup("app")

Functions

func Avatar

func Avatar(uid uint64, size uint, class ...string) template.HTML
func Logo(width, height int) 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 CalendarEntry

type CalendarEntry struct {
	Name       string
	Start, End time.Time
}

func CalendarEntries

func CalendarEntries() []CalendarEntry

func (*CalendarEntry) From

func (c *CalendarEntry) From() string

func (*CalendarEntry) To

func (c *CalendarEntry) To() string

type Context

type Context struct {
	Title         string
	CurrentUser   *models.User
	Data          map[string]any
	CSRF          template.HTML
	Captcha       template.HTMLAttr
	Errors        map[string]string
	Form          url.Values
	Code          uint64
	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
	EmailReport   bool
	HasGoals      bool
	Owner         *models.User
	Recipient     string
	Key           string
	SharedLink    *models.SharedLink
}

func New

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

func (*Context) GreetRecipient

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

func (*Context) VinceURL

func (t *Context) VinceURL() template.HTML

type Errors

type Errors struct {
	Status     int
	StatusText string
}

type NewSite

type NewSite struct {
	IsFirstSite bool
}

Jump to

Keyboard shortcuts

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