From 20fc32400aa8888035086b190bcefed2dc650252 Mon Sep 17 00:00:00 2001 From: Juanfran Date: Mon, 10 Oct 2016 08:52:50 +0200 Subject: [PATCH] [Backport] configurable gravatar functionality --- app/modules/services/avatar.service.coffee | 6 +++--- conf/conf.example.json | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/modules/services/avatar.service.coffee b/app/modules/services/avatar.service.coffee index f2ba8739..5049a3ba 100644 --- a/app/modules/services/avatar.service.coffee +++ b/app/modules/services/avatar.service.coffee @@ -18,7 +18,7 @@ ### class AvatarService - constructor: () -> + constructor: (@config) -> IMAGES = [ "/#{window._version}/images/user-avatars/user-avatar-01.png" "/#{window._version}/images/user-avatars/user-avatar-02.png" @@ -71,7 +71,7 @@ class AvatarService return { 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 logo = @.getDefault(gravatar) @@ -90,4 +90,4 @@ class AvatarService bg: logo.color } -angular.module("taigaCommon").service("tgAvatarService", AvatarService) +angular.module("taigaCommon").service("tgAvatarService", ["$tgConfig", AvatarService]) diff --git a/conf/conf.example.json b/conf/conf.example.json index 325001cb..4f0d8cb6 100644 --- a/conf/conf.example.json +++ b/conf/conf.example.json @@ -15,5 +15,6 @@ "termsOfServiceUrl": null, "maxUploadFileSize": null, "contribPlugins": [], - "tribeHost": null + "tribeHost": null, + "gravatar": true }