Files
fnx_web/webcontroller/templateData.go

32 lines
610 B
Go
Raw Normal View History

package webcontroller
import (
2018-06-21 23:41:50 +02:00
"html/template"
"net/http"
)
// TemplateData is a struct that every template expects when being rendered. In
// the field Other you can pass your own template-specific variables.
type TemplateData struct {
Authenticated bool
Username string
2018-06-21 23:41:50 +02:00
APIEndpoint template.URL
Recaptcha struct {
Enabled bool
PubKey string
}
Other interface{}
}
2018-06-21 23:41:50 +02:00
func (wc *WebController) newTemplateData(r *http.Request) *TemplateData {
var t = &TemplateData{
Authenticated: false,
Username: "Fornax",
APIEndpoint: template.URL(wc.conf.APIURLExternal),
}
return t
}