beetle_reporter 0.1.8 → 0.1.10

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: 89a824b1134a4d7c1db329309cff7ec1074e7b18a56854a911e7c22cdf3b80c3
4
- data.tar.gz: af1e7cff0b5eef232f253195f8b551dde655529356f2580d7d6225a828e7d483
3
+ metadata.gz: 2834e53b73b588a91d20e780ea8e7c7fa14e686b125d58a898f745b7524f8a9b
4
+ data.tar.gz: 79e7865beb6ff67e5d81719009f02a390c279aee32273c31ad86eee48062f034
5
5
  SHA512:
6
- metadata.gz: 6d52929b375e412dc1c4c98aace2bf38a8cfa8acc67f481f2b845372b88a6b6fd65f30130ffc0ce0013fc8d0f9e2d904357cc8f92b87379141b016f389936d12
7
- data.tar.gz: a6c2bc9a18227aca88727ab259102781b28652ddfece8d9e56364aa78065ffa324a0fbab2cd8add842e1c2a2ace99fb0b53261dd126fafbe03840461b5747028
6
+ metadata.gz: a9fdca2819e0c62fd6b655c99809507fddf827122c982e23fda5589b3f09cbf2305986c817338655c77a7091f87182193174b164752f44d53660dd94b6a9d5c0
7
+ data.tar.gz: 8bbf5eb732ac952b79befeea711b7130e2582b59f17a6e4993f2d30bef034b8cc77a52611145334c161b4ead2d5b56bb6a5b7dcbace781eabfd84ac0f4071a53
data/Rakefile CHANGED
@@ -5,4 +5,4 @@ load "rails/tasks/engine.rake"
5
5
 
6
6
  load "rails/tasks/statistics.rake"
7
7
 
8
- require "bundler/gem_tasks"
8
+ require "bundler/gem_tasks"
@@ -4,6 +4,15 @@ module BeetleReporter
4
4
  include Discard::Model
5
5
 
6
6
  REASON_TYPES = %w(垃圾广告营销 侮辱谩骂内容 淫秽色情内容 涉政敏感信息 违法有害信息 内容令人不适 内容存在错误)
7
+ PROCESS_REASON_LIST = %w(
8
+ 发布垃圾、无意义内容
9
+ 发布恐吓行为/骚扰内容
10
+ 发布营销广告内容
11
+ 发布谩骂、酸讽、引战内容
12
+ 发布令人不适内容
13
+ 发布淫秽色情内容
14
+ 发布涉政敏感违法有害信息
15
+ )
7
16
 
8
17
  belongs_to :record, polymorphic: true, required: false
9
18
  belongs_to :user, class_name: BeetleReporter.config.user_class, optional: true
@@ -1,3 +1,32 @@
1
+ - content_for :head do
2
+ :javascript
3
+ document.addEventListener("turbo:load", () => {
4
+ const hide_reason_input = document.querySelector('#hide_reason');
5
+ const hide_reason_list = document.querySelector('#hide_reason_list');
6
+ hide_reason_list.addEventListener('change', (event) => {
7
+ hide_reason_input.value = event.target.value;
8
+ })
9
+
10
+ const remove_reason_input = document.querySelector('#remove_reason');
11
+ const remove_reason_list = document.querySelector('#remove_reason_list');
12
+ remove_reason_list.addEventListener('change', (event) => {
13
+ remove_reason_input.value = event.target.value;
14
+ })
15
+
16
+ const mute_reason_input = document.querySelector('#mute_reason');
17
+ const mute_reason_list = document.querySelector('#mute_reason_list');
18
+ mute_reason_list.addEventListener('change', (event) => {
19
+ mute_reason_input.value = event.target.value;
20
+ })
21
+
22
+ const ban_reason_input = document.querySelector('#ban_reason');
23
+ const ban_reason_list = document.querySelector('#ban_reason_list');
24
+ ban_reason_list.addEventListener('change', (event) => {
25
+ ban_reason_input.value = event.target.value;
26
+ })
27
+ });
28
+
29
+
1
30
  = turbo_frame_tag dom_id(report) do
2
31
  %div{class: "flex flex-col space-y-2 border rounded-md p-2 mt-2"}
3
32
  %div{class: "flex justify-between text-xs"}
@@ -41,22 +70,26 @@
41
70
  = button_to "撤销", report_undo_path(report), class: "text-red-600 cursor-pointer px-2 py-0.5 bg-gray-100 rounded-lg"
42
71
  - if report.may_hide?
43
72
  = form_with(url: report_hide_path(report), class: "space-x-1 flex items-center") do |f|
44
- = f.text_field :reason, value: report.reason, placeholder: "隐藏原因是什么?", class: "border rounded-md m py-0.5 px-1"
73
+ = f.text_field :reason, value: report.reason, placeholder: "隐藏原因是什么?", class: "border rounded-md py-0.5 px-1", id: "hide_reason"
74
+ = select_tag "process_reason", options_for_select(BeetleReporter::Report::PROCESS_REASON_LIST.map{|r| [r, r]}), prompt: "选择原因", id: "hide_reason_list", class: "border rounded-md py-0.5 px-1"
45
75
  = f.submit "隐藏内容", class: "bg-red-500 text-white cursor-pointer px-2 py-0.5 bg-gray-100 rounded-lg"
46
76
  %span{class: "text-xs text-gray-500"} 举报属实,内容不适合公开展示,对其它人隐藏,对创建者可见。
47
77
  - if report.may_remove?
48
78
  = form_with(url: report_remove_path(report), class: "space-x-1 flex items-center") do |f|
49
- = f.text_field :reason, value: report.reason, placeholder: "删除原因是什么?", class: "border rounded-md m py-0.5 px-1"
79
+ = f.text_field :reason, value: report.reason, placeholder: "删除原因是什么?", class: "border rounded-md py-0.5 px-1", id: "remove_reason"
80
+ = select_tag "process_reason", options_for_select(BeetleReporter::Report::PROCESS_REASON_LIST.map{|r| [r, r]}), prompt: "选择原因", id: "remove_reason_list", class: "border rounded-md py-0.5 px-1"
50
81
  = f.submit "删除内容", class: "bg-red-600 text-white cursor-pointer px-2 py-0.5 bg-gray-100 rounded-lg"
51
82
  %span{class: "text-xs text-gray-500"} 举报属实,不仅不适合展示,也不适合在平台里存在,违法乱纪、破坏和谐气氛的内容,直接删掉。
52
83
  - if report.may_mute?
53
84
  = form_with(url: report_mute_path(report), class: "space-x-1 flex items-center") do |f|
54
- -# = f.text_field :mute_days, value: report.mute_days, placeholder: "禁言天数", class: "border rounded-md m py-0.5 px-1"
55
- = f.text_field :reason, value: report.reason, placeholder: "禁言原因是什么?", class: "border rounded-md m py-0.5 px-1"
85
+ -# = f.text_field :mute_days, value: report.mute_days, placeholder: "禁言天数", class: "border rounded-md py-0.5 px-1"
86
+ = f.text_field :reason, value: report.reason, placeholder: "禁言原因是什么?", class: "border rounded-md py-0.5 px-1", id: "mute_reason"
87
+ = select_tag "process_reason", options_for_select(BeetleReporter::Report::PROCESS_REASON_LIST.map{|r| [r, r]}), prompt: "选择原因", id: "mute_reason_list", class: "border rounded-md py-0.5 px-1"
56
88
  = f.submit "禁言用户", class: "bg-red-700 text-white cursor-pointer px-2 py-0.5 bg-gray-100 rounded-lg"
57
89
  %span{class: "text-xs text-gray-500"} 举报属实,该用户其它内容正常,只有少数几条奇怪的内容,除了删除内容之外也要禁言用户,关小黑屋清醒清醒。
58
90
  - if report.may_forbid?
59
91
  = form_with(url: report_forbid_path(report), class: "space-x-1 flex items-center") do |f|
60
- = f.text_field :reason, value: report.reason, placeholder: "封禁原因是什么?", class: "border rounded-md m py-0.5 px-1"
92
+ = f.text_field :reason, value: report.reason, placeholder: "封禁原因是什么?", class: "border rounded-md py-0.5 px-1", id: "ban_reason"
93
+ = select_tag "process_reason", options_for_select(BeetleReporter::Report::PROCESS_REASON_LIST.map{|r| [r, r]}), prompt: "选择原因", id: "ban_reason_list", class: "border rounded-md py-0.5 px-1"
61
94
  = 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就不是正常用户,搞黄色、发广告、违法乱纪的捣乱份子直接永久封禁,并删除其名下所有内容。
95
+ %span{class: "text-xs text-gray-500"} 举报属实,ta就不是正常用户,搞黄色、发广告、违法乱纪的捣乱份子直接永久封禁,并删除其名下所有内容。
@@ -1,3 +1,3 @@
1
1
  module BeetleReporter
2
- VERSION = '0.1.8'
2
+ VERSION = '0.1.10'
3
3
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beetle_reporter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.10
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-22 00:00:00.000000000 Z
11
+ date: 2022-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 6.0.4
19
+ version: 6.1.4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 6.0.4
26
+ version: 6.1.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: aasm
29
29
  requirement: !ruby/object:Gem::Requirement