configurable gravatar functionality

stable
Juanfran 2016-10-10 08:52:50 +02:00
parent d97a356fe3
commit 4a6f254d17
2 changed files with 5 additions and 4 deletions

View File

@ -18,7 +18,7 @@
### ###
class AvatarService class AvatarService
constructor: () -> constructor: (@config) ->
IMAGES = [ IMAGES = [
"/#{window._version}/images/user-avatars/user-avatar-01.png" "/#{window._version}/images/user-avatars/user-avatar-01.png"
"/#{window._version}/images/user-avatars/user-avatar-02.png" "/#{window._version}/images/user-avatars/user-avatar-02.png"
@ -71,7 +71,7 @@ class AvatarService
return { return {
url: photo url: photo
} }
else if location.host.indexOf('localhost') != -1 else if location.host.indexOf('localhost') != -1 || !@config.get("gravatar", true)
root = location.protocol + '//' + location.host root = location.protocol + '//' + location.host
logo = @.getDefault(gravatar) logo = @.getDefault(gravatar)
@ -90,4 +90,4 @@ class AvatarService
bg: logo.color bg: logo.color
} }
angular.module("taigaCommon").service("tgAvatarService", AvatarService) angular.module("taigaCommon").service("tgAvatarService", ["$tgConfig", AvatarService])

View File

@ -15,5 +15,6 @@
"termsOfServiceUrl": null, "termsOfServiceUrl": null,
"maxUploadFileSize": null, "maxUploadFileSize": null,
"contribPlugins": [], "contribPlugins": [],
"tribeHost": null "tribeHost": null,
"gravatar": true
} }