configurable gravatar functionality
parent
d97a356fe3
commit
4a6f254d17
|
@ -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])
|
||||||
|
|
|
@ -15,5 +15,6 @@
|
||||||
"termsOfServiceUrl": null,
|
"termsOfServiceUrl": null,
|
||||||
"maxUploadFileSize": null,
|
"maxUploadFileSize": null,
|
||||||
"contribPlugins": [],
|
"contribPlugins": [],
|
||||||
"tribeHost": null
|
"tribeHost": null,
|
||||||
|
"gravatar": true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue