beetle_reporter 0.1.3 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/helpers/beetle_reporter/application_helper.rb +5 -0
- data/app/models/beetle_reporter/report.rb +2 -11
- data/app/views/beetle_reporter/reports/_report.html.haml +13 -6
- data/app/views/layouts/beetle_reporter/application.html.haml +1 -1
- data/lib/beetle_reporter/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 436169fe4f1466be6f330254612d38b03501873c2d0be73431bcae949b2cccf7
|
4
|
+
data.tar.gz: d86fbd6f0b83c33c9b530b7041e63aa2ddca42acb33bb28a6c8548e872ff0f5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c0799f0682d92a24200d383e2decc8ac3efac75e5706fb568664e00c33aed3a29bcc8a395d924fa8b71a30dea56319a2656e5b65289d2f79d1c301c6af24958
|
7
|
+
data.tar.gz: 831c910960df2675b97281322ee00db8e7b40bb89b93258f1d21ff2fcf72364715b33c8d18c5293512d251348b106b0543df166217ae0f5e6f9cb090564262cc
|
@@ -62,16 +62,7 @@ module BeetleReporter
|
|
62
62
|
return if record&.user.blank?
|
63
63
|
raise NoMethodError unless record.respond_to?(:beetle_mute)
|
64
64
|
|
65
|
-
ret = record.beetle_mute
|
66
|
-
mute!(reason) if ret
|
67
|
-
end
|
68
|
-
|
69
|
-
def beetle_mute(reason)
|
70
|
-
return if record.blank?
|
71
|
-
return if record&.user.blank?
|
72
|
-
raise NoMethodError unless record.respond_to?(:beetle_mute)
|
73
|
-
|
74
|
-
ret = record.beetle_mute
|
65
|
+
ret = record.beetle_mute(reason)
|
75
66
|
mute!(reason) if ret
|
76
67
|
end
|
77
68
|
|
@@ -80,7 +71,7 @@ module BeetleReporter
|
|
80
71
|
return if record&.user.blank?
|
81
72
|
raise NoMethodError unless record.respond_to?(:beetle_forbid)
|
82
73
|
|
83
|
-
ret = record.beetle_forbid
|
74
|
+
ret = record.beetle_forbid(reason)
|
84
75
|
forbid!(reason) if ret
|
85
76
|
end
|
86
77
|
|
@@ -13,10 +13,11 @@
|
|
13
13
|
- if report.reason
|
14
14
|
%span{class: "bg-red-100 text-red-600 p-1 rounded-lg"}= "处置原因:#{report.reason}"
|
15
15
|
%span{class: "space-x-1"}
|
16
|
-
- report.user_ids.
|
17
|
-
|
18
|
-
|
19
|
-
|
16
|
+
- users = User.where(id: report.user_ids.compact.uniq)
|
17
|
+
- users.each do |user|
|
18
|
+
= link_to main_app.send(BeetleReporter.config.main_app_user_path_method.to_sym, user.id), data: {turbo: false} do
|
19
|
+
= image_tag avatar(user), size: '24x24', class: "h-5 w-5 rounded-full border"
|
20
|
+
%span{class: "w-5 h-5 flex justify-center items-center text-blue-600"}= "+#{report.reported_count}"
|
20
21
|
%span{class: "bg-gray-100 text-gray-600 py-1 px-2 rounded-lg"}
|
21
22
|
= link_to report.created_at, report_path(report), data: {turbo: false}
|
22
23
|
- unless current_user&.admin?
|
@@ -31,25 +32,31 @@
|
|
31
32
|
= render report.record_partial_path, record: report.record
|
32
33
|
%div{class: "flex flex-col space-y-2"}
|
33
34
|
- if report.may_ignore?
|
34
|
-
= button_to "无效举报", report_ignore_path(report), class: "
|
35
|
+
= button_to "无效举报", report_ignore_path(report), class: "cursor-pointer px-2 py-0.5 bg-green-700 text-white rounded-lg"
|
36
|
+
%span{class: "text-xs text-gray-500"} 用户乱举报的,没有触犯社区规范,点击后不会影响用户内容的可见性。
|
35
37
|
- if report.may_suspend?
|
36
|
-
= button_to "暂缓处理", report_suspend_path(report), class: "
|
38
|
+
= button_to "暂缓处理", report_suspend_path(report), class: "cursor-pointer px-2 py-0.5 bg-yellow-700 text-white rounded-lg"
|
39
|
+
%span{class: "text-xs text-gray-500"} 有争议的内容,拿捏不准的,先搁置,让大家一起来看一看怎么处理。
|
37
40
|
- if report.may_undo?
|
38
41
|
= button_to "撤销", report_undo_path(report), class: "text-red-600 cursor-pointer px-2 py-0.5 bg-gray-100 rounded-lg"
|
39
42
|
- if report.may_hide?
|
40
43
|
= form_with(url: report_hide_path(report), class: "space-x-1 flex items-center") do |f|
|
41
44
|
= f.text_field :reason, value: report.reason, placeholder: "隐藏原因是什么?", class: "border rounded-md m py-0.5 px-1"
|
42
45
|
= f.submit "隐藏内容", class: "bg-red-500 text-white cursor-pointer px-2 py-0.5 bg-gray-100 rounded-lg"
|
46
|
+
%span{class: "text-xs text-gray-500"} 举报属实,内容不适合公开展示,对其它人隐藏,对创建者可见。
|
43
47
|
- if report.may_remove?
|
44
48
|
= form_with(url: report_remove_path(report), class: "space-x-1 flex items-center") do |f|
|
45
49
|
= f.text_field :reason, value: report.reason, placeholder: "删除原因是什么?", class: "border rounded-md m py-0.5 px-1"
|
46
50
|
= f.submit "删除内容", class: "bg-red-600 text-white cursor-pointer px-2 py-0.5 bg-gray-100 rounded-lg"
|
51
|
+
%span{class: "text-xs text-gray-500"} 举报属实,不仅不适合展示,也不适合在平台里存在,违法乱纪、破坏和谐气氛的内容,直接删掉。
|
47
52
|
- if report.may_mute?
|
48
53
|
= form_with(url: report_mute_path(report), class: "space-x-1 flex items-center") do |f|
|
49
54
|
-# = f.text_field :mute_days, value: report.mute_days, placeholder: "禁言天数", class: "border rounded-md m py-0.5 px-1"
|
50
55
|
= f.text_field :reason, value: report.reason, placeholder: "禁言原因是什么?", class: "border rounded-md m py-0.5 px-1"
|
51
56
|
= f.submit "禁言用户", class: "bg-red-700 text-white cursor-pointer px-2 py-0.5 bg-gray-100 rounded-lg"
|
57
|
+
%span{class: "text-xs text-gray-500"} 举报属实,该用户其它内容正常,只有少数几条奇怪的内容,除了删除内容之外也要禁言用户,关小黑屋清醒清醒。
|
52
58
|
- if report.may_forbid?
|
53
59
|
= form_with(url: report_forbid_path(report), class: "space-x-1 flex items-center") do |f|
|
54
60
|
= f.text_field :reason, value: report.reason, placeholder: "封禁原因是什么?", class: "border rounded-md m py-0.5 px-1"
|
55
61
|
= f.submit "封禁用户", class: "bg-red-800 text-white cursor-pointer px-2 py-0.5 bg-gray-100 rounded-lg"
|
62
|
+
%span{class: "text-xs text-gray-500"} 举报属实,ta就不是正常用户,搞黄色、发广告、违法乱纪的捣乱份子直接永久封禁,并删除其名下所有内容。
|
@@ -14,7 +14,7 @@
|
|
14
14
|
%span 举报中心
|
15
15
|
|
16
16
|
%ul{class: "flex justify-end items-center space-x-2 text-blue-600"}
|
17
|
-
%li= link_to "待处理(#{BeetleReporter::Report.pending.count})", reports_path
|
17
|
+
%li= link_to "待处理(#{BeetleReporter::Report.kept.pending.count})", reports_path
|
18
18
|
%li= link_to "控制台", main_app.send(BeetleReporter.config.main_app_root_path_method.to_sym)
|
19
19
|
%li= current_user.email
|
20
20
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beetle_reporter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 42up
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-12-
|
11
|
+
date: 2021-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '5.6'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: avatarro
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 0.1.0
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 0.1.0
|
111
125
|
description: Description of BeetleReporter.
|
112
126
|
email:
|
113
127
|
- foobar@v2up.com
|