Commit 14300a059b408c53a71740a0ee09a56be012d695
1 parent
adc8efa4
Exists in
master
and in
29 other branches
profile_icon: use gravatar for users with no image
Showing
1 changed file
with
7 additions
and
2 deletions
Show diff stats
app/helpers/application_helper.rb
... | ... | @@ -482,7 +482,12 @@ module ApplicationHelper |
482 | 482 | '/images/icons-app/enterprise-'+ size.to_s() +'.png' |
483 | 483 | end |
484 | 484 | else |
485 | - '/images/icons-app/person-'+ size.to_s() +'.png' | |
485 | + pixels = Image.attachment_options[:thumbnails][size].split('x').first | |
486 | + gravatar_profile_image_url( | |
487 | + profile.email, | |
488 | + :size => pixels, | |
489 | + :d => gravatar_default | |
490 | + ) | |
486 | 491 | end |
487 | 492 | filename = default_or_themed_icon(icon) |
488 | 493 | end |
... | ... | @@ -602,7 +607,7 @@ module ApplicationHelper |
602 | 607 | end |
603 | 608 | |
604 | 609 | def gravatar_default |
605 | - (respond_to?(:theme_option) && theme_option.present? && theme_option['gravatar']) || NOOSFERO_CONF['gravatar'] | |
610 | + (respond_to?(:theme_option) && theme_option.present? && theme_option['gravatar']) || NOOSFERO_CONF['gravatar'] || 'mm' | |
606 | 611 | end |
607 | 612 | |
608 | 613 | attr_reader :environment | ... | ... |