forked from kevadesu/forgejo
Work on admin
This commit is contained in:
parent
5cb2d3d2e2
commit
9f9cd6bfc6
19 changed files with 177 additions and 41 deletions
|
@ -24,13 +24,13 @@ func Setting(ctx *middleware.Context, form auth.UpdateProfileForm) {
|
|||
ctx.Data["Owner"] = user
|
||||
|
||||
if ctx.Req.Method == "GET" {
|
||||
ctx.HTML(200, "user/setting", ctx.Data)
|
||||
ctx.HTML(200, "user/setting")
|
||||
return
|
||||
}
|
||||
|
||||
// below is for POST requests
|
||||
if hasErr, ok := ctx.Data["HasError"]; ok && hasErr.(bool) {
|
||||
ctx.HTML(200, "user/setting", ctx.Data)
|
||||
ctx.HTML(200, "user/setting")
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ func Setting(ctx *middleware.Context, form auth.UpdateProfileForm) {
|
|||
}
|
||||
|
||||
ctx.Data["IsSuccess"] = true
|
||||
ctx.HTML(200, "user/setting", ctx.Data)
|
||||
ctx.HTML(200, "user/setting")
|
||||
log.Trace("%s User setting updated: %s", ctx.Req.RequestURI, ctx.User.LowerName)
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ func SettingPassword(ctx *middleware.Context, form auth.UpdatePasswdForm) {
|
|||
ctx.Data["IsUserPageSettingPasswd"] = true
|
||||
|
||||
if ctx.Req.Method == "GET" {
|
||||
ctx.HTML(200, "user/password", ctx.Data)
|
||||
ctx.HTML(200, "user/password")
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -82,7 +82,7 @@ func SettingPassword(ctx *middleware.Context, form auth.UpdatePasswdForm) {
|
|||
}
|
||||
|
||||
ctx.Data["Owner"] = user
|
||||
ctx.HTML(200, "user/password", ctx.Data)
|
||||
ctx.HTML(200, "user/password")
|
||||
log.Trace("%s User password updated: %s", ctx.Req.RequestURI, ctx.User.LowerName)
|
||||
}
|
||||
|
||||
|
@ -123,7 +123,7 @@ func SettingSSHKeys(ctx *middleware.Context, form auth.AddSSHKeyForm) {
|
|||
// Add new SSH key.
|
||||
if ctx.Req.Method == "POST" {
|
||||
if hasErr, ok := ctx.Data["HasError"]; ok && hasErr.(bool) {
|
||||
ctx.HTML(200, "user/publickey", ctx.Data)
|
||||
ctx.HTML(200, "user/publickey")
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -155,7 +155,7 @@ func SettingSSHKeys(ctx *middleware.Context, form auth.AddSSHKeyForm) {
|
|||
ctx.Data["PageIsUserSetting"] = true
|
||||
ctx.Data["IsUserPageSettingSSH"] = true
|
||||
ctx.Data["Keys"] = keys
|
||||
ctx.HTML(200, "user/publickey", ctx.Data)
|
||||
ctx.HTML(200, "user/publickey")
|
||||
}
|
||||
|
||||
func SettingNotification(ctx *middleware.Context) {
|
||||
|
@ -163,7 +163,7 @@ func SettingNotification(ctx *middleware.Context) {
|
|||
ctx.Data["Title"] = "Notification"
|
||||
ctx.Data["PageIsUserSetting"] = true
|
||||
ctx.Data["IsUserPageSettingNotify"] = true
|
||||
ctx.HTML(200, "user/notification", ctx.Data)
|
||||
ctx.HTML(200, "user/notification")
|
||||
}
|
||||
|
||||
func SettingSecurity(ctx *middleware.Context) {
|
||||
|
@ -171,5 +171,5 @@ func SettingSecurity(ctx *middleware.Context) {
|
|||
ctx.Data["Title"] = "Security"
|
||||
ctx.Data["PageIsUserSetting"] = true
|
||||
ctx.Data["IsUserPageSettingSecurity"] = true
|
||||
ctx.HTML(200, "user/security", ctx.Data)
|
||||
ctx.HTML(200, "user/security")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue