Small refactorization of avatar methods (#31391).

* move existing methods from ApplicationHelper to a new helper file (AvatarsHelper)
* change default avatar size from 50 to 24 because most of the avatars are using the  size 24
* class 'gravatar' is always added and all custom classes are appended
* added user name as default title for avatar images
* added two new methods: @assignee_avatar@ and @author_avatar@

Patch by Marius BALTEANU.


git-svn-id: http://svn.redmine.org/redmine/trunk@18175 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2019-05-19 22:27:41 +00:00
parent 6f8bfab179
commit f992df684f
17 changed files with 187 additions and 135 deletions

View File

@@ -18,7 +18,7 @@ module GravatarHelper
:default => nil,
# The default size in pixels for the gravatar image (they're square).
:size => 50,
:size => 24,
# The maximum allowed MPAA rating for gravatars. This allows you to
# exclude gravatars that may be out of character for your site.

View File

@@ -686,13 +686,7 @@ module Redmine
css_classes << ' over-end-date' if progress_date > self.date_to
end
s = (+"").html_safe
if issue.assigned_to.present?
assigned_string = l(:field_assigned_to) + ": " + issue.assigned_to.name
s << view.avatar(issue.assigned_to,
:class => 'gravatar icon-gravatar',
:size => 13,
:title => assigned_string).to_s.html_safe
end
s << view.assignee_avatar(issue.assigned_to, :size => 13, :class => 'icon-gravatar')
s << view.link_to_issue(issue).html_safe
s << view.content_tag(:input, nil, :type => 'checkbox', :name => 'ids[]', :value => issue.id, :style => 'display:none;', :class => 'toggle-selection')
view.content_tag(:span, s, :class => css_classes).html_safe