From bf2547db20ee70171b460b110229fde36997adc6 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 27 Jun 2015 09:46:18 +0000 Subject: [PATCH] Add avatar and edit link to "My account" page (#5418). git-svn-id: http://svn.redmine.org/redmine/trunk@14377 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/application_helper.rb | 8 ++++++++ app/views/my/account.html.erb | 6 +++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 6e59f63ed..688e3d235 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1251,6 +1251,14 @@ module ApplicationHelper end end + # Returns a link to edit user's avatar if avatars are enabled + def avatar_edit_link(user, options={}) + if Setting.gravatar_enabled? + url = "http://gravatar.com" + link_to avatar(user, {:title => l(:button_edit)}.merge(options)), url, :target => '_blank' + end + end + def sanitize_anchor_name(anchor) anchor.gsub(%r{[^\s\-\p{Word}]}, '').gsub(%r{\s+(\-+\s*)?}, '-') end diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index cadf0e830..2d7aa9a51 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -4,7 +4,11 @@ <%= call_hook(:view_my_account_contextual, :user => @user)%> -

<%=l(:label_my_account)%>

+

+ <%= avatar_edit_link(@user, :size => "50") %> + <%=l(:label_my_account)%> +

+ <%= error_messages_for 'user' %> <%= labelled_form_for :user, @user, -- 2.39.5