Commit 2c37fa381e80135b7b2e87163a46ca2ecee15925
1 parent
552c2d66
Exists in
master
and in
4 other branches
fix some glitches in gravatar image url generation
always use proper size value do not show alt text when avatar image not loaded
Showing
2 changed files
with
4 additions
and
2 deletions
Show diff stats
app/decorators/commit_decorator.rb
@@ -76,7 +76,7 @@ class CommitDecorator < ApplicationDecorator | @@ -76,7 +76,7 @@ class CommitDecorator < ApplicationDecorator | ||
76 | source_name = send "#{options[:source]}_name".to_sym | 76 | source_name = send "#{options[:source]}_name".to_sym |
77 | source_email = send "#{options[:source]}_email".to_sym | 77 | source_email = send "#{options[:source]}_email".to_sym |
78 | text = if options[:avatar] | 78 | text = if options[:avatar] |
79 | - avatar = h.image_tag h.gravatar_icon(source_email, options[:size]), class: "avatar #{"s#{options[:size]}" if options[:size]}", width: options[:size] | 79 | + avatar = h.image_tag h.gravatar_icon(source_email, options[:size]), class: "avatar #{"s#{options[:size]}" if options[:size]}", width: options[:size], alt: "" |
80 | %Q{#{avatar} <span class="commit-#{options[:source]}-name">#{source_name}</span>} | 80 | %Q{#{avatar} <span class="commit-#{options[:source]}-name">#{source_name}</span>} |
81 | else | 81 | else |
82 | source_name | 82 | source_name |
app/helpers/application_helper.rb
@@ -30,7 +30,9 @@ module ApplicationHelper | @@ -30,7 +30,9 @@ module ApplicationHelper | ||
30 | args.any? { |v| v.to_s.downcase == action_name } | 30 | args.any? { |v| v.to_s.downcase == action_name } |
31 | end | 31 | end |
32 | 32 | ||
33 | - def gravatar_icon(user_email = '', size = 40) | 33 | + def gravatar_icon(user_email = '', size = nil) |
34 | + size = 40 if size.nil? || size <= 0 | ||
35 | + | ||
34 | if Gitlab.config.disable_gravatar? || user_email.blank? | 36 | if Gitlab.config.disable_gravatar? || user_email.blank? |
35 | 'no_avatar.png' | 37 | 'no_avatar.png' |
36 | else | 38 | else |