views

package
v0.0.0-...-f03aceb Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2024 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssetPath

func AssetPath(originalName string) string

func RenderTemplate

func RenderTemplate(
	w http.ResponseWriter,
	page string,
	td *TemplateData,

) (err error)

* * renderTemplate renders the template *

Types

type ManifestEntry

type ManifestEntry struct {
	File    string `json:"file"`
	IsEntry bool   `json:"isEntry"`
	Src     string `json:"src"`
}

type TemplateData

type TemplateData struct {
	Version                string
	ProductTitle           string
	CopyrightFooterCompany string
	Title                  string
	Flashes                []sessions.SessionFlash
	User                   models.User
	Data                   any
	CSRFToken              string
	CSRFName               string

	HideHeaderAndFooter bool
	CurrentYear         int

	PreviousPage string
}

func NewTemplateData

func NewTemplateData(conf *config.Config, session *sessions.SessionManager, r *http.Request) *TemplateData

views.NewTemplateData returns the default template parameters for a user and the CSRF token.

Jump to

Keyboard shortcuts

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