##// END OF EJS Templates
Add avatar and edit link to "My account" page (#5418)....
Jean-Philippe Lang -
r13995:bf2547db20ee
parent child
Show More
@@ -1251,6 +1251,14 module ApplicationHelper
1251 end
1251 end
1252 end
1252 end
1253
1253
1254 # Returns a link to edit user's avatar if avatars are enabled
1255 def avatar_edit_link(user, options={})
1256 if Setting.gravatar_enabled?
1257 url = "http://gravatar.com"
1258 link_to avatar(user, {:title => l(:button_edit)}.merge(options)), url, :target => '_blank'
1259 end
1260 end
1261
1254 def sanitize_anchor_name(anchor)
1262 def sanitize_anchor_name(anchor)
1255 anchor.gsub(%r{[^\s\-\p{Word}]}, '').gsub(%r{\s+(\-+\s*)?}, '-')
1263 anchor.gsub(%r{[^\s\-\p{Word}]}, '').gsub(%r{\s+(\-+\s*)?}, '-')
1256 end
1264 end
@@ -4,7 +4,11
4 <%= call_hook(:view_my_account_contextual, :user => @user)%>
4 <%= call_hook(:view_my_account_contextual, :user => @user)%>
5 </div>
5 </div>
6
6
7 <h2><%=l(:label_my_account)%></h2>
7 <h2>
8 <%= avatar_edit_link(@user, :size => "50") %>
9 <%=l(:label_my_account)%>
10 </h2>
11
8 <%= error_messages_for 'user' %>
12 <%= error_messages_for 'user' %>
9
13
10 <%= labelled_form_for :user, @user,
14 <%= labelled_form_for :user, @user,
General Comments 0
You need to be logged in to leave comments. Login now