[refs #265] fixed user avatars
This commit is contained in:
parent
6d5120e5cc
commit
6a7d9636f5
|
@ -1,7 +1,12 @@
|
|||
# -*- encoding : utf-8 -*-
|
||||
module UsersHelper
|
||||
|
||||
def avatar_url_by_email(email, size = :small)
|
||||
avatar_url(User.where(:email => email).first, size)
|
||||
end
|
||||
|
||||
def avatar_url(user, size = :small)
|
||||
if user.avatar?
|
||||
if user.try('avatar?')
|
||||
user.avatar.url(size)
|
||||
else
|
||||
gravatar_url(user.email, user.avatar.styles[size].geometry.split('x').first)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
- if defined? user_email
|
||||
.top
|
||||
.image
|
||||
= image_tag(gravatar_url(user_email, 30))
|
||||
= image_tag(avatar_url_by_email(user_email, :small), :alt => 'avatar')
|
||||
.text
|
||||
%span.name
|
||||
= link_to user_name, user_path(user_id)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.top
|
||||
.image
|
||||
= image_tag(gravatar_url(activity_feed.user.email, 30))
|
||||
= image_tag(avatar_url_by_email(activity_feed.user.email, :small), :alt => 'avatar')
|
||||
.text
|
||||
%span.name
|
||||
= link_to activity_feed.user.uname, user_path(activity_feed.user.uname)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.top
|
||||
.image
|
||||
= image_tag(gravatar_url(user_email, 30))
|
||||
= image_tag(avatar_url_by_email(user_email, :small), :alt => 'avatar')
|
||||
.text
|
||||
%span.name
|
||||
= link_to user_name, user_path(user_id)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.top
|
||||
.image
|
||||
= image_tag(gravatar_url(user_email, 30))
|
||||
= image_tag(avatar_url_by_email(user_email, :small), :alt => 'avatar')
|
||||
.text
|
||||
%span.name
|
||||
= link_to user_name, user_path(user_id)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.top
|
||||
.image
|
||||
= image_tag(gravatar_url(user_email, 30))
|
||||
= image_tag(avatar_url_by_email(user_email, :small), :alt => 'avatar')
|
||||
.text
|
||||
%span.name
|
||||
= link_to user_name, user_path(user_id)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.top
|
||||
.image
|
||||
= image_tag(gravatar_url(activity_feed.user.email, 30))
|
||||
= image_tag(avatar_url_by_email(activity_feed.user.email, :small), :alt => 'avatar')
|
||||
.text
|
||||
%span.name
|
||||
= link_to activity_feed.user.uname, user_path(activity_feed.user.uname)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.top
|
||||
.image
|
||||
= image_tag(gravatar_url(user_email, 30))
|
||||
= image_tag(avatar_url_by_email(user_email, :small), :alt => 'avatar')
|
||||
.text
|
||||
%span.name
|
||||
= link_to user_name, user_path(user_id)
|
||||
|
|
Loading…
Reference in New Issue