1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-19 15:01:14 +00:00

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
This commit is contained in:
Jean-Philippe Lang 2015-06-27 09:46:18 +00:00
parent bc9ca5fcfd
commit bf2547db20
2 changed files with 13 additions and 1 deletions

View File

@ -1251,6 +1251,14 @@ module ApplicationHelper
end end
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) def sanitize_anchor_name(anchor)
anchor.gsub(%r{[^\s\-\p{Word}]}, '').gsub(%r{\s+(\-+\s*)?}, '-') anchor.gsub(%r{[^\s\-\p{Word}]}, '').gsub(%r{\s+(\-+\s*)?}, '-')
end end

View File

@ -4,7 +4,11 @@
<%= call_hook(:view_my_account_contextual, :user => @user)%> <%= call_hook(:view_my_account_contextual, :user => @user)%>
</div> </div>
<h2><%=l(:label_my_account)%></h2> <h2>
<%= avatar_edit_link(@user, :size => "50") %>
<%=l(:label_my_account)%>
</h2>
<%= error_messages_for 'user' %> <%= error_messages_for 'user' %>
<%= labelled_form_for :user, @user, <%= labelled_form_for :user, @user,