mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-01-31 13:59:07 +01:00
added gravatar support
This commit is contained in:
parent
409cb8aa66
commit
2b81ad86db
3 changed files with 6 additions and 2 deletions
|
@ -49,4 +49,8 @@ module ApplicationHelper
|
||||||
def privileged?(user)
|
def privileged?(user)
|
||||||
(current_user && (current_user == user || current_user.admin?)) ? true : false
|
(current_user && (current_user == user || current_user.admin?)) ? true : false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def gravatar_url(user)
|
||||||
|
"//www.gravatar.com/avatar/#{Digest::MD5.hexdigest(user.email)}"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
.panel-heading
|
.panel-heading
|
||||||
.media
|
.media
|
||||||
%a.pull-left{href: '#'}
|
%a.pull-left{href: '#'}
|
||||||
%img.img-rounded.img-answerbox
|
%img.img-rounded.img-answerbox{src: gravatar_url(a.question.user)}
|
||||||
.media-body
|
.media-body
|
||||||
%h6.text-muted.media-heading.answerbox-question-user= user_screen_name a.question.user, a.question.author_is_anonymous
|
%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
|
%p.answerbox-question-text= a.question.content
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
.panel-body
|
.panel-body
|
||||||
.row
|
.row
|
||||||
.col-md-12.col-xs-12.col-sm-9
|
.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?
|
- if @user.display_name.blank?
|
||||||
%h1= @user.screen_name
|
%h1= @user.screen_name
|
||||||
- else
|
- else
|
||||||
|
|
Loading…
Reference in a new issue