Retrospring/app/views/shared/_userbox.html.haml

25 lines
1.1 KiB
Plaintext
Raw Normal View History

- type ||= @type || :nil
2015-07-24 10:12:14 -07:00
- header_class = if user.profile_header.exists? then "userbox--header-container" else "userbox--no-header" end
2014-12-08 08:03:06 -08:00
.panel.panel-default
2015-07-24 10:12:14 -07:00
%div{class: header_class}
%img.userbox--header{src: user.profile_header.url(:mobile)}
2014-12-08 08:03:06 -08:00
.panel-body
2015-07-24 08:04:46 -07:00
%img.userbox--avatar{src: user.profile_picture.url(:small)}
%p.userbox--username
- if user.display_name.blank?
%a.profile--displayname{href: show_user_profile_path(user.screen_name)}
= user.screen_name
- else
%a.profile--displayname{href: show_user_profile_path(user.screen_name)}
= user.display_name
%span.profile--username
= user.screen_name
2014-12-08 08:03:06 -08:00
.row
.col-md-6.col-sm-6.col-xs-6
%h4.entry-text#asked-count= user.asked_count
%h6.entry-subtext= t('views.general.question').pluralize(user.asked_count)
2014-12-08 08:03:06 -08:00
.col-md-6.col-sm-6.col-xs-6
%h4.entry-text#answered-count= user.answered_count
%h6.entry-subtext= t('views.general.answer').pluralize(user.answered_count)
= render 'user/actions', user: user, type: type