decidim-spam_detection 1.1.0 → 1.1.1
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/README.md +1 -2
- data/app/mailers/decidim/spam_detection/spam_detection_mailer.rb +20 -0
- data/app/views/decidim/spam_detection/spam_detection_mailer/notify_detection.html.erb +2 -0
- data/config/i18n-tasks.yml +2 -0
- data/config/locales/ca.yml +15 -6
- data/config/locales/en.yml +12 -4
- data/config/locales/es.yml +14 -6
- data/config/locales/fr.yml +14 -6
- data/lib/decidim/spam_detection/block_spam_user_command.rb +1 -1
- data/lib/decidim/spam_detection/report_spam_user_command.rb +1 -1
- data/lib/decidim/spam_detection/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3734b1cecb038a80ab8905ab0cd7d9680a452b50627f0e5c5d92ee5a5e08c831
|
4
|
+
data.tar.gz: b1a7b24b904478f66d15d5bb28430aa9f1baff2da793d9517478004e1f6cd3e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 441ffd50f429c3131f7f646eed4ba74552714908b570ff62fb9b0916e48c40e338087ff3c53ca1761b14a1483eb1217c4f4f122d020db655cbd5bbaf6413dfe4
|
7
|
+
data.tar.gz: 153cc30f6568d4566a8dcf610a4b39128748dc7bc4debafd2a3c7f62c9b021d2cabe3b9322f367fd3a1893f23d463feada7f8fc16b885054ec3f3f2d2bbad3e4
|
data/README.md
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# Decidim::SpamDetection
|
2
2
|
[](https://codecov.io/gh/OpenSourcePolitics/decidim-spam_detection)
|
3
|
-

|
3
|
+

|
5
4
|
|
6
5
|
## Usage
|
7
6
|
|
@@ -3,6 +3,8 @@
|
|
3
3
|
module Decidim
|
4
4
|
module SpamDetection
|
5
5
|
class SpamDetectionMailer < Decidim::ApplicationMailer
|
6
|
+
helper_method :blocked_users_url, :reported_users_url
|
7
|
+
|
6
8
|
def notify_detection(user, results)
|
7
9
|
with_user(user) do
|
8
10
|
@reported_count = results[:reported_user]
|
@@ -14,6 +16,24 @@ module Decidim
|
|
14
16
|
mail(to: @user.email, subject: subject)
|
15
17
|
end
|
16
18
|
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def blocked_users_url
|
23
|
+
decidim_admin.moderated_users_url(blocked: true, host: root_url)
|
24
|
+
end
|
25
|
+
|
26
|
+
def reported_users_url
|
27
|
+
decidim_admin.moderated_users_url(blocked: false, host: root_url)
|
28
|
+
end
|
29
|
+
|
30
|
+
def decidim_admin
|
31
|
+
Decidim::Admin::Engine.routes.url_helpers
|
32
|
+
end
|
33
|
+
|
34
|
+
def root_url
|
35
|
+
decidim.root_url(host: @user.organization.host)[0..-2]
|
36
|
+
end
|
17
37
|
end
|
18
38
|
end
|
19
39
|
end
|
@@ -5,10 +5,12 @@
|
|
5
5
|
<p>
|
6
6
|
<%= t(".reported_count", count: @reported_count) %>
|
7
7
|
</p>
|
8
|
+
<p><%= link_to(t(".reported_link"), reported_users_url ) %></p>
|
8
9
|
<% end %>
|
9
10
|
|
10
11
|
<% if @blocked_count.present? %>
|
11
12
|
<p>
|
12
13
|
<%= t(".blocked_count", count: @blocked_count) %>
|
13
14
|
</p>
|
15
|
+
<p><%= link_to(t(".blocked_link"), blocked_users_url ) %></p>
|
14
16
|
<% end %>
|
data/config/i18n-tasks.yml
CHANGED
data/config/locales/ca.yml
CHANGED
@@ -1,16 +1,25 @@
|
|
1
1
|
---
|
2
2
|
ca:
|
3
|
+
blocked_user:
|
4
|
+
reason: L'usuari ha estat bloquejat a causa d'una alta probabilitat de spam per
|
5
|
+
la tasca de detecció automàtica de spam de Decidim amb una probabilitat de %{probability}%
|
3
6
|
decidim:
|
4
7
|
components:
|
5
8
|
spam_detection:
|
6
|
-
name:
|
9
|
+
name: DeteccioSpam
|
7
10
|
spam_detection:
|
8
11
|
spam_detection_mailer:
|
9
12
|
notify_detection:
|
10
|
-
blocked_count:
|
11
|
-
|
12
|
-
|
13
|
-
|
13
|
+
blocked_count: Comptes de spam bloquejats %{count}
|
14
|
+
blocked_link: Consulteu la llista de tots els comptes bloquejats
|
15
|
+
hello: Hola %{name}
|
16
|
+
intro: Aquí teniu l'informe de la tasca de detecció de spam
|
17
|
+
reported_count: Comptes blocs de %{count}
|
18
|
+
reported_link: Consulteu la llista de tots els comptes reportats al lloc
|
14
19
|
spam_detection_mailer:
|
15
20
|
notify_detection:
|
16
|
-
subject:
|
21
|
+
subject: Informe de la tasca automàtica detecció de spam
|
22
|
+
reported_user:
|
23
|
+
details: L'usuari s'ha marcat com spam a causa d'una alta probabilitat de spam
|
24
|
+
per la tasca de detecció automàtica de spam de Decidim amb una probabilitat
|
25
|
+
de %{probability}%
|
data/config/locales/en.yml
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
---
|
2
2
|
en:
|
3
|
+
blocked_user:
|
4
|
+
reason: The user was blocked because of a high spam probability by the automated
|
5
|
+
spam detection task with a probability of %{probability}%
|
3
6
|
decidim:
|
4
7
|
components:
|
5
8
|
spam_detection:
|
@@ -7,10 +10,15 @@ en:
|
|
7
10
|
spam_detection:
|
8
11
|
spam_detection_mailer:
|
9
12
|
notify_detection:
|
10
|
-
blocked_count: '
|
13
|
+
blocked_count: 'Spam accounts blocked: %{count}'
|
14
|
+
blocked_link: See the list of all blocked accounts
|
11
15
|
hello: Hello %{name}
|
12
|
-
intro: Here is the report of the spam detection task
|
13
|
-
reported_count: '
|
16
|
+
intro: Here is the report of the automated spam detection task.
|
17
|
+
reported_count: 'Spam accounts reported: %{count}'
|
18
|
+
reported_link: See the list of all reported accounts
|
14
19
|
spam_detection_mailer:
|
15
20
|
notify_detection:
|
16
|
-
subject:
|
21
|
+
subject: Automated spam detection task digest
|
22
|
+
reported_user:
|
23
|
+
details: The user was reported because of a high spam probability by the automated
|
24
|
+
spam detection task with a probability of %{probability}%
|
data/config/locales/es.yml
CHANGED
@@ -1,16 +1,24 @@
|
|
1
1
|
---
|
2
2
|
es:
|
3
|
+
blocked_user:
|
4
|
+
reason: El usuario fue bloqueado debido a una alta probabilidad de spam por la
|
5
|
+
tarea de detección automática de spam con una probabilidad de %{probability}%
|
3
6
|
decidim:
|
4
7
|
components:
|
5
8
|
spam_detection:
|
6
|
-
name:
|
9
|
+
name: DeteccionSpam
|
7
10
|
spam_detection:
|
8
11
|
spam_detection_mailer:
|
9
12
|
notify_detection:
|
10
|
-
blocked_count:
|
11
|
-
|
12
|
-
|
13
|
-
|
13
|
+
blocked_count: 'Cuentas de spam bloqueadas : %{count}'
|
14
|
+
blocked_link: Ver la lista de todas las cuentas bloqueadas
|
15
|
+
hello: Hola %{name}
|
16
|
+
intro: Aquí está el informe de la tarea de detección automática de spam.
|
17
|
+
reported_count: Cuentas de spam señaladas %{count}
|
18
|
+
reported_link: Ver la lista de cuentas señaladas
|
14
19
|
spam_detection_mailer:
|
15
20
|
notify_detection:
|
16
|
-
subject:
|
21
|
+
subject: Informe de la tarea automática detección de spam
|
22
|
+
reported_user:
|
23
|
+
details: El usuario fue señalado debido a una alta probabilidad de spam por la
|
24
|
+
tarea de detección automática de spam con una probabilidad de %{probability}%
|
data/config/locales/fr.yml
CHANGED
@@ -1,16 +1,24 @@
|
|
1
1
|
---
|
2
2
|
fr:
|
3
|
+
blocked_user:
|
4
|
+
reason: L'utilisateur a été bloqué en raison d'une forte probabilité de spam par
|
5
|
+
la tâche de détection automatique de spam avec une probabilité de %{probability}%
|
3
6
|
decidim:
|
4
7
|
components:
|
5
8
|
spam_detection:
|
6
|
-
name:
|
9
|
+
name: DetectionSpam
|
7
10
|
spam_detection:
|
8
11
|
spam_detection_mailer:
|
9
12
|
notify_detection:
|
10
|
-
blocked_count:
|
11
|
-
|
12
|
-
|
13
|
-
|
13
|
+
blocked_count: 'Comptes spam bloqués : %{count}'
|
14
|
+
blocked_link: Voir la liste de tous les comptes bloqués du site
|
15
|
+
hello: Bonjour %{name}
|
16
|
+
intro: Voici le rapport de la tâche de détection automatisée des spams.
|
17
|
+
reported_count: 'Comptes spam signalés : %{count}'
|
18
|
+
reported_link: Voir la liste de tous les comptes signalés
|
14
19
|
spam_detection_mailer:
|
15
20
|
notify_detection:
|
16
|
-
subject:
|
21
|
+
subject: Rapport de la tâche de détection automatique de spam
|
22
|
+
reported_user:
|
23
|
+
details: L'utilisateur a été signalé en raison d'une forte probabilité de spam
|
24
|
+
par la tâche de détection automatique de spam avec une probabilité de %{probability}%
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decidim-spam_detection
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Armand Fardeau
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-02-
|
11
|
+
date: 2022-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: decidim-core
|