retrospring/app/views/discover/_userbox.haml
Georg Gadinger 66efa5d4f4 clean up routes
- replace `match` with `get`/`post`/`patch`/`delete`
- format routes.rb
- rename the `show_user_{profile,question,answer}` routes to
  `profile`, `question`, `answer` so `url_for` (used by Rails Admin)
  works fine for these things
- also add `to_param` to the `User` model so that `url_for(some_user)`
  uses the user name
2022-07-23 12:14:06 +02:00

23 lines
906 B
Text

.card{ data: { id: u.id } }
.card-body
.media
.pull-left
%a{ href: user_path(u) }
%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: user_path(u) }
= u.screen_name
- else
%a{ href: user_path(u) }
= 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')))