summaryrefslogtreecommitdiffstats
path: root/routers/org
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-09-06 17:12:02 -0400
committerUnknwon <u@gogs.io>2015-09-06 17:12:02 -0400
commitc38754d432c4244a884ccf2576397eb15552b495 (patch)
tree4a4ccc071f6625c7d143c1d647b4b17d3a7f7fab /routers/org
parent85f34ba53843177999cb98bad046e9cce22bfc8f (diff)
downloadgitea-c38754d432c4244a884ccf2576397eb15552b495.tar.gz
gitea-c38754d432c4244a884ccf2576397eb15552b495.zip
#1191 allow upload avatar for org
Signed-off-by: Unknwon <u@gogs.io>
Diffstat (limited to 'routers/org')
-rw-r--r--routers/org/setting.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/routers/org/setting.go b/routers/org/setting.go
index c6d2db3d97..9e26afa7d4 100644
--- a/routers/org/setting.go
+++ b/routers/org/setting.go
@@ -12,6 +12,7 @@ import (
"github.com/gogits/gogs/modules/log"
"github.com/gogits/gogs/modules/middleware"
"github.com/gogits/gogs/modules/setting"
+ "github.com/gogits/gogs/routers/user"
)
const (
@@ -73,6 +74,17 @@ func SettingsPost(ctx *middleware.Context, form auth.UpdateOrgSettingForm) {
ctx.Redirect(org.HomeLink() + "/settings")
}
+func SettingsAvatar(ctx *middleware.Context, form auth.UploadAvatarForm) {
+ form.Enable = true
+ if err := user.UpdateAvatarSetting(ctx, form, ctx.Org.Organization); err != nil {
+ ctx.Flash.Error(err.Error())
+ } else {
+ ctx.Flash.Success(ctx.Tr("org.settings.update_avatar_success"))
+ }
+
+ ctx.Redirect(ctx.Org.OrgLink + "/settings")
+}
+
func SettingsDelete(ctx *middleware.Context) {
ctx.Data["Title"] = ctx.Tr("org.settings")
ctx.Data["PageIsSettingsDelete"] = true