mirror of
https://github.com/gogs/gogs.git
synced 2026-05-07 06:25:59 +02:00
user/setting: preserve user input with validation error (#1123)
This commit is contained in:
@@ -79,12 +79,17 @@ func (ctx *Context) HasValue(name string) bool {
|
||||
return ok
|
||||
}
|
||||
|
||||
// HTML calls Context.HTML and converts template name to string.
|
||||
// HTML responses template with given status.
|
||||
func (ctx *Context) HTML(status int, name base.TplName) {
|
||||
log.Trace("Template: %s", name)
|
||||
ctx.Context.HTML(status, string(name))
|
||||
}
|
||||
|
||||
// Success responses template with status 200.
|
||||
func (c *Context) Success(name base.TplName) {
|
||||
c.HTML(200, name)
|
||||
}
|
||||
|
||||
// RenderWithErr used for page has form validation but need to prompt error to users.
|
||||
func (ctx *Context) RenderWithErr(msg string, tpl base.TplName, f interface{}) {
|
||||
if f != nil {
|
||||
|
||||
Reference in New Issue
Block a user