view

package
v0.0.0-...-5c2e7a1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2022 License: EUPL-1.2 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoTmplReference = errors.New("page template value is nil")
)

TODO: make it settings

Functions

func CurrentUser

func CurrentUser(c *gin.Context) *model.User

CurrentUser returns the full User object when logged in or nil otherwise

func Icon

func Icon(name string) (html string, err error)

Icon returns the html code (as inline svg) for a icon from our icon library this function gets called by the templates

func RenderErrTemplate

func RenderErrTemplate(c *gin.Context, tmpl string, err error)

RenderErrTemplate renders a page with error information

func RenderReadme

func RenderReadme(s string) (string, error)

RenderReadme renders a Markdown document to a string

func RenderTemplate

func RenderTemplate(c *gin.Context, fn, title string, data map[string]interface{})

RenderTemplate renders a go template

func Template

func Template(tmplName, title string) gin.HandlerFunc

Template returns a http.HandlerFunc to render a specific template w/o further parameters

func TemplateM

func TemplateM(tmplName string, m map[string]interface{}) gin.HandlerFunc

TemplateM returns a http.HandlerFunc to render a specific template w/ a statically allocated map as parameters

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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