Retrospring/app/views/discover/_userbox.haml

24 lines
981 B
Plaintext

.card{ data: { id: u.id } }
.card-body
.media
.pull-left
%a{ href: show_user_profile_path(u.screen_name) }
%img.avatar-md.mr-2{ src: u.profile_picture.url(:medium) }
.media-body
%h6.media-heading.answerbox__question-user
- if u.profile.display_name.blank?
%a{ href: show_user_profile_path(u.screen_name) }
= u.screen_name
- else
%a{ href: show_user_profile_path(u.screen_name) }
= u.profile.display_name
%span.text-muted= u.screen_name
%p.answerbox__question-text
- case type
- when 'new'
= t('views.discover.userbox.new', time: time_ago_in_words(u.created_at))
- when 'most'
= t('views.discover.userbox.answers', questions: pluralize(a, t('views.general.question')))
- else
= t('views.discover.userbox.questions', questions: pluralize(q, t('views.general.question')))