added gravatar support
This commit is contained in:
parent
409cb8aa66
commit
2b81ad86db
|
@ -49,4 +49,8 @@ module ApplicationHelper
|
|||
def privileged?(user)
|
||||
(current_user && (current_user == user || current_user.admin?)) ? true : false
|
||||
end
|
||||
|
||||
def gravatar_url(user)
|
||||
"//www.gravatar.com/avatar/#{Digest::MD5.hexdigest(user.email)}"
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
.panel-heading
|
||||
.media
|
||||
%a.pull-left{href: '#'}
|
||||
%img.img-rounded.img-answerbox
|
||||
%img.img-rounded.img-answerbox{src: gravatar_url(a.question.user)}
|
||||
.media-body
|
||||
%h6.text-muted.media-heading.answerbox-question-user= user_screen_name a.question.user, a.question.author_is_anonymous
|
||||
%p.answerbox-question-text= a.question.content
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
.panel-body
|
||||
.row
|
||||
.col-md-12.col-xs-12.col-sm-9
|
||||
%img.img-rounded.img-profile
|
||||
%img.img-rounded.img-profile{src: gravatar_url(@user)}
|
||||
- if @user.display_name.blank?
|
||||
%h1= @user.screen_name
|
||||
- else
|
||||
|
|
Loading…
Reference in New Issue