This commit is contained in:
Yuki 2015-04-28 07:55:46 +05:30
parent bd3564d6f3
commit d012423b29

View file

@ -1,43 +1,44 @@
.panel.panel-default.moderationbox{data: { id: report.id }} = unless report.target.nil?
.panel-heading .panel.panel-default.moderationbox{data: { id: report.id }}
%img.img-rounded.answerbox--img{src: gravatar_url(report.user)} .panel-heading
= user_screen_name report.user %img.img-rounded.answerbox--img{src: gravatar_url(report.user)}
reported a = user_screen_name report.user
= report.type.sub('Reports::', '') reported a
%span{title: report.created_at, data: { toggle: :tooltip, placement: :bottom }} = report.type.sub('Reports::', '')
= time_ago_in_words(report.created_at) %span{title: report.created_at, data: { toggle: :tooltip, placement: :bottom }}
ago = time_ago_in_words(report.created_at)
.panel-body ago
%p .panel-body
- if report.type == 'Reports::User' %p
= user_screen_name report.target - if report.type == 'Reports::User'
- else = user_screen_name report.target
= report.target.content - else
%p = report.target.content
%b %p
Reason: %b
%br Reason:
- (report.reason || "No reason provided.").lines.each do |reason|
- next unless reason.strip.length > 0
= reason.strip
%br %br
.row - (report.reason || "No reason provided.").lines.each do |reason|
.col-md-6.col-sm-4.col-xs-6.text-left - next unless reason.strip.length > 0
%a.btn.btn-primary{href: content_url(report)} = reason.strip
View reported %br
= report.type.sub('Reports::', '') .row
.col-md-6.col-sm-8.col-xs-6.text-right .col-md-6.col-sm-4.col-xs-6.text-left
%span.mod-count{id: "mod-count-#{report.id}"} %a.btn.btn-primary{href: content_url(report)}
= report.votes View reported
.btn-group = report.type.sub('Reports::', '')
%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' }} .col-md-6.col-sm-8.col-xs-6.text-right
%i.fa.fa-thumbs-up %span.mod-count{id: "mod-count-#{report.id}"}
%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' }} = report.votes
%i.fa.fa-thumbs-down .btn-group
%button.btn.btn-primary.btn-sm{type: :button, name: 'mod-comments', data: { id: report.id, state: :hidden }} %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-comments %i.fa.fa-thumbs-up
%span{id: "mod-comment-count-#{report.id}"}= report.moderation_comments.all.count %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' }}
%button.btn.btn-default.btn-sm{type: :button, name: "mod-delete-report", data: { id: report.id }} %i.fa.fa-thumbs-down
%i.fa.fa-trash-o %button.btn.btn-primary.btn-sm{type: :button, name: 'mod-comments', data: { id: report.id, state: :hidden }}
.panel-footer{id: "mod-comments-section-#{report.id}", style: 'display: none'} %i.fa.fa-comments
%div{id: "mod-comments-#{report.id}"}= render 'moderation/discussion', report: report %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
.panel-footer{id: "mod-comments-section-#{report.id}", style: 'display: none'}
%div{id: "mod-comments-#{report.id}"}= render 'moderation/discussion', report: report