Files
fnx_web/webcontroller/templates/funcs.go

27 lines
500 B
Go
Raw Normal View History

2017-11-10 12:39:55 +01:00
package templates
import (
"html/template"
"time"
)
func (tm *TemplateManager) funcMap() template.FuncMap {
return template.FuncMap{
"bgPatternCount": tm.bgPatternCount,
"debugMode": tm.debugMode,
"apiUrl": tm.apiURL,
}
2017-11-10 12:39:55 +01:00
}
func (tm *TemplateManager) bgPatternCount() uint8 {
2018-04-09 23:21:06 +02:00
return uint8(time.Now().UnixNano() % 17)
2017-11-10 12:39:55 +01:00
}
func (tm *TemplateManager) debugMode() bool {
return tm.debugModeEnabled
2017-11-10 12:39:55 +01:00
}
2017-12-17 23:34:49 +01:00
func (tm *TemplateManager) apiURL() string {
return tm.externalAPIEndpoint
2017-12-17 23:34:49 +01:00
}