beetle_reporter 0.1.4 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5e21f52dd81361247e7975618d2845f2f4fcad19105ccc425de454b56ac2d68e
4
- data.tar.gz: 78a8a0b42e6109b2635999728cbd17007b9cdc848d218e73f01fb0add257d085
3
+ metadata.gz: 89a824b1134a4d7c1db329309cff7ec1074e7b18a56854a911e7c22cdf3b80c3
4
+ data.tar.gz: af1e7cff0b5eef232f253195f8b551dde655529356f2580d7d6225a828e7d483
5
5
  SHA512:
6
- metadata.gz: 3a433451965599cf2dd833c770d4a588e742158cf99fcafe3d47822fd005dc41cc2acfafea4cf606ab95825017e7fd778d12b0b9d316d5c038f0082f1dcedea7
7
- data.tar.gz: 8ad3142dc940e29a0990e4ed054da58251dbcdcb8af33e006abdf131fb4bdd42c9aec86d54db4bbc8e9e4e13d623192c073a5c3b2e946ae0d7c2345bbd2c570a
6
+ metadata.gz: 6d52929b375e412dc1c4c98aace2bf38a8cfa8acc67f481f2b845372b88a6b6fd65f30130ffc0ce0013fc8d0f9e2d904357cc8f92b87379141b016f389936d12
7
+ data.tar.gz: a6c2bc9a18227aca88727ab259102781b28652ddfece8d9e56364aa78065ffa324a0fbab2cd8add842e1c2a2ace99fb0b53261dd126fafbe03840461b5747028
@@ -5,5 +5,10 @@ module BeetleReporter
5
5
  def current_user
6
6
  main_app.scope.request.env['warden']&.user
7
7
  end
8
+
9
+ def avatar(user)
10
+ return user.avatar unless user.avatar.blank?
11
+ Avatarro.image(user.nickname.first) if user.respond_to?(:nickname)
12
+ end
8
13
  end
9
14
  end
@@ -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
 
@@ -12,11 +12,12 @@
12
12
  %span{class: "flex space-x-2 items-center text-sm"}
13
13
  - if report.reason
14
14
  %span{class: "bg-red-100 text-red-600 p-1 rounded-lg"}= "处置原因:#{report.reason}"
15
- %span{class: "space-x-1"}
16
- - report.user_ids.compact.uniq.each do |uid|
17
- = link_to main_app.send(BeetleReporter.config.main_app_user_path_method.to_sym, uid), data: {turbo: false} do
18
- %span{class: "bg-blue-100 rounded-lg px-1 py-0.5"}= "#{uid}"
19
- %span{class: "bg-red-600 text-white rounded-full w-5 h-5 flex justify-center items-center"}= "#{report.reported_count}"
15
+ %span{class: "flex space-x-0.5"}
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: "text-yellow-600 cursor-pointer px-2 py-0.5 bg-gray-100 rounded-lg"
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: "text-indigo-600 cursor-pointer px-2 py-0.5 bg-gray-100 rounded-lg"
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
 
@@ -1,3 +1,3 @@
1
1
  module BeetleReporter
2
- VERSION = '0.1.4'
2
+ VERSION = '0.1.8'
3
3
  end
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
4
+ version: 0.1.8
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-18 00:00:00.000000000 Z
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