From 32499e8276c936ddc0a3c951413b6f73cbdae00c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Ab=C3=A9lard?= Date: Sat, 11 Jan 2014 09:54:05 +0000 Subject: [PATCH 1/2] allow using the user's email address as a http parameter in gravatar urls for custom avatar systems. For example: plain_url: "http://avatar.company.com/avatar/?mail=%{email}&size=%{size}" --- app/helpers/application_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 0db43fa18..354bdd8e4 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -66,7 +66,7 @@ module ApplicationHelper else gravatar_url = request.ssl? || gitlab_config.https ? Gitlab.config.gravatar.ssl_url : Gitlab.config.gravatar.plain_url user_email.strip! - sprintf gravatar_url, hash: Digest::MD5.hexdigest(user_email.downcase), size: size + sprintf gravatar_url, hash: Digest::MD5.hexdigest(user_email.downcase), size: size, email: user_email end end @@ -221,4 +221,4 @@ module ApplicationHelper def render_markup(file_name, file_content) GitHub::Markup.render(file_name, file_content).html_safe end -end +end \ No newline at end of file From 8419a2a4ebf79631f712f3066b8a9d4594fe9666 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Ab=C3=A9lard?= Date: Thu, 10 Apr 2014 14:17:25 +0000 Subject: [PATCH 2/2] add mentions of the different placeholders possible for gravatar urls, mentionning the new %{email} --- config/gitlab.yml.example | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index 2bc984c92..d5a7c1cad 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -108,6 +108,7 @@ production: &base ## Gravatar gravatar: enabled: true # Use user avatar image from Gravatar.com (default: true) + # gravatar urls: possible placeholders: %{hash} %{size} %{email} # plain_url: "http://..." # default: http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=mm # ssl_url: "https://..." # default: https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=mm @@ -224,4 +225,4 @@ test: new_issue_url: "http://redmine/projects/:issues_tracker_id/issues/new" staging: - <<: *base + <<: *base \ No newline at end of file