diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index fc4d866..9724d61 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -355,22 +355,24 @@ module ApplicationHelper # generates a image tag for the profile. # # If the profile has no image set yet, then a default image is used. - def profile_image(profile) - image_tag(profile_icon(profile), :alt => profile.name(), :title => '' ) + def profile_image(profile, size=:portrait, opt={}) + opt[:alt] ||= profile.name() + opt[:title] ||= '' + image_tag(profile_icon(profile, size), opt ) end - def profile_icon(profile) + def profile_icon( profile, size=:portrait ) if profile.image - profile.image.public_filename(:minor) + profile.image.public_filename( size ) else if profile.organization? if profile.kind_of?(Community) - 'icons-app/users.png' + '/images/icons-app/users_size-'+ size.to_s() +'.png' else - 'icons-app/gnome-home.png' + '/images/icons-app/gnome-home_size-'+ size.to_s() +'.png' end else - 'icons-app/user_icon.png' + '/images/icons-app/user_icon_size-'+ size.to_s() +'.png' end end @@ -378,8 +380,8 @@ module ApplicationHelper # displays a link to the profile homepage with its image (as generated by # #profile_image) and its name below it. - def profile_image_link(profile) - link_to( '
'+ profile_image(profile) +'
'+ profile.name() +'', profile.url, + def profile_image_link(profile, size=:portrait) + link_to( '
'+ profile_image(profile, size) +'
'+ profile.name() +'', profile.url, :help => _('Click on this icon to go to the %s\'s home page') % profile.name ) end diff --git a/app/models/image.rb b/app/models/image.rb index df00aa8..5c7fbcf 100644 --- a/app/models/image.rb +++ b/app/models/image.rb @@ -5,7 +5,10 @@ class Image < ActiveRecord::Base :storage => :file_system, :max_size => 500.kilobytes, :resize_to => '320x200>', - :thumbnails => { :thumb => '100x100>', :minor => '64x64>', :portrait => 'x95' , :icon => '20x20'} + :thumbnails => { :thumb => '100x100', + :portrait => '64x64', + :minor => '50x50', + :icon => '20x20!' } validates_as_attachment end diff --git a/app/views/blocks/profile_info.rhtml b/app/views/blocks/profile_info.rhtml index 1176044..fb7e0cd 100644 --- a/app/views/blocks/profile_info.rhtml +++ b/app/views/blocks/profile_info.rhtml @@ -1,6 +1,6 @@

<%= block.owner.name %>

-
<%= profile_image(block.owner) %>
+
<%= profile_image(block.owner, :thumb) %>