forked from forgejo/forgejo
In progress of name template name constant
This commit is contained in:
parent
c280415e0b
commit
9924e65ca1
24 changed files with 104 additions and 60 deletions
|
@ -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{}) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue