1
0
Fork 0
forked from forgejo/forgejo

In progress of name template name constant

This commit is contained in:
Unknown 2014-06-22 13:14:03 -04:00
parent c280415e0b
commit 9924e65ca1
24 changed files with 104 additions and 60 deletions

View file

@ -104,12 +104,12 @@ func (ctx *Context) HasError() bool {
}
// HTML calls render.HTML underlying but reduce one argument.
func (ctx *Context) HTML(status int, name string, htmlOpt ...HTMLOptions) {
ctx.Render.HTML(status, name, ctx.Data, htmlOpt...)
func (ctx *Context) HTML(status int, name base.TplName, htmlOpt ...HTMLOptions) {
ctx.Render.HTML(status, string(name), ctx.Data, htmlOpt...)
}
// RenderWithErr used for page has form validation but need to prompt error to users.
func (ctx *Context) RenderWithErr(msg, tpl string, form auth.Form) {
func (ctx *Context) RenderWithErr(msg string, tpl base.TplName, form auth.Form) {
if form != nil {
auth.AssignForm(form, ctx.Data)
}
@ -133,7 +133,7 @@ func (ctx *Context) Handle(status int, title string, err error) {
case 500:
ctx.Data["Title"] = "Internal Server Error"
}
ctx.HTML(status, fmt.Sprintf("status/%d", status))
ctx.HTML(status, base.TplName(fmt.Sprintf("status/%d", status)))
}
func (ctx *Context) Debug(msg string, args ...interface{}) {