decidim-survey_multiple_answers 0.26.0 → 0.26.2

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: e98c3cab41d0babef6ef9ab83310e966c3c77b492ded1c5986142700c34aa8b1
4
- data.tar.gz: '098ef0afc5cd64a784f0d598c39978e6ce949f8325a5b66e4a274863fae2f6d9'
3
+ metadata.gz: 3bf38cb9cc911820cad29e3307cb47490a982848a67b3368be798abe37d3f139
4
+ data.tar.gz: 57ae08452e674b54ab52037e6b84316b43869e08163487abf2ab1330fe9f6cba
5
5
  SHA512:
6
- metadata.gz: aebb5707fbfd08ccd0b3c471ad09a5b6e23a4ff72f727db122312d1b1856625ebb076e5f7849dd8ef1d9698ceef5116b0af063f6b05f89e7c7414d97600a08e7
7
- data.tar.gz: 9585ab0e2cc62d226d4de917b6c088933089c1b5fafed70d41f14f70fb7b89d64b360f0ec13dc9c6e2fe0c36860e8694be4550a8240ec5346c6da52f02dde4c9
6
+ metadata.gz: 34e028205c9b9cea12f6d70a77fbd9cc76aca7e3b3b71a948cf293277938990c690c81d0714516c58ef4496a6b883620978b1bb4f1f634bc82932aa40be03cbb
7
+ data.tar.gz: 28f527509a24b5cb832dcdfbec2500ac0cb78bbfc8499b54749dbaf15dee6a427971ff30e4c811b0927d184d049c4496ca042391236b585b913cdfe73db3b741
@@ -0,0 +1,14 @@
1
+ ---
2
+ ca:
3
+ decidim:
4
+ components:
5
+ survey_multiple_answers:
6
+ name: SurveyMultipleAnswers
7
+ surveys:
8
+ settings:
9
+ global:
10
+ allow_multiple_answers: Allow multiple answers
11
+ allow_multiple_answers_help: If active, a user will be able to answer the survey multiple times. This may lead to poor or unreliable data and it will be more vulnerable to automated attacks. Use with caution!
12
+ step:
13
+ allow_multiple_answers: Allow multiple answers
14
+ allow_multiple_answers_help: If active, a user will be able to answer the survey multiple times. This may lead to poor or unreliable data and it will be more vulnerable to automated attacks. Use with caution!
@@ -0,0 +1,14 @@
1
+ ---
2
+ de-CH:
3
+ decidim:
4
+ components:
5
+ survey_multiple_answers:
6
+ name: UmfrageMehrereAntworten
7
+ surveys:
8
+ settings:
9
+ global:
10
+ allow_multiple_answers: Erlauben Sie mehrere Antworten
11
+ allow_multiple_answers_help: Wenn aktiviert, kann ein Benutzer die Umfrage mehrmals beantworten. Dies kann zu schlechten oder unzuverlässigen Daten führen und die Daten werden anfälliger für automatisierte Angriffe. Mit Vorsicht verwenden!
12
+ step:
13
+ allow_multiple_answers: Erlauben Sie mehrere Antworten
14
+ allow_multiple_answers_help: Wenn aktiviert, kann ein Benutzer die Umfrage mehrmals beantworten. Dies kann zu schlechten oder unzuverlässigen Daten führen und die Daten werden anfälliger für automatisierte Angriffe. Mit Vorsicht verwenden!
@@ -0,0 +1,14 @@
1
+ ---
2
+ es:
3
+ decidim:
4
+ components:
5
+ survey_multiple_answers:
6
+ name: SurveyMultipleAnswers
7
+ surveys:
8
+ settings:
9
+ global:
10
+ allow_multiple_answers: Allow multiple answers
11
+ allow_multiple_answers_help: If active, a user will be able to answer the survey multiple times. This may lead to poor or unreliable data and it will be more vulnerable to automated attacks. Use with caution!
12
+ step:
13
+ allow_multiple_answers: Allow multiple answers
14
+ allow_multiple_answers_help: If active, a user will be able to answer the survey multiple times. This may lead to poor or unreliable data and it will be more vulnerable to automated attacks. Use with caution!
@@ -0,0 +1,14 @@
1
+ ---
2
+ fr:
3
+ decidim:
4
+ components:
5
+ survey_multiple_answers:
6
+ name: Réponses multiples
7
+ surveys:
8
+ settings:
9
+ global:
10
+ allow_multiple_answers: Autoriser plusieurs réponses
11
+ allow_multiple_answers_help: Si activé, un utilisateur sera en mesure de répondre à l'enquête plusieurs fois. Cela peut conduire à des données peu fiables et sera plus vulnérable aux attaques automatisées. À utiliser avec précaution!
12
+ step:
13
+ allow_multiple_answers: Autoriser plusieurs réponses
14
+ allow_multiple_answers_help: Si activé, un utilisateur sera en mesure de répondre à l'enquête plusieurs fois. Cela peut conduire à des données peu fiables et sera plus vulnérable aux attaques automatisées. À utiliser avec précaution!
@@ -0,0 +1,14 @@
1
+ ---
2
+ it:
3
+ decidim:
4
+ components:
5
+ survey_multiple_answers:
6
+ name: SurveyMultipleAnswers
7
+ surveys:
8
+ settings:
9
+ global:
10
+ allow_multiple_answers: Allow multiple answers
11
+ allow_multiple_answers_help: If active, a user will be able to answer the survey multiple times. This may lead to poor or unreliable data and it will be more vulnerable to automated attacks. Use with caution!
12
+ step:
13
+ allow_multiple_answers: Allow multiple answers
14
+ allow_multiple_answers_help: If active, a user will be able to answer the survey multiple times. This may lead to poor or unreliable data and it will be more vulnerable to automated attacks. Use with caution!
@@ -0,0 +1,14 @@
1
+ ---
2
+ lt:
3
+ decidim:
4
+ components:
5
+ survey_multiple_answers:
6
+ name: Daugiau nei vienas atsakymas
7
+ surveys:
8
+ settings:
9
+ global:
10
+ allow_multiple_answers: Leisti daugiau nei vieną atsakymą
11
+ allow_multiple_answers_help: Jei aktyvuota, leidžia kiekvienam naudotojui pateikti keletą atsakymų!
12
+ step:
13
+ allow_multiple_answers: Leisti daugiau nei vieną atsakymą
14
+ allow_multiple_answers_help: Jei aktyvuota, leidžia kiekvienam naudotojui pateikti keletą atsakymų!
@@ -0,0 +1,14 @@
1
+ ---
2
+ ro:
3
+ decidim:
4
+ components:
5
+ survey_multiple_answers:
6
+ name: Răspunsuri multiple la chestionar
7
+ surveys:
8
+ settings:
9
+ global:
10
+ allow_multiple_answers: Permite răspunsuri multiple
11
+ allow_multiple_answers_help: Dacă este activ, un utilizator va putea răspunde de mai multe ori la chestionar. Acest lucru poate duce la date slab calitative și va fi mai vulnerabil la atacuri automate. Utilizați cu prudență!
12
+ step:
13
+ allow_multiple_answers: Permite răspunsuri multiple
14
+ allow_multiple_answers_help: Dacă este activ, un utilizator va putea răspunde de mai multe ori la chestionar. Acest lucru poate duce la date slab calitative și va fi mai vulnerabil la atacuri automate. Utilizați cu prudență!
@@ -18,32 +18,22 @@ module Decidim
18
18
 
19
19
  # Public: return true if the current user (or session visitor) can answer the questionnaire
20
20
  def visitor_already_answered?
21
- return false if can_submit_multiple_answers?
21
+ return false if allow_multiple_answers?
22
22
 
23
23
  questionnaire.answered_by?(current_user || tokenize(session[:session_id]))
24
24
  end
25
25
 
26
26
  # token is used as a substitute of user_id if unregistered
27
27
  def session_token
28
+ id = current_user&.id
29
+
28
30
  session_id = request.session[:session_id] if request&.session
29
- id = can_submit_multiple_answers? ? current_user&.id : SecureRandom.hex
31
+ id = SecureRandom.hex if allow_multiple_answers?
30
32
 
31
33
  return nil unless id || session_id
32
34
 
33
35
  @session_token ||= tokenize(id || session_id)
34
36
  end
35
-
36
- def can_submit_multiple_answers?
37
- collaborator? && allow_multiple_answers?
38
- end
39
-
40
- def collaborator?
41
- return false unless current_user
42
-
43
- current_user.admin? ||
44
- current_participatory_space.user_roles(:admin).exists?(user: current_user) ||
45
- current_participatory_space.user_roles(:collaborator).exists?(user: current_user)
46
- end
47
37
  end
48
38
  end
49
39
  # rubocop:enable Metrics/CyclomaticComplexity
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-meetings version.
5
5
  module SurveyMultipleAnswers
6
6
  def self.version
7
- "0.26.0"
7
+ "0.26.2"
8
8
  end
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-survey_multiple_answers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.26.0
4
+ version: 0.26.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandru Emil Lupu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-29 00:00:00.000000000 Z
11
+ date: 2023-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: decidim-admin
@@ -121,7 +121,14 @@ files:
121
121
  - README.md
122
122
  - Rakefile
123
123
  - config/i18n-tasks.yml
124
+ - config/locales/ca.yml
125
+ - config/locales/de.yml
124
126
  - config/locales/en.yml
127
+ - config/locales/es.yml
128
+ - config/locales/fr.yml
129
+ - config/locales/it.yml
130
+ - config/locales/lt.yml
131
+ - config/locales/ro.yml
125
132
  - lib/decidim/survey_multiple_answers.rb
126
133
  - lib/decidim/survey_multiple_answers/engine.rb
127
134
  - lib/decidim/survey_multiple_answers/questionnaire.rb