added gravatar support

This commit is contained in:
pixeldesu 2014-11-30 14:31:38 +01:00
parent 409cb8aa66
commit 2b81ad86db
3 changed files with 6 additions and 2 deletions

View File

@ -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

View File

@ -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

View File

@ -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