Browse Source

Clean code

for-closed-social
Unknown 10 years ago
parent
commit
ee9b7f322f
3 changed files with 5 additions and 8 deletions
  1. +1
    -1
      routers/user/setting.go
  2. +1
    -1
      routers/user/user.go
  3. +3
    -6
      templates/org/settings.tmpl

+ 1
- 1
routers/user/setting.go View File

@ -68,7 +68,7 @@ func SettingPost(ctx *middleware.Context, form auth.UpdateProfileForm) {
ctx.User.Avatar = base.EncodeMd5(form.Avatar)
ctx.User.AvatarEmail = form.Avatar
if err := models.UpdateUser(ctx.User); err != nil {
ctx.Handle(500, "setting.Setting", err)
ctx.Handle(500, "setting.Setting(UpdateUser)", err)
return
}
log.Trace("%s User setting updated: %s", ctx.Req.RequestURI, ctx.User.LowerName)

+ 1
- 1
routers/user/user.go View File

@ -296,7 +296,7 @@ func DeletePost(ctx *middleware.Context) {
case models.ErrUserOwnRepos:
ctx.Flash.Error("Your account still have ownership of repository, you have to delete or transfer them first.")
default:
ctx.Handle(500, "user.Delete", err)
ctx.Handle(500, "user.Delete(DeleteUser)", err)
return
}
} else {

+ 3
- 6
templates/org/settings.tmpl View File

@ -98,11 +98,9 @@
<div class="modal fade" id="delete-org-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
aria-hidden="true">
<div class="modal-dialog">
<form action="/{{.Owner.Name}}/{{.Repository.Name}}/settings" method="post"
<form action="/org/{{.Org.Name}}/settings/delete" method="post"
class="modal-content">
{{.CsrfTokenHtml}}
<input type="hidden" name="action" value="delete">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-hidden="true">&times;</button>
@ -111,9 +109,8 @@
<div class="modal-body">
<div class="form-group">
<label>Please enter your organization name "<strong class="text-danger">{{.Repository.Name}}</strong>"</label>
<input name="organization" class="form-control" type="text"
placeholder="Type your organization name" required="required">
<label>Make sure your are owner of this organization. Please enter your password.<strong class="text-danger">*</strong></label>
<input name="password" class="form-control" type="password" placeholder="Type your account password" required="required">
</div>
</div>

Loading…
Cancel
Save