Retrospring/app/views/moderation/_moderationbox.html.haml

47 lines
2.8 KiB
Plaintext
Raw Normal View History

2015-04-29 16:47:55 -07:00
- unless report.nil? or report.target.nil? or report.user.nil? or report.type.nil?
2020-04-19 14:31:24 -07:00
.card.moderationbox{data: { id: report.id }}
2020-04-19 14:09:41 -07:00
.card-header
%img.avatar-sm{src: report.user.profile_picture.url(:medium)}
= raw t('views.moderation.moderationbox.reported', user: user_screen_name(report.user), content: report.type.sub('Reports::', ''), time: time_tooltip(report))
2020-04-19 14:09:41 -07:00
.card-body
2015-04-27 19:25:46 -07:00
%p
- if report.type == 'Reports::User'
= user_screen_name report.target
- else
= report.target.content
%p
%b= t 'views.moderation.moderationbox.reason'
2015-04-21 19:59:10 -07:00
%br
2015-07-23 10:38:42 -07:00
- if report.reason.nil? or report.reason.strip.blank?
No reason provided
- else
- report.reason.lines.each do |reason|
- next if reason.strip.blank?
= reason.strip
2015-04-27 19:25:46 -07:00
.row
2015-07-23 10:38:42 -07:00
.col-md-8.col-sm-8.col-xs-8.text-left
2015-04-27 19:25:46 -07:00
%a.btn.btn-primary{href: content_url(report)}
= t('views.moderation.moderationbox.view', content: report.type.sub('Reports::', ''))
2015-04-27 21:52:54 -07:00
- if report.target.respond_to? :user and not report.target.user.nil?
%a.btn.btn-primary{href: show_user_profile_path(report.target.user.screen_name)}
= t('views.moderation.moderationbox.view', content: t('views.general.user'))
2015-07-23 10:38:42 -07:00
%a.btn.btn-primary{href: moderation_priority_path(report.target.user.id)}
Reports
%a.btn.btn-primary{href: moderation_ip_path(report.target.user.id)}
IP
.col-md-4.col-sm-4.col-xs-4.text-right
2015-04-27 19:25:46 -07:00
%span.mod-count{id: "mod-count-#{report.id}"}
= report.votes
.btn-group
%button.btn.btn-success.btn-sm{type: :button, name: "mod-vote", disabled: current_user.report_x_voted?(report, true) ? 'disabled' : nil, data: { id: report.id, action: current_user.report_voted?(report) ? 'unvote' : 'vote', vote_type: 'upvote' }}
%i.fa.fa-thumbs-up
%button.btn.btn-danger.btn-sm{type: :button, name: "mod-vote", disabled: current_user.report_x_voted?(report, false) ? 'disabled' : nil, data: { id: report.id, action: current_user.report_voted?(report) ? 'unvote' : 'vote', vote_type: 'downvote' }}
%i.fa.fa-thumbs-down
%button.btn.btn-primary.btn-sm{type: :button, name: 'mod-comments', data: { id: report.id, state: :hidden }}
%i.fa.fa-comments
%span{id: "mod-comment-count-#{report.id}"}= report.moderation_comments.all.count
%button.btn.btn-default.btn-sm{type: :button, name: "mod-delete-report", data: { id: report.id }}
%i.fa.fa-trash-o
2020-04-19 14:09:41 -07:00
.card-footer{id: "mod-comments-section-#{report.id}", style: 'display: none'}
2015-04-27 19:25:46 -07:00
%div{id: "mod-comments-#{report.id}"}= render 'moderation/discussion', report: report