예제 #1
0
func (me *HtmlTemplatePage) Render(c *api.Context, w http.ResponseWriter) {
	if me.Team != nil {
		me.Team.Sanitize()
	}

	if me.User != nil {
		me.User.Sanitize(map[string]bool{})
	}

	me.SessionTokenIndex = c.SessionTokenIndex

	if err := Templates.ExecuteTemplate(w, me.TemplateName, me); err != nil {
		c.SetUnknownError(me.TemplateName, err.Error())
	}
}
예제 #2
0
파일: web.go 프로젝트: ttyniwa/platform
func (me *HtmlTemplatePage) Render(c *api.Context, w http.ResponseWriter) {
	if me.Team != nil {
		me.Team.Sanitize()
	}

	if me.User != nil {
		me.User.Sanitize(map[string]bool{})
		me.Locale = me.User.Locale
	}

	me.Props["Locale"] = me.Locale
	me.SessionTokenIndex = c.SessionTokenIndex

	me.ClientCfg["FooterHelp"] = c.T("web.footer.help")
	me.ClientCfg["FooterTerms"] = c.T("web.footer.terms")
	me.ClientCfg["FooterPrivacy"] = c.T("web.footer.privacy")
	me.ClientCfg["FooterAbout"] = c.T("web.footer.about")

	if err := Templates.ExecuteTemplate(w, me.TemplateName, me); err != nil {
		c.SetUnknownError(me.TemplateName, err.Error())
	}
}
예제 #3
0
func (me *HtmlTemplatePage) Render(c *api.Context, w http.ResponseWriter) {
	if err := Templates.ExecuteTemplate(w, me.TemplateName, me); err != nil {
		c.SetUnknownError(me.TemplateName, err.Error())
	}
}