decidim-forms 0.27.4 → 0.27.6
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/app/cells/decidim/forms/question_readonly/show.erb +1 -1
- data/app/controllers/decidim/forms/admin/concerns/has_questionnaire.rb +1 -1
- data/config/locales/bg.yml +11 -0
- data/config/locales/de.yml +1 -1
- data/config/locales/eu.yml +14 -14
- data/config/locales/he-IL.yml +1 -0
- data/config/locales/hu.yml +4 -3
- data/config/locales/lt.yml +2 -0
- data/config/locales/pl.yml +18 -0
- data/config/locales/pt-BR.yml +19 -0
- data/config/locales/ro-RO.yml +12 -12
- data/config/locales/sq-AL.yml +1 -0
- data/config/locales/th-TH.yml +1 -0
- data/decidim-forms.gemspec +34 -0
- data/lib/decidim/forms/test/factories.rb +48 -34
- data/lib/decidim/forms/test/shared_examples/has_questionnaire.rb +2 -2
- data/lib/decidim/forms/user_answers_serializer.rb +1 -1
- data/lib/decidim/forms/version.rb +1 -1
- metadata +17 -14
- data/config/environment.rb +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fb8af1d2c76776bd4e799949d4723e998f57b4cc32ad3f021b1baff85fbd646b
|
|
4
|
+
data.tar.gz: 65f42cfd48b2b6e175dcba554014b97533a25c7b92eac8e2144d165f5bf86a42
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b8a5638134be13bb12df3bc391fe1cff12314030215dde44c52ea87889946efdf7673f602ade25b7e8d87b0f973fc164649a46a97286547d754d469835891e08
|
|
7
|
+
data.tar.gz: 4e1eaebf065003acc37cd0bcb26e5549f6b32202d2edb9d96e748c32a8caf70a7b26eceda53fe447160880d1e4525038ec572b54766a52bae2e26eb20b2b15f7
|
|
@@ -20,7 +20,7 @@ module Decidim
|
|
|
20
20
|
helper_method :questionnaire_for, :questionnaire, :blank_question, :blank_answer_option, :blank_matrix_row,
|
|
21
21
|
:blank_display_condition, :question_types, :display_condition_types, :update_url, :public_url, :answer_options_url, :edit_questionnaire_title
|
|
22
22
|
|
|
23
|
-
if defined?
|
|
23
|
+
if defined?(Decidim::Templates::Admin::Concerns::Templatable)
|
|
24
24
|
include Decidim::Templates::Admin::Concerns::Templatable
|
|
25
25
|
helper Decidim::DatalistSelectHelper
|
|
26
26
|
|
data/config/locales/bg.yml
CHANGED
|
@@ -7,8 +7,19 @@ bg:
|
|
|
7
7
|
question:
|
|
8
8
|
max_choices: Максимален брой възможности
|
|
9
9
|
question_type: Тип
|
|
10
|
+
errors:
|
|
11
|
+
models:
|
|
12
|
+
questionnaire:
|
|
13
|
+
request_invalid: Възникна грешка при обработката на заявката. Моля, опитайте отново
|
|
10
14
|
decidim:
|
|
11
15
|
forms:
|
|
16
|
+
errors:
|
|
17
|
+
answer:
|
|
18
|
+
body: Основният текст не може да бъде празен
|
|
19
|
+
questionnaires:
|
|
20
|
+
show:
|
|
21
|
+
answer_questionnaire:
|
|
22
|
+
anonymous_user_message: <a href="%{sign_in_link}">Влезте в профила си</a> или <a href="%{sign_up_link}">се регистрирайте</a>, за да попълните отговорите си във формуляра.
|
|
12
23
|
step_navigation:
|
|
13
24
|
show:
|
|
14
25
|
are_you_sure: Това действие не може да се отмени и Вие не можете да редактирате отговорите си. Сигурни ли сте?
|
data/config/locales/de.yml
CHANGED
|
@@ -175,7 +175,7 @@ de:
|
|
|
175
175
|
tos_agreement: Mit der Teilnahme stimmen Sie den Nutzungsbedingungen zu
|
|
176
176
|
step_navigation:
|
|
177
177
|
show:
|
|
178
|
-
are_you_sure: Diese Aktion kann nicht rückgängig gemacht werden und Sie können Ihre Antworten nicht bearbeiten.
|
|
178
|
+
are_you_sure: Diese Aktion kann nicht rückgängig gemacht werden und Sie können Ihre Antworten nicht bearbeiten. Sind Sie sich sicher?
|
|
179
179
|
back: Zurück
|
|
180
180
|
continue: Weiter
|
|
181
181
|
submit: einreichen
|
data/config/locales/eu.yml
CHANGED
|
@@ -7,7 +7,7 @@ eu:
|
|
|
7
7
|
choices: Aukerak
|
|
8
8
|
selected_choices: Hautatutako aukerak
|
|
9
9
|
question:
|
|
10
|
-
max_choices:
|
|
10
|
+
max_choices: Gehieneko aukera kopurua
|
|
11
11
|
question_type: Mota
|
|
12
12
|
questionnaire_question:
|
|
13
13
|
mandatory: Derrigorrezkoa
|
|
@@ -49,13 +49,13 @@ eu:
|
|
|
49
49
|
empty: Oraindik ez dago erantzunik
|
|
50
50
|
export:
|
|
51
51
|
answer:
|
|
52
|
-
title: '#%{number}
|
|
52
|
+
title: '#%{number} erantzun'
|
|
53
53
|
export_response:
|
|
54
54
|
title: survey_user_answers_%{token}
|
|
55
55
|
index:
|
|
56
56
|
title: "Guztira %{total} erantzun"
|
|
57
57
|
show:
|
|
58
|
-
title: '#%{number}
|
|
58
|
+
title: '#%{number} erantzun'
|
|
59
59
|
display_condition:
|
|
60
60
|
answer_option: Erantzuteko aukera
|
|
61
61
|
condition_question: Galdera
|
|
@@ -80,8 +80,8 @@ eu:
|
|
|
80
80
|
form:
|
|
81
81
|
add_question: Gehitu galdera
|
|
82
82
|
add_separator: Gehitu banatzailea
|
|
83
|
-
add_title_and_description:
|
|
84
|
-
already_answered_warning: Formularioa erabiltzaile batzuek erantzuten dute
|
|
83
|
+
add_title_and_description: Gehitu izenburua eta deskribapena
|
|
84
|
+
already_answered_warning: Formularioa erabiltzaile batzuek erantzuten dute; beraz, ezin dira galderak aldatu.
|
|
85
85
|
collapse: Bildu galdera guztiak
|
|
86
86
|
expand: Zabaldu galdera guztiak
|
|
87
87
|
preview: Aurreikusi
|
|
@@ -111,7 +111,7 @@ eu:
|
|
|
111
111
|
separator: Bereizlea
|
|
112
112
|
up: Gora
|
|
113
113
|
title_and_description:
|
|
114
|
-
collapse:
|
|
114
|
+
collapse: Kolapsoa
|
|
115
115
|
description: Deskribapena
|
|
116
116
|
down: Behera
|
|
117
117
|
expand: Zabaldu
|
|
@@ -120,7 +120,7 @@ eu:
|
|
|
120
120
|
title_and_description: Izenburua eta deskribapena
|
|
121
121
|
up: Gora
|
|
122
122
|
update:
|
|
123
|
-
invalid:
|
|
123
|
+
invalid: Arazo bat egon da inprimakia gordetzean.
|
|
124
124
|
success: Galdetegia zuzen gorde da.
|
|
125
125
|
admin_log:
|
|
126
126
|
questionnaire:
|
|
@@ -131,8 +131,8 @@ eu:
|
|
|
131
131
|
images:
|
|
132
132
|
dimensions: "%{width} x %{height} px"
|
|
133
133
|
processors:
|
|
134
|
-
resize_and_pad: Irudi hau bigunduko eta birdimentsionatuko da %{dimensions}
|
|
135
|
-
resize_to_fit: Irudi hau bigunduko eta birdimentsionatuko da %{dimensions}
|
|
134
|
+
resize_and_pad: Irudi hau bigunduko eta birdimentsionatuko da %{dimensions} neurrira.
|
|
135
|
+
resize_to_fit: Irudi hau bigunduko eta birdimentsionatuko da %{dimensions} neurrira.
|
|
136
136
|
question_types:
|
|
137
137
|
files: Fitxategiak
|
|
138
138
|
long_answer: Erantzun luzea
|
|
@@ -147,19 +147,19 @@ eu:
|
|
|
147
147
|
download_attachment: Deskargatu eranskina
|
|
148
148
|
questionnaires:
|
|
149
149
|
answer:
|
|
150
|
-
invalid:
|
|
150
|
+
invalid: Akats bat gertatu da galdeketa erantzutean.
|
|
151
151
|
max_choices_alert: Aukera gehiegi daude hautatuta
|
|
152
|
-
success:
|
|
152
|
+
success: Formularioa zuzen erantzunda.
|
|
153
153
|
question:
|
|
154
|
-
max_choices: '
|
|
154
|
+
max_choices: 'Gehieneko aukerak: %{n}'
|
|
155
155
|
show:
|
|
156
156
|
answer_questionnaire:
|
|
157
157
|
anonymous_user_message: <a href="%{sign_in_link}">Hasi saioa zure kontuarekin</a> edo <a href="%{sign_up_link}">saioa hasi</a> galdetegiari erantzuteko.
|
|
158
|
-
title: Erantzun
|
|
158
|
+
title: Erantzun formularioa
|
|
159
159
|
current_step: '%{step} urratsa'
|
|
160
160
|
of_total_steps: '%{total_steps} etik'
|
|
161
161
|
questionnaire_answered:
|
|
162
|
-
body:
|
|
162
|
+
body: Dagoeneko inkesta hau erantzun duzu.
|
|
163
163
|
title: Dagoeneko erantzunda
|
|
164
164
|
questionnaire_closed:
|
|
165
165
|
body: Galdetegia itxita dago eta ezin da erantzun.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
he:
|
data/config/locales/hu.yml
CHANGED
|
@@ -30,7 +30,7 @@ hu:
|
|
|
30
30
|
answer_option: Válasz opció
|
|
31
31
|
free_text: Szabadszöveg
|
|
32
32
|
remove: Eltávolít
|
|
33
|
-
statement:
|
|
33
|
+
statement: Állítás
|
|
34
34
|
edit:
|
|
35
35
|
save: Mentés
|
|
36
36
|
form:
|
|
@@ -41,7 +41,7 @@ hu:
|
|
|
41
41
|
expand: Minden kérdés kibontása
|
|
42
42
|
matrix_row:
|
|
43
43
|
remove: Eltávolít
|
|
44
|
-
statement:
|
|
44
|
+
statement: Állítás
|
|
45
45
|
question:
|
|
46
46
|
add_answer_option: Válasz opció hozzáadása
|
|
47
47
|
any: Bármilyen
|
|
@@ -51,7 +51,7 @@ hu:
|
|
|
51
51
|
expand: Kibontás
|
|
52
52
|
question: Kérdés
|
|
53
53
|
remove: Eltávolít
|
|
54
|
-
statement:
|
|
54
|
+
statement: Állítás
|
|
55
55
|
up: Fel
|
|
56
56
|
title_and_description:
|
|
57
57
|
collapse: Összecsuk
|
|
@@ -100,6 +100,7 @@ hu:
|
|
|
100
100
|
step_navigation:
|
|
101
101
|
show:
|
|
102
102
|
are_you_sure: Ez a művelet nem vonható vissza, és nem tudod majd szerkeszteni a válaszokat. Biztos vagy ebben?
|
|
103
|
+
continue: Folytatás
|
|
103
104
|
submit: Beküldés
|
|
104
105
|
user_answers_serializer:
|
|
105
106
|
created_at: Válaszolt
|
data/config/locales/lt.yml
CHANGED
|
@@ -143,6 +143,8 @@ lt:
|
|
|
143
143
|
single_option: Vienas variantas
|
|
144
144
|
sorting: Rūšiavimas
|
|
145
145
|
title_and_description: Pavadinimas ir aprašymas
|
|
146
|
+
questionnaire_answer_presenter:
|
|
147
|
+
download_attachment: Parsisiųsti priedą
|
|
146
148
|
questionnaires:
|
|
147
149
|
answer:
|
|
148
150
|
invalid: Atsakant į šią formą iškilo problema.
|
data/config/locales/pl.yml
CHANGED
|
@@ -80,6 +80,7 @@ pl:
|
|
|
80
80
|
form:
|
|
81
81
|
add_question: Dodaj pytanie
|
|
82
82
|
add_separator: Dodaj separator
|
|
83
|
+
add_title_and_description: Dodaj tytuł i opis
|
|
83
84
|
already_answered_warning: Niektórzy użytkownicy już odpowiedzieli na pytania tego formularza, więc nie można modyfikować jego pytań.
|
|
84
85
|
collapse: Zwiń wszystkie pytania
|
|
85
86
|
expand: Rozwiń wszystkie pytania
|
|
@@ -109,14 +110,29 @@ pl:
|
|
|
109
110
|
remove: Usuń
|
|
110
111
|
separator: Separator
|
|
111
112
|
up: W górę
|
|
113
|
+
title_and_description:
|
|
114
|
+
collapse: Zwiń
|
|
115
|
+
description: Opis
|
|
116
|
+
down: W dół
|
|
117
|
+
expand: Rozwiń
|
|
118
|
+
remove: Usuń
|
|
119
|
+
title: Tytuł
|
|
120
|
+
title_and_description: Tytuł i opis
|
|
121
|
+
up: W górę
|
|
112
122
|
update:
|
|
113
123
|
invalid: Podczas zapisywania formularza wystąpił błąd.
|
|
114
124
|
success: Formularz został zapisany.
|
|
125
|
+
admin_log:
|
|
126
|
+
questionnaire:
|
|
127
|
+
update: "%{user_name} zaktualizował(a) kwestionariusz %{resource_name}"
|
|
115
128
|
errors:
|
|
116
129
|
answer:
|
|
117
130
|
body: Treść nie może być pusta
|
|
118
131
|
images:
|
|
119
132
|
dimensions: "%{width} × %{height} px"
|
|
133
|
+
processors:
|
|
134
|
+
resize_and_pad: Rozmiar obrazu zostanie zmieniony i dopasowany do wymiarów %{dimensions}.
|
|
135
|
+
resize_to_fit: Rozmiar obrazu zostanie zmieniony i dopasowany do wymiarów %{dimensions}.
|
|
120
136
|
question_types:
|
|
121
137
|
files: Pliki
|
|
122
138
|
long_answer: Długa odpowiedź
|
|
@@ -127,6 +143,8 @@ pl:
|
|
|
127
143
|
single_option: Jedna opcja
|
|
128
144
|
sorting: Sortowanie
|
|
129
145
|
title_and_description: Tytuł i opis
|
|
146
|
+
questionnaire_answer_presenter:
|
|
147
|
+
download_attachment: Pobierz załącznik
|
|
130
148
|
questionnaires:
|
|
131
149
|
answer:
|
|
132
150
|
invalid: Podczas wypełniania formularza wystąpiły błędy.
|
data/config/locales/pt-BR.yml
CHANGED
|
@@ -80,6 +80,7 @@ pt-BR:
|
|
|
80
80
|
form:
|
|
81
81
|
add_question: Adicionar pergunta
|
|
82
82
|
add_separator: Adicionar separador
|
|
83
|
+
add_title_and_description: Adicionar título e descrição
|
|
83
84
|
already_answered_warning: O questionário já foi respondido por alguns usuários então você não pode modificar suas perguntas.
|
|
84
85
|
collapse: Recolher todas as questões
|
|
85
86
|
expand: Expandir todas as questões
|
|
@@ -109,14 +110,29 @@ pt-BR:
|
|
|
109
110
|
remove: Remover
|
|
110
111
|
separator: Separador
|
|
111
112
|
up: Para Cima
|
|
113
|
+
title_and_description:
|
|
114
|
+
collapse: Recolher
|
|
115
|
+
description: Descrição
|
|
116
|
+
down: Abaixo
|
|
117
|
+
expand: Expandir
|
|
118
|
+
remove: Excluir
|
|
119
|
+
title: Título
|
|
120
|
+
title_and_description: Título e descrição
|
|
121
|
+
up: Acima
|
|
112
122
|
update:
|
|
113
123
|
invalid: Houve erros ao salvar o questionário.
|
|
114
124
|
success: Formulário salvo com sucesso.
|
|
125
|
+
admin_log:
|
|
126
|
+
questionnaire:
|
|
127
|
+
update: "%{user_name} atualizou o questionário %{resource_name}"
|
|
115
128
|
errors:
|
|
116
129
|
answer:
|
|
117
130
|
body: O corpo não pode ficar em branco
|
|
118
131
|
images:
|
|
119
132
|
dimensions: "%{width} x %{height} px"
|
|
133
|
+
processors:
|
|
134
|
+
resize_and_pad: Esta imagem será redimensionada e preenchida para %{dimensions}.
|
|
135
|
+
resize_to_fit: Esta imagem será redimensionada para caber %{dimensions}.
|
|
120
136
|
question_types:
|
|
121
137
|
files: Arquivos
|
|
122
138
|
long_answer: Resposta longa
|
|
@@ -126,6 +142,9 @@ pt-BR:
|
|
|
126
142
|
short_answer: Resposta curta
|
|
127
143
|
single_option: Opção única
|
|
128
144
|
sorting: Classificação
|
|
145
|
+
title_and_description: Título e descrição
|
|
146
|
+
questionnaire_answer_presenter:
|
|
147
|
+
download_attachment: Baixar anexo
|
|
129
148
|
questionnaires:
|
|
130
149
|
answer:
|
|
131
150
|
invalid: Houve erros ao responder a pesquisa.
|
data/config/locales/ro-RO.yml
CHANGED
|
@@ -39,7 +39,7 @@ ro:
|
|
|
39
39
|
answer_option:
|
|
40
40
|
answer_option: Opțiune de răspuns
|
|
41
41
|
free_text: Text liber
|
|
42
|
-
remove:
|
|
42
|
+
remove: Eliminați
|
|
43
43
|
statement: Declarație
|
|
44
44
|
answers:
|
|
45
45
|
actions:
|
|
@@ -53,7 +53,7 @@ ro:
|
|
|
53
53
|
export_response:
|
|
54
54
|
title: survey_user_answers_%{token}
|
|
55
55
|
index:
|
|
56
|
-
title: "%{total} total
|
|
56
|
+
title: "%{total} răspunsuri în total"
|
|
57
57
|
show:
|
|
58
58
|
title: 'Răspuns #%{number}'
|
|
59
59
|
display_condition:
|
|
@@ -71,21 +71,21 @@ ro:
|
|
|
71
71
|
mandatory: Această condiție trebuie îndeplinită întotdeauna indiferent de stadiul altor condiții
|
|
72
72
|
remove: Elimină
|
|
73
73
|
save_warning: Ține minte să salvezi chestionarul înainte de configurarea condiţiilor de afişare
|
|
74
|
-
select_answer_option:
|
|
74
|
+
select_answer_option: Selectați opțiunea de răspuns
|
|
75
75
|
select_condition_question: Selectează o întrebare
|
|
76
|
-
select_condition_type:
|
|
76
|
+
select_condition_type: Selectați un tip de condiție
|
|
77
77
|
edit:
|
|
78
78
|
save: Salvează
|
|
79
|
-
title:
|
|
79
|
+
title: Editare chestionar
|
|
80
80
|
form:
|
|
81
81
|
add_question: Adaugă întrebare
|
|
82
82
|
add_separator: Adaugă separator
|
|
83
|
-
add_title_and_description:
|
|
84
|
-
already_answered_warning: Au fost înregistrare deja câteva răspunsuri de la utilizatori pentru acest chestionar. De aceea, nu mai
|
|
83
|
+
add_title_and_description: Adaugați titlu și descriere
|
|
84
|
+
already_answered_warning: Au fost înregistrare deja câteva răspunsuri de la utilizatori pentru acest chestionar. De aceea, nu mai puteți modifica întrebările.
|
|
85
85
|
collapse: Restrânge toate întrebările
|
|
86
86
|
expand: Extinde toate întrebările
|
|
87
87
|
preview: Previzualizează
|
|
88
|
-
title:
|
|
88
|
+
title: Actualizați chestionarul pentru %{questionnaire_for}
|
|
89
89
|
unpublished_warning: Chestionarul nu este publicat. Poți modifica întrebările, dar această acțiune va duce la stergerea automată a răspunsurilor curente.
|
|
90
90
|
matrix_row:
|
|
91
91
|
matrix_row: Rând
|
|
@@ -95,14 +95,14 @@ ro:
|
|
|
95
95
|
add_answer_option: Adaugă opțiune de răspuns
|
|
96
96
|
add_display_condition: Adaugă condiție de afișare
|
|
97
97
|
add_display_condition_info: Salvează formularul pentru a configura condițiile de afișare
|
|
98
|
-
add_matrix_row:
|
|
98
|
+
add_matrix_row: Adaugați rând
|
|
99
99
|
any: Oricare
|
|
100
|
-
collapse:
|
|
100
|
+
collapse: Restrângeți
|
|
101
101
|
description: Descriere
|
|
102
102
|
down: Mergi în jos
|
|
103
|
-
expand:
|
|
103
|
+
expand: Extindeți
|
|
104
104
|
question: Întrebare
|
|
105
|
-
remove:
|
|
105
|
+
remove: Eliminați
|
|
106
106
|
statement: Declarație
|
|
107
107
|
up: Mergi în sus
|
|
108
108
|
separator:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
sq:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
th:
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
$LOAD_PATH.push File.expand_path("lib", __dir__)
|
|
4
|
+
|
|
5
|
+
# Maintain your gem's version:
|
|
6
|
+
require "decidim/forms/version"
|
|
7
|
+
|
|
8
|
+
# Describe your gem and declare its dependencies:
|
|
9
|
+
Gem::Specification.new do |s|
|
|
10
|
+
s.version = Decidim::Forms.version
|
|
11
|
+
s.authors = ["Josep Jaume Rey Peroy", "Marc Riera Casals", "Oriol Gual Oliva", "Rubén González Valero"]
|
|
12
|
+
s.email = ["josepjaume@gmail.com", "mrc2407@gmail.com", "oriolgual@gmail.com", "rbngzlv@gmail.com"]
|
|
13
|
+
s.license = "AGPL-3.0"
|
|
14
|
+
s.homepage = "https://github.com/decidim/decidim"
|
|
15
|
+
s.required_ruby_version = "~> 3.0.0"
|
|
16
|
+
|
|
17
|
+
s.name = "decidim-forms"
|
|
18
|
+
s.summary = "Decidim forms"
|
|
19
|
+
s.description = "A forms gem for decidim."
|
|
20
|
+
|
|
21
|
+
s.files = Dir.chdir(__dir__) do
|
|
22
|
+
`git ls-files -z`.split("\x0").select do |f|
|
|
23
|
+
(File.expand_path(f) == __FILE__) ||
|
|
24
|
+
f.start_with?(*%w(app/ config/ db/ lib/ Rakefile README.md))
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
s.add_dependency "decidim-core", Decidim::Forms.version
|
|
29
|
+
s.add_dependency "wicked_pdf", "~> 2.1"
|
|
30
|
+
s.add_dependency "wkhtmltopdf-binary", "~> 0.12"
|
|
31
|
+
|
|
32
|
+
s.add_development_dependency "decidim-admin", Decidim::Forms.version
|
|
33
|
+
s.add_development_dependency "decidim-dev", Decidim::Forms.version
|
|
34
|
+
end
|
|
@@ -5,37 +5,37 @@ require "decidim/participatory_processes/test/factories"
|
|
|
5
5
|
|
|
6
6
|
FactoryBot.define do
|
|
7
7
|
factory :questionnaire, class: "Decidim::Forms::Questionnaire" do
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
|
11
|
-
generate_localized_title
|
|
12
|
-
end
|
|
8
|
+
transient do
|
|
9
|
+
skip_injection { false }
|
|
13
10
|
end
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
title { generate_localized_title(:questionnaire_title, skip_injection: skip_injection) }
|
|
12
|
+
description { generate_localized_description(:questionnaire_description, skip_injection: skip_injection) }
|
|
13
|
+
tos { generate_localized_title(:questionnaire_tos, skip_injection: skip_injection) }
|
|
14
|
+
questionnaire_for { build(:participatory_process, skip_injection: skip_injection) }
|
|
16
15
|
salt { SecureRandom.hex(32) }
|
|
17
16
|
|
|
18
17
|
trait :with_questions do
|
|
19
18
|
questions do
|
|
20
19
|
position = 0
|
|
21
20
|
qs = %w(short_answer long_answer).collect do |text_question_type|
|
|
22
|
-
q = build(:questionnaire_question, question_type: text_question_type, position: position)
|
|
21
|
+
q = build(:questionnaire_question, question_type: text_question_type, position: position, skip_injection: skip_injection)
|
|
23
22
|
position += 1
|
|
24
23
|
q
|
|
25
24
|
end
|
|
26
|
-
qs << build(:questionnaire_question, :with_answer_options, question_type: :single_option, position: position)
|
|
25
|
+
qs << build(:questionnaire_question, :with_answer_options, question_type: :single_option, position: position, skip_injection: skip_injection)
|
|
27
26
|
qs
|
|
28
27
|
end
|
|
29
28
|
end
|
|
30
29
|
|
|
31
30
|
trait :with_all_questions do
|
|
32
|
-
after(:build) do |questionaire,
|
|
31
|
+
after(:build) do |questionaire, evaluator|
|
|
33
32
|
position = 0
|
|
34
33
|
%w(short_answer long_answer).collect do |text_question_type|
|
|
35
34
|
q = create(:questionnaire_question,
|
|
36
35
|
question_type: text_question_type,
|
|
37
36
|
position: position,
|
|
38
|
-
questionnaire: questionaire
|
|
37
|
+
questionnaire: questionaire,
|
|
38
|
+
skip_injection: evaluator.skip_injection)
|
|
39
39
|
position += 1
|
|
40
40
|
questionaire.questions << q
|
|
41
41
|
end
|
|
@@ -44,7 +44,8 @@ FactoryBot.define do
|
|
|
44
44
|
q = create(:questionnaire_question, :with_answer_options,
|
|
45
45
|
question_type: option_question_type,
|
|
46
46
|
position: position,
|
|
47
|
-
questionnaire: questionaire
|
|
47
|
+
questionnaire: questionaire,
|
|
48
|
+
skip_injection: evaluator.skip_injection)
|
|
48
49
|
q.display_conditions.build(
|
|
49
50
|
condition_question: questionaire.questions[q.position - 1],
|
|
50
51
|
question: q,
|
|
@@ -60,7 +61,8 @@ FactoryBot.define do
|
|
|
60
61
|
question_type: matrix_question_type,
|
|
61
62
|
position: position,
|
|
62
63
|
body: generate_localized_title,
|
|
63
|
-
questionnaire: questionaire
|
|
64
|
+
questionnaire: questionaire,
|
|
65
|
+
skip_injection: evaluator.skip_injection)
|
|
64
66
|
q.display_conditions.build(
|
|
65
67
|
condition_question: questionaire.questions[q.position - 1],
|
|
66
68
|
question: q,
|
|
@@ -82,16 +84,13 @@ FactoryBot.define do
|
|
|
82
84
|
|
|
83
85
|
factory :questionnaire_question, class: "Decidim::Forms::Question" do
|
|
84
86
|
transient do
|
|
87
|
+
skip_injection { false }
|
|
85
88
|
options { [] }
|
|
86
89
|
rows { [] }
|
|
87
90
|
end
|
|
88
91
|
|
|
89
|
-
body { generate_localized_title }
|
|
90
|
-
description
|
|
91
|
-
Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
|
92
|
-
generate_localized_title
|
|
93
|
-
end
|
|
94
|
-
end
|
|
92
|
+
body { generate_localized_title(:questionnaire_question_body, skip_injection: skip_injection) }
|
|
93
|
+
description { generate_localized_description(:questionnaire_question_description, skip_injection: skip_injection) }
|
|
95
94
|
mandatory { false }
|
|
96
95
|
position { 0 }
|
|
97
96
|
question_type { Decidim::Forms::Question::TYPES.first }
|
|
@@ -119,13 +118,13 @@ FactoryBot.define do
|
|
|
119
118
|
|
|
120
119
|
trait :with_answer_options do
|
|
121
120
|
answer_options do
|
|
122
|
-
Array.new(3).collect { build(:answer_option) }
|
|
121
|
+
Array.new(3).collect { build(:answer_option, skip_injection: skip_injection) }
|
|
123
122
|
end
|
|
124
123
|
end
|
|
125
124
|
|
|
126
125
|
trait :conditioned do
|
|
127
126
|
display_conditions do
|
|
128
|
-
Array.new(3).collect { build(:display_condition) }
|
|
127
|
+
Array.new(3).collect { build(:display_condition, skip_injection: skip_injection) }
|
|
129
128
|
end
|
|
130
129
|
end
|
|
131
130
|
|
|
@@ -139,22 +138,28 @@ FactoryBot.define do
|
|
|
139
138
|
end
|
|
140
139
|
|
|
141
140
|
factory :answer, class: "Decidim::Forms::Answer" do
|
|
141
|
+
transient do
|
|
142
|
+
skip_injection { false }
|
|
143
|
+
end
|
|
142
144
|
body { "hola" }
|
|
143
145
|
questionnaire
|
|
144
|
-
question { create(:questionnaire_question, questionnaire: questionnaire) }
|
|
145
|
-
user { create(:user, organization: questionnaire.questionnaire_for.organization) }
|
|
146
|
+
question { create(:questionnaire_question, questionnaire: questionnaire, skip_injection: skip_injection) }
|
|
147
|
+
user { create(:user, organization: questionnaire.questionnaire_for.organization, skip_injection: skip_injection) }
|
|
146
148
|
session_token { Digest::MD5.hexdigest(user.id.to_s) }
|
|
147
149
|
|
|
148
150
|
trait :with_attachments do
|
|
149
|
-
after(:create) do |answer,
|
|
150
|
-
create :attachment, :with_image, attached_to: answer
|
|
151
|
-
create :attachment, :with_pdf, attached_to: answer
|
|
151
|
+
after(:create) do |answer, evaluator|
|
|
152
|
+
create :attachment, :with_image, attached_to: answer, skip_injection: evaluator.skip_injection
|
|
153
|
+
create :attachment, :with_pdf, attached_to: answer, skip_injection: evaluator.skip_injection
|
|
152
154
|
end
|
|
153
155
|
end
|
|
154
156
|
end
|
|
155
157
|
|
|
156
158
|
factory :answer_option, class: "Decidim::Forms::AnswerOption" do
|
|
157
|
-
|
|
159
|
+
transient do
|
|
160
|
+
skip_injection { false }
|
|
161
|
+
end
|
|
162
|
+
question { create(:questionnaire_question, skip_injection: skip_injection) }
|
|
158
163
|
body { generate_localized_title }
|
|
159
164
|
free_text { false }
|
|
160
165
|
|
|
@@ -168,31 +173,40 @@ FactoryBot.define do
|
|
|
168
173
|
end
|
|
169
174
|
|
|
170
175
|
factory :answer_choice, class: "Decidim::Forms::AnswerChoice" do
|
|
176
|
+
transient do
|
|
177
|
+
skip_injection { false }
|
|
178
|
+
end
|
|
171
179
|
answer
|
|
172
|
-
answer_option { create(:answer_option, question: answer.question) }
|
|
173
|
-
matrix_row { create(:question_matrix_row, question: answer.question) }
|
|
180
|
+
answer_option { create(:answer_option, question: answer.question, skip_injection: skip_injection) }
|
|
181
|
+
matrix_row { create(:question_matrix_row, question: answer.question, skip_injection: skip_injection) }
|
|
174
182
|
end
|
|
175
183
|
|
|
176
184
|
factory :question_matrix_row, class: "Decidim::Forms::QuestionMatrixRow" do
|
|
177
|
-
|
|
185
|
+
transient do
|
|
186
|
+
skip_injection { false }
|
|
187
|
+
end
|
|
188
|
+
question { create(:questionnaire_question, skip_injection: skip_injection) }
|
|
178
189
|
body { generate_localized_title }
|
|
179
190
|
position { 0 }
|
|
180
191
|
end
|
|
181
192
|
|
|
182
193
|
factory :display_condition, class: "Decidim::Forms::DisplayCondition" do
|
|
183
|
-
|
|
184
|
-
|
|
194
|
+
transient do
|
|
195
|
+
skip_injection { false }
|
|
196
|
+
end
|
|
197
|
+
condition_question { create(:questionnaire_question, skip_injection: skip_injection) }
|
|
198
|
+
question { create(:questionnaire_question, position: 1, skip_injection: skip_injection) }
|
|
185
199
|
condition_type { :answered }
|
|
186
200
|
mandatory { true }
|
|
187
201
|
|
|
188
202
|
trait :equal do
|
|
189
203
|
condition_type { :equal }
|
|
190
|
-
answer_option { create(:answer_option, question: condition_question) }
|
|
204
|
+
answer_option { create(:answer_option, question: condition_question, skip_injection: skip_injection) }
|
|
191
205
|
end
|
|
192
206
|
|
|
193
207
|
trait :match do
|
|
194
208
|
condition_type { :match }
|
|
195
|
-
condition_value { generate_localized_title }
|
|
209
|
+
condition_value { generate_localized_title(:condition_value, skip_injection: skip_injection) }
|
|
196
210
|
end
|
|
197
211
|
end
|
|
198
212
|
end
|
|
@@ -8,7 +8,7 @@ shared_examples_for "has questionnaire" do
|
|
|
8
8
|
visit questionnaire_public_path
|
|
9
9
|
|
|
10
10
|
expect(page).to have_i18n_content(questionnaire.title, upcase: true)
|
|
11
|
-
expect(page).to have_i18n_content(questionnaire.description)
|
|
11
|
+
expect(page).to have_i18n_content(questionnaire.description, strip_tags: true)
|
|
12
12
|
|
|
13
13
|
expect(page).not_to have_css(".form.answer-questionnaire")
|
|
14
14
|
|
|
@@ -29,7 +29,7 @@ shared_examples_for "has questionnaire" do
|
|
|
29
29
|
visit questionnaire_public_path
|
|
30
30
|
|
|
31
31
|
expect(page).to have_i18n_content(questionnaire.title, upcase: true)
|
|
32
|
-
expect(page).to have_i18n_content(questionnaire.description)
|
|
32
|
+
expect(page).to have_i18n_content(questionnaire.description, strip_tags: true)
|
|
33
33
|
|
|
34
34
|
fill_in question.body["en"], with: "My first answer"
|
|
35
35
|
|
|
@@ -32,7 +32,7 @@ module Decidim
|
|
|
32
32
|
def hash_for(answer)
|
|
33
33
|
{
|
|
34
34
|
answer_translated_attribute_name(:id) => answer&.session_token,
|
|
35
|
-
answer_translated_attribute_name(:created_at) => answer&.created_at
|
|
35
|
+
answer_translated_attribute_name(:created_at) => answer&.created_at,
|
|
36
36
|
answer_translated_attribute_name(:ip_hash) => answer&.ip_hash,
|
|
37
37
|
answer_translated_attribute_name(:user_status) => answer_translated_attribute_name(answer&.decidim_user_id.present? ? "registered" : "unregistered")
|
|
38
38
|
}
|
metadata
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: decidim-forms
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.27.
|
|
4
|
+
version: 0.27.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Josep Jaume Rey Peroy
|
|
8
8
|
- Marc Riera Casals
|
|
9
9
|
- Oriol Gual Oliva
|
|
10
10
|
- Rubén González Valero
|
|
11
|
-
autorequire:
|
|
11
|
+
autorequire:
|
|
12
12
|
bindir: bin
|
|
13
13
|
cert_chain: []
|
|
14
|
-
date:
|
|
14
|
+
date: 2024-04-30 00:00:00.000000000 Z
|
|
15
15
|
dependencies:
|
|
16
16
|
- !ruby/object:Gem::Dependency
|
|
17
17
|
name: decidim-core
|
|
@@ -19,14 +19,14 @@ dependencies:
|
|
|
19
19
|
requirements:
|
|
20
20
|
- - '='
|
|
21
21
|
- !ruby/object:Gem::Version
|
|
22
|
-
version: 0.27.
|
|
22
|
+
version: 0.27.6
|
|
23
23
|
type: :runtime
|
|
24
24
|
prerelease: false
|
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
|
26
26
|
requirements:
|
|
27
27
|
- - '='
|
|
28
28
|
- !ruby/object:Gem::Version
|
|
29
|
-
version: 0.27.
|
|
29
|
+
version: 0.27.6
|
|
30
30
|
- !ruby/object:Gem::Dependency
|
|
31
31
|
name: wicked_pdf
|
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -61,28 +61,28 @@ dependencies:
|
|
|
61
61
|
requirements:
|
|
62
62
|
- - '='
|
|
63
63
|
- !ruby/object:Gem::Version
|
|
64
|
-
version: 0.27.
|
|
64
|
+
version: 0.27.6
|
|
65
65
|
type: :development
|
|
66
66
|
prerelease: false
|
|
67
67
|
version_requirements: !ruby/object:Gem::Requirement
|
|
68
68
|
requirements:
|
|
69
69
|
- - '='
|
|
70
70
|
- !ruby/object:Gem::Version
|
|
71
|
-
version: 0.27.
|
|
71
|
+
version: 0.27.6
|
|
72
72
|
- !ruby/object:Gem::Dependency
|
|
73
73
|
name: decidim-dev
|
|
74
74
|
requirement: !ruby/object:Gem::Requirement
|
|
75
75
|
requirements:
|
|
76
76
|
- - '='
|
|
77
77
|
- !ruby/object:Gem::Version
|
|
78
|
-
version: 0.27.
|
|
78
|
+
version: 0.27.6
|
|
79
79
|
type: :development
|
|
80
80
|
prerelease: false
|
|
81
81
|
version_requirements: !ruby/object:Gem::Requirement
|
|
82
82
|
requirements:
|
|
83
83
|
- - '='
|
|
84
84
|
- !ruby/object:Gem::Version
|
|
85
|
-
version: 0.27.
|
|
85
|
+
version: 0.27.6
|
|
86
86
|
description: A forms gem for decidim.
|
|
87
87
|
email:
|
|
88
88
|
- josepjaume@gmail.com
|
|
@@ -186,7 +186,6 @@ files:
|
|
|
186
186
|
- app/views/decidim/forms/questionnaires/show.html.erb
|
|
187
187
|
- app/views/layouts/decidim/forms/admin/questionnaires/questionnaire_answers.html.erb
|
|
188
188
|
- config/assets.rb
|
|
189
|
-
- config/environment.rb
|
|
190
189
|
- config/initializers/wicked_pdf.rb
|
|
191
190
|
- config/locales/am-ET.yml
|
|
192
191
|
- config/locales/ar-SA.yml
|
|
@@ -220,6 +219,7 @@ files:
|
|
|
220
219
|
- config/locales/ga-IE.yml
|
|
221
220
|
- config/locales/gl.yml
|
|
222
221
|
- config/locales/gn-PY.yml
|
|
222
|
+
- config/locales/he-IL.yml
|
|
223
223
|
- config/locales/hr-HR.yml
|
|
224
224
|
- config/locales/hr.yml
|
|
225
225
|
- config/locales/hu.yml
|
|
@@ -254,9 +254,11 @@ files:
|
|
|
254
254
|
- config/locales/sk.yml
|
|
255
255
|
- config/locales/sl.yml
|
|
256
256
|
- config/locales/so-SO.yml
|
|
257
|
+
- config/locales/sq-AL.yml
|
|
257
258
|
- config/locales/sr-CS.yml
|
|
258
259
|
- config/locales/sv.yml
|
|
259
260
|
- config/locales/sw-KE.yml
|
|
261
|
+
- config/locales/th-TH.yml
|
|
260
262
|
- config/locales/ti-ER.yml
|
|
261
263
|
- config/locales/tr-TR.yml
|
|
262
264
|
- config/locales/uk.yml
|
|
@@ -278,6 +280,7 @@ files:
|
|
|
278
280
|
- db/migrate/20201110152921_add_salt_to_decidim_forms_questionnaires.rb
|
|
279
281
|
- db/migrate/20210208094442_add_max_characters_to_decidim_forms_questions.rb
|
|
280
282
|
- db/migrate/20210616153042_set_position_to_question_matrix_rows.rb
|
|
283
|
+
- decidim-forms.gemspec
|
|
281
284
|
- lib/decidim/api/answer_option_type.rb
|
|
282
285
|
- lib/decidim/api/question_type.rb
|
|
283
286
|
- lib/decidim/api/questionnaire_entity_interface.rb
|
|
@@ -305,15 +308,15 @@ homepage: https://github.com/decidim/decidim
|
|
|
305
308
|
licenses:
|
|
306
309
|
- AGPL-3.0
|
|
307
310
|
metadata: {}
|
|
308
|
-
post_install_message:
|
|
311
|
+
post_install_message:
|
|
309
312
|
rdoc_options: []
|
|
310
313
|
require_paths:
|
|
311
314
|
- lib
|
|
312
315
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
313
316
|
requirements:
|
|
314
|
-
- - "
|
|
317
|
+
- - "~>"
|
|
315
318
|
- !ruby/object:Gem::Version
|
|
316
|
-
version:
|
|
319
|
+
version: 3.0.0
|
|
317
320
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
318
321
|
requirements:
|
|
319
322
|
- - ">="
|
|
@@ -321,7 +324,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
321
324
|
version: '0'
|
|
322
325
|
requirements: []
|
|
323
326
|
rubygems_version: 3.2.22
|
|
324
|
-
signing_key:
|
|
327
|
+
signing_key:
|
|
325
328
|
specification_version: 4
|
|
326
329
|
summary: Decidim forms
|
|
327
330
|
test_files: []
|
data/config/environment.rb
DELETED
|
File without changes
|