decidim-spam_detection 1.1.0 → 1.1.1

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: 38cc3310b2ed4c7e48cadea2c1bf9f0ff86d8f28bad7b3e04398d5922598442d
4
- data.tar.gz: be191b16b6827c2e6963b72578fe899d1feace76156b87cb246928dc869619d3
3
+ metadata.gz: 3734b1cecb038a80ab8905ab0cd7d9680a452b50627f0e5c5d92ee5a5e08c831
4
+ data.tar.gz: b1a7b24b904478f66d15d5bb28430aa9f1baff2da793d9517478004e1f6cd3e9
5
5
  SHA512:
6
- metadata.gz: ef0c0fcc58dfdb427725cc53ad5a3fa2829b0482180e4b311427a483345b97f09ec90d55ffdcfaf778903ed00913bf17976ae56e2a9fb13deb17605cf45c0425
7
- data.tar.gz: 9d6b782f0b236cd000b1bf361b5d83524c037da23fa22aa779321f5c09fafbc849d45d713c965b2e9a6eb2a37d465565e91b33bfcff0a1e73436065ee76265b6
6
+ metadata.gz: 441ffd50f429c3131f7f646eed4ba74552714908b570ff62fb9b0916e48c40e338087ff3c53ca1761b14a1483eb1217c4f4f122d020db655cbd5bbaf6413dfe4
7
+ data.tar.gz: 153cc30f6568d4566a8dcf610a4b39128748dc7bc4debafd2a3c7f62c9b021d2cabe3b9322f367fd3a1893f23d463feada7f8fc16b885054ec3f3f2d2bbad3e4
data/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # Decidim::SpamDetection
2
2
  [![codecov](https://codecov.io/gh/OpenSourcePolitics/decidim-spam_detection/branch/master/graph/badge.svg?token=eJu34XLlVu)](https://codecov.io/gh/OpenSourcePolitics/decidim-spam_detection)
3
- ![Tests](https://github.com/opensourcepolitics/decidim-spam_detection/actions/workflows/tests.yml/badge.svg)
4
- ![Tests](https://github.com/opensourcepolitics/decidim-spam_detection/actions/workflows/lint.yml/badge.svg)
3
+ ![Tests](https://github.com/opensourcepolitics/decidim-spam_detection/actions/workflows/ci_cd.yml/badge.svg)
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 %>
@@ -5,6 +5,8 @@ locales: [en, fr, es, ca]
5
5
 
6
6
  ignore_unused:
7
7
  - "decidim.components.spam_detection.name"
8
+ - blocked_user.*
9
+ - reported_user.*
8
10
 
9
11
  ignore_missing:
10
12
  - decidim.participatory_processes.scopes.global
@@ -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: SpamDetection
9
+ name: DeteccioSpam
7
10
  spam_detection:
8
11
  spam_detection_mailer:
9
12
  notify_detection:
10
- blocked_count: blocked_count %{count}
11
- hello: Hello %{name}
12
- intro: Aquí teniu l'informe de la tasca de detecció de correu brossa
13
- reported_count: reported_count %{count}
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: Resum de detecció de correu brossa
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}%
@@ -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: 'Blocked users count: %{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: 'Reported users count: %{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: Spam detection digest
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}%
@@ -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: SpamDetection
9
+ name: DeteccionSpam
7
10
  spam_detection:
8
11
  spam_detection_mailer:
9
12
  notify_detection:
10
- blocked_count: blocked_count %{count}
11
- hello: Hello %{name}
12
- intro: Here is the report of the spam detection task
13
- reported_count: reported_count %{count}
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: 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}%
@@ -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: SpamDetection
9
+ name: DetectionSpam
7
10
  spam_detection:
8
11
  spam_detection_mailer:
9
12
  notify_detection:
10
- blocked_count: blocked_count %{count}
11
- hello: Hello %{name}
12
- intro: Here is the report of the spam detection task
13
- reported_count: reported_count %{count}
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: 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}%
@@ -62,7 +62,7 @@ module Decidim
62
62
  end
63
63
 
64
64
  def reason
65
- "The user was blocked because of a high spam probability by Decidim spam detection bot with a probability of #{@probability}%"
65
+ I18n.t("blocked_user.reason", probability: @probability)
66
66
  end
67
67
  end
68
68
  end
@@ -28,7 +28,7 @@ module Decidim
28
28
  end
29
29
 
30
30
  def details
31
- "The user was marked as spam by Decidim spam detection bot with a probability of #{@probability}%"
31
+ I18n.t("reported_user.details", probability: @probability)
32
32
  end
33
33
 
34
34
  def find_or_create_moderation!
@@ -5,7 +5,7 @@ module Decidim
5
5
  # This holds the decidim-spam_detection version.
6
6
  module SpamDetection
7
7
  def self.version
8
- "1.1.0"
8
+ "1.1.1"
9
9
  end
10
10
 
11
11
  def self.decidim_version
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.0
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-08 00:00:00.000000000 Z
11
+ date: 2022-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: decidim-core