]> git.openstreetmap.org Git - rails.git/blob - app/helpers/user_helper.rb
Merge branch 'master' into notes
[rails.git] / app / helpers / user_helper.rb
1 module UserHelper
2   def user_image(user, options = {})
3     options[:class] ||= "user_image"
4
5     image_tag user.image.url(:large), options
6   end
7
8   def user_thumbnail(user, options = {})
9     options[:class] ||= "user_thumbnail"
10
11     image_tag user.image.url(:small), options
12   end
13
14   def user_thumbnail_tiny(user, options = {})
15     options[:class] ||= "user_thumbnail_tiny"
16
17     image_tag user.image.url(:small), options
18   end
19
20   def openid_logo
21     image_tag "openid_small.png", :alt => t('user.login.openid_logo_alt'), :class => "openid_logo"
22   end
23
24   def openid_button(name, url)
25     link_to(
26       image_tag("#{name}.png", :alt => t("user.login.openid_providers.#{name}.alt")),
27       "#",
28       :class => "openid_button", :data => { :url => url },
29       :title => t("user.login.openid_providers.#{name}.title")
30     )
31   end
32 end