diff options
-rw-r--r-- | .travis.yml | 6 | ||||
-rw-r--r-- | conf/app.ini | 3 | ||||
-rw-r--r-- | modules/setting/setting.go | 9 | ||||
-rw-r--r-- | templates/repo/settings/navbar.tmpl | 4 |
4 files changed, 16 insertions, 6 deletions
diff --git a/.travis.yml b/.travis.yml index 3d8591a2..86c81b68 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,3 +17,9 @@ notifications: email: - u@gogs.io slack: gophercn:o5pSanyTeNhnfYc3QnG0X7Wx + webhooks: + urls: + - https://webhooks.gitter.im/e/b590f8e03882f7aedc3e + on_success: change + on_failure: always + on_start: never diff --git a/conf/app.ini b/conf/app.ini index 8710e3d0..3e6e615a 100644 --- a/conf/app.ini +++ b/conf/app.ini @@ -198,6 +198,7 @@ SESSION_LIFE_TIME = 86400 SERVICE = server AVATAR_UPLOAD_PATH = data/avatars ; Chinese users can choose "duoshuo" +; or a custom avatar source, like: http://cn.gravatar.com/avatar/ GRAVATAR_SOURCE = gravatar DISABLE_GRAVATAR = false @@ -317,4 +318,4 @@ bg-BG = bg it-IT = it [other] -SHOW_FOOTER_BRANDING = false
\ No newline at end of file +SHOW_FOOTER_BRANDING = false diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 7f9d9908..d32df473 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -15,10 +15,11 @@ import ( "strings" "time" + "gopkg.in/ini.v1" + "github.com/Unknwon/com" "github.com/macaron-contrib/oauth2" "github.com/macaron-contrib/session" - "gopkg.in/ini.v1" "github.com/gogits/gogs/modules/bindata" "github.com/gogits/gogs/modules/log" @@ -345,11 +346,13 @@ func NewConfigContext() { if !filepath.IsAbs(AvatarUploadPath) { AvatarUploadPath = path.Join(workDir, AvatarUploadPath) } - switch sec.Key("GRAVATAR_SOURCE").MustString("gravatar") { + switch source := sec.Key("GRAVATAR_SOURCE").MustString("gravatar"); source { case "duoshuo": GravatarSource = "http://gravatar.duoshuo.com/avatar/" - default: + case "gravatar": GravatarSource = "//1.gravatar.com/avatar/" + default: + GravatarSource = source } DisableGravatar = sec.Key("DISABLE_GRAVATAR").MustBool() if OfflineMode { diff --git a/templates/repo/settings/navbar.tmpl b/templates/repo/settings/navbar.tmpl index 1001c3a2..a92f891e 100644 --- a/templates/repo/settings/navbar.tmpl +++ b/templates/repo/settings/navbar.tmpl @@ -4,7 +4,7 @@ <a class="{{if .PageIsSettingsOptions}}active{{end}} item" href="{{.RepoLink}}/settings"> {{.i18n.Tr "repo.settings.options"}} </a> - <a class="{{if .PageIsSettingsCollaboration}}active{{end}} item" href="{.RepoLink}}/settings/collaboration"> + <a class="{{if .PageIsSettingsCollaboration}}active{{end}} item" href="{{.RepoLink}}/settings/collaboration"> {{.i18n.Tr "repo.settings.collaboration"}} </a> <a class="{{if .PageIsSettingsHooks}}active{{end}} item" href="{{.RepoLink}}/settings/hooks"> @@ -17,4 +17,4 @@ {{.i18n.Tr "repo.settings.deploy_keys"}} </a> </div> -</div>
\ No newline at end of file +</div> |