= turbo_frame_tag dom_id(report) do %div{class: "flex flex-col space-y-2 border rounded-md p-2 mt-2"} %div{class: "flex justify-between text-xs"} %span{class: "space-x-2"} - unless report.record.blank? = link_to report.record_path, data: { turbo: false }, target: "_blank" do %span{class: "bg-indigo-100 text-indigo-600 py-1 px-2 rounded-lg"}="#{report.record_type.upcase}##{report.record_id}" %span{class: "bg-yellow-100 text-yellow-600 rounded-md p-1"}=t("beetle_reporter.aasm_state.#{report.aasm_state}") - unless report.reasons.blank? - report.reasons.each do |reason| %span{class: "border border-red-600 text-red-600 rounded-lg text-xs p-0.5"}= reason %span{class: "flex space-x-2 items-center text-sm"} - if report.reason %span{class: "bg-red-100 text-red-600 p-1 rounded-lg"}= "处置原因:#{report.reason}" %span{class: "space-x-1"} - users = User.where(id: report.user_ids.compact.uniq) - users.each do |user| = link_to main_app.send(BeetleReporter.config.main_app_user_path_method.to_sym, user.id), data: {turbo: false} do = image_tag avatar(user), size: '24x24', class: "h-5 w-5 rounded-full border" %span{class: "w-5 h-5 flex justify-center items-center text-blue-600"}= "+#{report.reported_count}" %span{class: "bg-gray-100 text-gray-600 py-1 px-2 rounded-lg"} = link_to report.created_at, report_path(report), data: {turbo: false} - unless current_user&.admin? = button_to '删除', report, method: :delete, data: { confirm: 'Are you sure?'}, class: "bg-red-600 text-white rounded-md px-2 py-0.5 cursor-pointer" %div{class: "flex justify-between items-center py-2 w-full"} %div{class: "flex flex-col rounded-lg bg-gray-50 p-3 text-sm space-y-4 w-full"} - unless report.record %h3{class: "text-2xl text-red-600 flex items-center"} 对应条目已被永久删除,当前审核请求已无效 =button_to "点我删除", report, method: :delete, class: "ml-2 bg-yellow-500 text-white rounded-lg px-2 py-0.5 cursor-pointer" - else = render report.record_partial_path, record: report.record %div{class: "flex flex-col space-y-2"} - if report.may_ignore? = button_to "无效举报", report_ignore_path(report), class: "cursor-pointer px-2 py-0.5 bg-green-700 text-white rounded-lg" %span{class: "text-xs text-gray-500"} 用户乱举报的,没有触犯社区规范,点击后不会影响用户内容的可见性。 - if report.may_suspend? = button_to "暂缓处理", report_suspend_path(report), class: "cursor-pointer px-2 py-0.5 bg-yellow-700 text-white rounded-lg" %span{class: "text-xs text-gray-500"} 有争议的内容,拿捏不准的,先搁置,让大家一起来看一看怎么处理。 - if report.may_undo? = button_to "撤销", report_undo_path(report), class: "text-red-600 cursor-pointer px-2 py-0.5 bg-gray-100 rounded-lg" - if report.may_hide? = form_with(url: report_hide_path(report), class: "space-x-1 flex items-center") do |f| = f.text_field :reason, value: report.reason, placeholder: "隐藏原因是什么?", class: "border rounded-md m py-0.5 px-1" = f.submit "隐藏内容", class: "bg-red-500 text-white cursor-pointer px-2 py-0.5 bg-gray-100 rounded-lg" %span{class: "text-xs text-gray-500"} 举报属实,内容不适合公开展示,对其它人隐藏,对创建者可见。 - if report.may_remove? = form_with(url: report_remove_path(report), class: "space-x-1 flex items-center") do |f| = f.text_field :reason, value: report.reason, placeholder: "删除原因是什么?", class: "border rounded-md m py-0.5 px-1" = f.submit "删除内容", class: "bg-red-600 text-white cursor-pointer px-2 py-0.5 bg-gray-100 rounded-lg" %span{class: "text-xs text-gray-500"} 举报属实,不仅不适合展示,也不适合在平台里存在,违法乱纪、破坏和谐气氛的内容,直接删掉。 - if report.may_mute? = form_with(url: report_mute_path(report), class: "space-x-1 flex items-center") do |f| -# = f.text_field :mute_days, value: report.mute_days, placeholder: "禁言天数", class: "border rounded-md m py-0.5 px-1" = f.text_field :reason, value: report.reason, placeholder: "禁言原因是什么?", class: "border rounded-md m py-0.5 px-1" = f.submit "禁言用户", class: "bg-red-700 text-white cursor-pointer px-2 py-0.5 bg-gray-100 rounded-lg" %span{class: "text-xs text-gray-500"} 举报属实,该用户其它内容正常,只有少数几条奇怪的内容,除了删除内容之外也要禁言用户,关小黑屋清醒清醒。 - if report.may_forbid? = form_with(url: report_forbid_path(report), class: "space-x-1 flex items-center") do |f| = f.text_field :reason, value: report.reason, placeholder: "封禁原因是什么?", class: "border rounded-md m py-0.5 px-1" = f.submit "封禁用户", class: "bg-red-800 text-white cursor-pointer px-2 py-0.5 bg-gray-100 rounded-lg" %span{class: "text-xs text-gray-500"} 举报属实,ta就不是正常用户,搞黄色、发广告、违法乱纪的捣乱份子直接永久封禁,并删除其名下所有内容。