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,7 +482,12 @@ module ApplicationHelper | ||
482 | '/images/icons-app/enterprise-'+ size.to_s() +'.png' | 482 | '/images/icons-app/enterprise-'+ size.to_s() +'.png' |
483 | end | 483 | end |
484 | else | 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 | end | 491 | end |
487 | filename = default_or_themed_icon(icon) | 492 | filename = default_or_themed_icon(icon) |
488 | end | 493 | end |
@@ -602,7 +607,7 @@ module ApplicationHelper | @@ -602,7 +607,7 @@ module ApplicationHelper | ||
602 | end | 607 | end |
603 | 608 | ||
604 | def gravatar_default | 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 | end | 611 | end |
607 | 612 | ||
608 | attr_reader :environment | 613 | attr_reader :environment |