Retrospring/app/views/moderation/_moderationbox.haml

34 lines
1.4 KiB
Plaintext

- unless report.nil? || report.target.nil? || report.user.nil? || report.type.nil?
.card.moderationbox{ data: { id: report.id } }
.card-header
%img.avatar-sm{ src: report.user.profile_picture.url(:medium) }
= t('.reported_html',
user: user_screen_name(report.user),
content: report.type.sub('Reports::', ''),
time: time_tooltip(report))
.card-body
%p
- if report.type == 'Reports::User'
= user_screen_name report.target
- else
= report.target.content
%p
%b= t('.reason.heading')
%br
- if report.reason.nil? || report.reason.strip.blank?
= t('.reason.none')
- else
- report.reason.lines.each do |reason|
- next if reason.strip.blank?
= reason.strip
.row
.col-md-8.col-sm-8.col-xs-8.text-left
%a.btn.btn-primary{ href: content_url(report) }
= t('.view', content: report.type.sub('Reports::', ''))
- if report.target.respond_to?(:user) && report.target.user
%a.btn.btn-primary{ href: user_path(report.target.user) }
= t('.view', content: t('activerecord.models.user.one'))
.col-md-4.col-sm-4.col-xs-4.text-right
%button.btn.btn-default.btn-sm{ type: :button, name: 'mod-delete-report', data: { id: report.id } }
%i.fa.fa-trash-o