beetle_reporter 0.1.6 → 0.1.7

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: 24b6563a2096ba4ca3eb345d77e54cea2a943094593dda9bcd92b618c401e7f0
4
- data.tar.gz: 0a870def812d3a4a859d52a048aa1446441bdf7bbc17777bc1f8a3f960151321
3
+ metadata.gz: 436169fe4f1466be6f330254612d38b03501873c2d0be73431bcae949b2cccf7
4
+ data.tar.gz: d86fbd6f0b83c33c9b530b7041e63aa2ddca42acb33bb28a6c8548e872ff0f5e
5
5
  SHA512:
6
- metadata.gz: 6ad09509f95b58aef57b4b49369da7728bb67dd314b249e90c870087e8b5ef83ed92bcc29e2ef21b5424c500193c96fbd49fb7f40e602371eb4476d77ea1e0c8
7
- data.tar.gz: ee6fa6748f925ca7ad340e717017a5de2686c355c950e700cf9400ad263f475d1cf8bcc865082c8915ce11c1eeb2e6d54578013efd23257413d70cd514b8e40d
6
+ metadata.gz: 7c0799f0682d92a24200d383e2decc8ac3efac75e5706fb568664e00c33aed3a29bcc8a395d924fa8b71a30dea56319a2656e5b65289d2f79d1c301c6af24958
7
+ data.tar.gz: 831c910960df2675b97281322ee00db8e7b40bb89b93258f1d21ff2fcf72364715b33c8d18c5293512d251348b106b0543df166217ae0f5e6f9cb090564262cc
@@ -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
@@ -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.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}"
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就不是正常用户,搞黄色、发广告、违法乱纪的捣乱份子直接永久封禁,并删除其名下所有内容。
@@ -1,3 +1,3 @@
1
1
  module BeetleReporter
2
- VERSION = '0.1.6'
2
+ VERSION = '0.1.7'
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.6
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-19 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