[#802] Use the group.png icon as a Group avatar

This commit is contained in:
Eric Davis 2011-04-19 12:04:13 -07:00
parent 8e3d4da376
commit 16943d04f7
1 changed files with 6 additions and 0 deletions

View File

@ -912,6 +912,12 @@ module ApplicationHelper
# +user+ can be a User or a string that will be scanned for an email address (eg. 'joe <joe@foo.bar>')
def avatar(user, options = { })
if Setting.gravatar_enabled?
if user.is_a?(Group)
size = options[:size] || 50
size = "#{size}x#{size}" # image_tag uses WxH
options[:class] ||= 'gravatar'
return image_tag("group.png", options.merge(:size => size))
end
options.merge!({:ssl => (defined?(request) && request.ssl?), :default => Setting.gravatar_default})
email = nil
if user.respond_to?(:mail)