diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index c664fd6dbe..41f76e5c4d 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1482,6 +1482,10 @@ module ApplicationHelper def avatar(user, options = { }) if Setting.gravatar_enabled? options.merge!(:default => Setting.gravatar_default) + # style for HTML mail + if options.delete(:html_mail) + options[:style] = "#{options[:style]}width:14px;height:14px;border-radius:20%;vertical-align:middle;" + end email = nil if user.respond_to?(:mail) email = user.mail diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index b49fe8983a..db3fe5eaa6 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -320,7 +320,11 @@ module IssuesHelper %w(author status priority assigned_to category fixed_version start_date due_date).each do |attribute| if issue.disabled_core_fields.grep(/^#{attribute}(_id)?$/).empty? if html - items << content_tag('strong', "#{l("field_#{attribute}")}: ") + (issue.send attribute) + value = issue.send(attribute) + if %w(author assigned_to).include?(attribute) && value.is_a?(User) + value = "#{avatar(value, :title => l("field_#{attribute}"), :html_mail => true)}#{value}".html_safe + end + items << content_tag('strong', "#{l("field_#{attribute}")}: ") + value else items << "#{l("field_#{attribute}")}: #{issue.send attribute}" end diff --git a/app/views/mailer/issue_add.html.erb b/app/views/mailer/issue_add.html.erb index 7bb6115b59..28669bb3cf 100644 --- a/app/views/mailer/issue_add.html.erb +++ b/app/views/mailer/issue_add.html.erb @@ -1,3 +1,5 @@ -<%= l(:text_issue_added, :id => link_to("##{@issue.id}", @issue_url), :author => h(@issue.author)).html_safe %> +<%= l(:text_issue_added, + :id => link_to("##{@issue.id}", @issue_url), + :author => "#{avatar(@issue.author, :html_mail => true)}#{h(@issue.author)}").html_safe %>
<%= render :partial => 'issue', :formats => [:html], :locals => { :issue => @issue, :user => @user, :issue_url => @issue_url } %> diff --git a/app/views/mailer/issue_edit.html.erb b/app/views/mailer/issue_edit.html.erb index b5bdd88eed..08088f9875 100644 --- a/app/views/mailer/issue_edit.html.erb +++ b/app/views/mailer/issue_edit.html.erb @@ -1,7 +1,9 @@ <% if @journal.private_notes? %> (<%= l(:field_private_notes) %>) <% end %> -<%= l(:text_issue_updated, :id => link_to("##{@issue.id}", @issue_url), :author => h(@journal.user)).html_safe %> +<%= l(:text_issue_updated, + :id => link_to("##{@issue.id}", @issue_url), + :author => "#{avatar(@journal.user, :html_mail => true)}#{h(@journal.user)}").html_safe %>