summaryrefslogtreecommitdiffstats
path: root/routers/routes/routes.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/routes/routes.go')
-rw-r--r--routers/routes/routes.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/routers/routes/routes.go b/routers/routes/routes.go
index d19823714b..eb5f73768e 100644
--- a/routers/routes/routes.go
+++ b/routers/routes/routes.go
@@ -159,6 +159,14 @@ func NewMacaron() *macaron.Macaron {
ExpiresAfter: time.Hour * 6,
},
))
+ m.Use(public.StaticHandler(
+ setting.RepositoryAvatarUploadPath,
+ &public.Options{
+ Prefix: "repo-avatars",
+ SkipLogging: setting.DisableRouterLog,
+ ExpiresAfter: time.Hour * 6,
+ },
+ ))
m.Use(templates.HTMLRenderer())
models.InitMailRender(templates.Mailer())
@@ -613,6 +621,9 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Group("/settings", func() {
m.Combo("").Get(repo.Settings).
Post(bindIgnErr(auth.RepoSettingForm{}), repo.SettingsPost)
+ m.Post("/avatar", binding.MultipartForm(auth.AvatarForm{}), repo.SettingsAvatar)
+ m.Post("/avatar/delete", repo.SettingsDeleteAvatar)
+
m.Group("/collaboration", func() {
m.Combo("").Get(repo.Collaboration).Post(repo.CollaborationPost)
m.Post("/access_mode", repo.ChangeCollaborationAccessMode)