decidim-forms 0.25.0 → 0.26.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/commands/decidim/forms/answer_questionnaire.rb +6 -2
- data/app/forms/decidim/forms/admin/question_form.rb +4 -0
- data/app/models/decidim/forms/answer.rb +1 -0
- data/app/models/decidim/forms/question.rb +7 -1
- data/app/packs/src/decidim/forms/admin/forms.js +2 -0
- data/app/presenters/decidim/forms/admin/questionnaire_answer_presenter.rb +19 -4
- data/app/presenters/decidim/forms/admin/questionnaire_participant_presenter.rb +5 -2
- data/app/queries/decidim/forms/questionnaire_user_answers.rb +4 -1
- data/app/views/decidim/forms/admin/questionnaires/_form.html.erb +12 -0
- data/app/views/decidim/forms/admin/questionnaires/_title_and_description.html.erb +80 -0
- data/app/views/decidim/forms/questionnaires/_answer.html.erb +10 -1
- data/app/views/decidim/forms/questionnaires/answers/_title_and_description.html.erb +1 -0
- data/app/views/decidim/forms/questionnaires/show.html.erb +8 -7
- data/config/locales/ca.yml +11 -0
- data/config/locales/cs.yml +11 -0
- data/config/locales/en.yml +11 -0
- data/config/locales/es-MX.yml +11 -0
- data/config/locales/es-PY.yml +11 -0
- data/config/locales/es.yml +11 -0
- data/config/locales/fi-plain.yml +11 -0
- data/config/locales/fi.yml +11 -0
- data/config/locales/fr-CA.yml +11 -0
- data/config/locales/fr.yml +12 -1
- data/config/locales/ja.yml +12 -1
- data/config/locales/lb-LU.yml +103 -0
- data/config/locales/nl.yml +11 -0
- data/config/locales/pt-BR.yml +1 -1
- data/config/locales/ro-RO.yml +67 -58
- data/config/locales/val-ES.yml +18 -0
- data/lib/decidim/forms/engine.rb +4 -0
- data/lib/decidim/forms/test/factories.rb +12 -0
- data/lib/decidim/forms/test/shared_examples/manage_questionnaire_answers.rb +18 -0
- data/lib/decidim/forms/test/shared_examples/manage_questionnaires/add_questions.rb +36 -5
- data/lib/decidim/forms/test/shared_examples/manage_questionnaires/update_questions.rb +98 -0
- data/lib/decidim/forms/test/shared_examples/manage_questionnaires.rb +8 -0
- data/lib/decidim/forms/user_answers_serializer.rb +7 -1
- data/lib/decidim/forms/version.rb +1 -1
- metadata +17 -14
data/config/locales/fr-CA.yml
CHANGED
@@ -79,6 +79,7 @@ fr-CA:
|
|
79
79
|
form:
|
80
80
|
add_question: Ajouter une question
|
81
81
|
add_separator: Ajouter un séparateur
|
82
|
+
add_title_and_description: Ajouter un titre et une description
|
82
83
|
already_answered_warning: Certains utilisateurs ont déjà répondu au questionnaire, vous ne pouvez donc pas modifier ses questions.
|
83
84
|
collapse: Réduire toutes les questions
|
84
85
|
expand: Développer toutes les questions
|
@@ -108,6 +109,15 @@ fr-CA:
|
|
108
109
|
remove: Retirer
|
109
110
|
separator: Séparateur
|
110
111
|
up: Haut
|
112
|
+
title_and_description:
|
113
|
+
collapse: Réduire
|
114
|
+
description: Description
|
115
|
+
down: Descendre
|
116
|
+
expand: Déveloper
|
117
|
+
remove: Supprimer
|
118
|
+
title: Titre
|
119
|
+
title_and_description: Titre et description
|
120
|
+
up: Vers le haut
|
111
121
|
update:
|
112
122
|
invalid: Il y a eu des erreurs lors de la sauvegarde du questionnaire.
|
113
123
|
success: Le formulaire a bien été sauvegardé.
|
@@ -131,6 +141,7 @@ fr-CA:
|
|
131
141
|
short_answer: Réponse courte
|
132
142
|
single_option: Option unique
|
133
143
|
sorting: Tri
|
144
|
+
title_and_description: Titre et description
|
134
145
|
questionnaires:
|
135
146
|
answer:
|
136
147
|
invalid: Il y a eu des erreurs en répondant au questionnaire.
|
data/config/locales/fr.yml
CHANGED
@@ -79,6 +79,7 @@ fr:
|
|
79
79
|
form:
|
80
80
|
add_question: Ajouter une question
|
81
81
|
add_separator: Ajouter un séparateur
|
82
|
+
add_title_and_description: Ajouter un titre et une description
|
82
83
|
already_answered_warning: Certains utilisateurs ont déjà répondu au questionnaire, vous ne pouvez donc pas modifier ses questions.
|
83
84
|
collapse: Réduire toutes les questions
|
84
85
|
expand: Développer toutes les questions
|
@@ -108,6 +109,15 @@ fr:
|
|
108
109
|
remove: Retirer
|
109
110
|
separator: Séparateur
|
110
111
|
up: Haut
|
112
|
+
title_and_description:
|
113
|
+
collapse: Réduire
|
114
|
+
description: Description
|
115
|
+
down: Descendre
|
116
|
+
expand: Développer
|
117
|
+
remove: Supprimer
|
118
|
+
title: Titre
|
119
|
+
title_and_description: Titre et description
|
120
|
+
up: Monter
|
111
121
|
update:
|
112
122
|
invalid: Il y a eu des erreurs lors de la sauvegarde du questionnaire.
|
113
123
|
success: Le questionnaire a bien été sauvegardé.
|
@@ -131,6 +141,7 @@ fr:
|
|
131
141
|
short_answer: Réponse courte
|
132
142
|
single_option: Option unique
|
133
143
|
sorting: Tri
|
144
|
+
title_and_description: Titre et description
|
134
145
|
questionnaires:
|
135
146
|
answer:
|
136
147
|
invalid: Il y a eu des erreurs en répondant au questionnaire.
|
@@ -140,7 +151,7 @@ fr:
|
|
140
151
|
max_choices: 'Choix maximum: %{n}'
|
141
152
|
show:
|
142
153
|
answer_questionnaire:
|
143
|
-
anonymous_user_message: <a href="%{sign_in_link}">
|
154
|
+
anonymous_user_message: <a href="%{sign_in_link}">Identifiez-vous avec votre compte</a> ou <a href="%{sign_up_link}">créez un compte</a> pour répondre au questionnaire.
|
144
155
|
title: Répondez au questionnaire
|
145
156
|
current_step: Étape %{step}
|
146
157
|
of_total_steps: de %{total_steps}
|
data/config/locales/ja.yml
CHANGED
@@ -9,7 +9,7 @@ ja:
|
|
9
9
|
max_choices: 選択肢の最大数
|
10
10
|
question_type: タイプ
|
11
11
|
questionnaire_question:
|
12
|
-
mandatory:
|
12
|
+
mandatory: 必須
|
13
13
|
max_characters: 文字数制限 (制限がない場合は0にしてください)
|
14
14
|
errors:
|
15
15
|
models:
|
@@ -79,6 +79,7 @@ ja:
|
|
79
79
|
form:
|
80
80
|
add_question: 質問を追加
|
81
81
|
add_separator: 区切り文字を追加
|
82
|
+
add_title_and_description: タイトルと説明を追加
|
82
83
|
already_answered_warning: このフォームはすでに一部のユーザーによって回答されているため、質問を修正することはできません。
|
83
84
|
collapse: すべての質問を閉じる
|
84
85
|
expand: すべての質問を展開
|
@@ -108,6 +109,15 @@ ja:
|
|
108
109
|
remove: 削除
|
109
110
|
separator: 区切り記号
|
110
111
|
up: 上へ
|
112
|
+
title_and_description:
|
113
|
+
collapse: 折りたたむ
|
114
|
+
description: 説明
|
115
|
+
down: 下へ
|
116
|
+
expand: 展開する
|
117
|
+
remove: 削除
|
118
|
+
title: タイトル
|
119
|
+
title_and_description: タイトルと説明
|
120
|
+
up: 上へ
|
111
121
|
update:
|
112
122
|
invalid: フォームの保存に失敗しました。
|
113
123
|
success: フォームを保存しました。
|
@@ -131,6 +141,7 @@ ja:
|
|
131
141
|
short_answer: 短い回答
|
132
142
|
single_option: 単一オプション
|
133
143
|
sorting: 並び替え
|
144
|
+
title_and_description: タイトルと説明
|
134
145
|
questionnaires:
|
135
146
|
answer:
|
136
147
|
invalid: フォームの回答に問題がありました。
|
data/config/locales/lb-LU.yml
CHANGED
@@ -1 +1,104 @@
|
|
1
1
|
lb:
|
2
|
+
activemodel:
|
3
|
+
attributes:
|
4
|
+
questionnaire_question:
|
5
|
+
mandatory: Verpflichtend
|
6
|
+
max_characters: Maximale Anzahl Zeichen (0 bedeutet kein Limit)
|
7
|
+
errors:
|
8
|
+
models:
|
9
|
+
answer:
|
10
|
+
attributes:
|
11
|
+
add_documents:
|
12
|
+
needs_to_be_reattached: Muss erneut angehängt werden
|
13
|
+
body:
|
14
|
+
too_long: ist zu lang
|
15
|
+
choices:
|
16
|
+
missing: sind nicht vollständig
|
17
|
+
too_many: sind zu viele
|
18
|
+
questionnaire:
|
19
|
+
request_invalid: Bei der Bearbeitung der Anfrage ist ein Fehler aufgetreten. Bitte versuchen Sie es nochmal
|
20
|
+
decidim:
|
21
|
+
forms:
|
22
|
+
admin:
|
23
|
+
models:
|
24
|
+
components:
|
25
|
+
description: Beschreibung
|
26
|
+
tos: Nutzungsbedingungen
|
27
|
+
questionnaires:
|
28
|
+
actions:
|
29
|
+
back: Zurück zu Fragen
|
30
|
+
show: Antworten anzeigen
|
31
|
+
answer_option:
|
32
|
+
answer_option: Antwortoption
|
33
|
+
free_text: Freier Text
|
34
|
+
remove: Löschen
|
35
|
+
statement: Aussage
|
36
|
+
answers:
|
37
|
+
actions:
|
38
|
+
back: Zurück zu Antworten
|
39
|
+
export: Exportieren
|
40
|
+
show: Antworten anzeigen
|
41
|
+
empty: Noch keine Antworten
|
42
|
+
export:
|
43
|
+
answer:
|
44
|
+
title: 'Antwort #%{number}'
|
45
|
+
export_response:
|
46
|
+
title: Umfrage_Benutzer_Antworten_%{token}
|
47
|
+
index:
|
48
|
+
title: "%{total} Antworten insgesamt"
|
49
|
+
show:
|
50
|
+
title: 'Antwort #%{number}'
|
51
|
+
display_condition:
|
52
|
+
answer_option: Antwortoption
|
53
|
+
condition_question: Frage
|
54
|
+
condition_type: Bedingung
|
55
|
+
condition_types:
|
56
|
+
answered: Beantwortet
|
57
|
+
equal: Gleich
|
58
|
+
match: Beinhaltet Text
|
59
|
+
not_answered: Unbeantwortet
|
60
|
+
not_equal: Nicht gleich
|
61
|
+
condition_value: Enthaltener Text
|
62
|
+
display_condition: Bedingung anzeigen
|
63
|
+
mandatory: Diese Bedingung muss immer erfüllt werden, unabhängig vom Status anderer Bedingungen
|
64
|
+
remove: Löschen
|
65
|
+
save_warning: Vergessen Sie nicht, das Formular zu speichern, bevor Sie die Anzeigebedingungen konfigurieren
|
66
|
+
select_answer_option: Antwortoption auswählen
|
67
|
+
select_condition_question: Eine Frage
|
68
|
+
select_condition_type: Wählen Sie einen Bedingungstyp
|
69
|
+
edit:
|
70
|
+
save: Speichern
|
71
|
+
title: Fragebogen bearbeiten
|
72
|
+
form:
|
73
|
+
add_question: Frage hinzufügen
|
74
|
+
add_separator: Trennzeichen hinzufügen
|
75
|
+
already_answered_warning: Der Fragebogen wird bereits von einigen Benutzern beantwortet, sodass Sie die Fragen nicht ändern können.
|
76
|
+
collapse: Alle Fragen einklappen
|
77
|
+
expand: Alle Fragen ausklappen
|
78
|
+
preview: Vorschau
|
79
|
+
title: Formular für %{questionnaire_for} bearbeiten
|
80
|
+
unpublished_warning: Das Formular ist nicht öffentlich. Sie können die Fragen ändern, dabei werden allerdings die aktuellen Antworten gelöscht.
|
81
|
+
matrix_row:
|
82
|
+
matrix_row: Zeile
|
83
|
+
questionnaires:
|
84
|
+
show:
|
85
|
+
questionnaire_not_published:
|
86
|
+
body: Dieses Formular ist noch nicht veröffentlicht.
|
87
|
+
tos_agreement: Mit der Teilnahme stimmen Sie den Nutzungsbedingungen zu
|
88
|
+
step_navigation:
|
89
|
+
show:
|
90
|
+
are_you_sure: Diese Aktion kann nicht rückgängig gemacht werden und Sie können Ihre Antworten nicht bearbeiten. Bist du sicher?
|
91
|
+
back: Zurück
|
92
|
+
continue: Weiter
|
93
|
+
submit: einreichen
|
94
|
+
user_answers_serializer:
|
95
|
+
body: Antwort
|
96
|
+
completion: Abschluss
|
97
|
+
created_at: Beantwortet am
|
98
|
+
id: ID beantworten
|
99
|
+
ip_hash: IP-Hash
|
100
|
+
question: Frage
|
101
|
+
registered: Registriert
|
102
|
+
session_token: Benutzerkennung
|
103
|
+
unregistered: Nicht registriert
|
104
|
+
user_status: Benutzerstatus
|
data/config/locales/nl.yml
CHANGED
@@ -74,6 +74,7 @@ nl:
|
|
74
74
|
form:
|
75
75
|
add_question: Vraag toevoegen
|
76
76
|
add_separator: Scheidingsteken toevoegen
|
77
|
+
add_title_and_description: Titel en beschrijving toevoegen
|
77
78
|
already_answered_warning: De vragenlijst is al door enkele gebruikers beantwoord, dus u kunt de vragen niet wijzigen.
|
78
79
|
collapse: Alle vragen samenvouwen
|
79
80
|
expand: Vouw alle vragen uit
|
@@ -102,6 +103,15 @@ nl:
|
|
102
103
|
remove: Verwijderen
|
103
104
|
separator: Scheidingsteken
|
104
105
|
up: Omhoog
|
106
|
+
title_and_description:
|
107
|
+
collapse: Inklappen
|
108
|
+
description: Beschrijving
|
109
|
+
down: Naar beneden
|
110
|
+
expand: Uitklappen
|
111
|
+
remove: Verwijderen
|
112
|
+
title: Titel
|
113
|
+
title_and_description: Titel en beschrijving
|
114
|
+
up: Naar boven
|
105
115
|
update:
|
106
116
|
invalid: Er zijn fouten opgetreden bij het opslaan van de vragenlijst.
|
107
117
|
success: Formulier succesvol opgeslagen.
|
@@ -124,6 +134,7 @@ nl:
|
|
124
134
|
short_answer: Kort antwoord
|
125
135
|
single_option: Enkele optie
|
126
136
|
sorting: sorteer-
|
137
|
+
title_and_description: Titel en beschrijving
|
127
138
|
questionnaires:
|
128
139
|
answer:
|
129
140
|
invalid: Er zijn fouten opgetreden bij het beantwoorden van de vragenlijst.
|
data/config/locales/pt-BR.yml
CHANGED
data/config/locales/ro-RO.yml
CHANGED
@@ -4,13 +4,13 @@ ro:
|
|
4
4
|
answer:
|
5
5
|
body: Răspuns
|
6
6
|
choices: Opțiuni
|
7
|
-
selected_choices:
|
7
|
+
selected_choices: Opțiuni selectate
|
8
8
|
question:
|
9
9
|
max_choices: Numărul maxim de opțiuni
|
10
10
|
question_type: Tip
|
11
11
|
questionnaire_question:
|
12
|
-
mandatory:
|
13
|
-
max_characters: Limita de caractere (lăsați la 0 dacă nu este limită)
|
12
|
+
mandatory: Obligatoriu
|
13
|
+
max_characters: Limita de caractere (lăsați la 0 dacă nu este nicio limită)
|
14
14
|
errors:
|
15
15
|
models:
|
16
16
|
answer:
|
@@ -20,23 +20,23 @@ ro:
|
|
20
20
|
body:
|
21
21
|
too_long: este prea lung
|
22
22
|
choices:
|
23
|
-
missing: nu sunt
|
23
|
+
missing: nu sunt completate
|
24
24
|
too_many: sunt prea multe
|
25
25
|
questionnaire:
|
26
|
-
request_invalid: A apărut o eroare la procesarea cererii.
|
26
|
+
request_invalid: A apărut o eroare la procesarea cererii. Te rugăm să încerci din nou
|
27
27
|
decidim:
|
28
28
|
forms:
|
29
29
|
admin:
|
30
30
|
models:
|
31
31
|
components:
|
32
32
|
description: Descriere
|
33
|
-
tos:
|
33
|
+
tos: Condiţii de utilizare
|
34
34
|
questionnaires:
|
35
35
|
actions:
|
36
36
|
back: Înapoi la întrebări
|
37
|
-
show:
|
37
|
+
show: Afișează răspunsurile
|
38
38
|
answer_option:
|
39
|
-
answer_option: Opțiune răspuns
|
39
|
+
answer_option: Opțiune de răspuns
|
40
40
|
free_text: Text liber
|
41
41
|
remove: Elimină
|
42
42
|
statement: Declarație
|
@@ -44,76 +44,84 @@ ro:
|
|
44
44
|
actions:
|
45
45
|
back: Înapoi la răspunsuri
|
46
46
|
export: Exportă
|
47
|
-
show:
|
48
|
-
empty:
|
47
|
+
show: Afişează răspunsurile
|
48
|
+
empty: Niciun răspuns încă
|
49
49
|
export:
|
50
50
|
answer:
|
51
51
|
title: 'Răspuns #%{number}'
|
52
52
|
export_response:
|
53
|
-
title:
|
53
|
+
title: survey_user_answers_%{token}
|
54
54
|
index:
|
55
55
|
title: "%{total} total răspunsuri"
|
56
56
|
show:
|
57
57
|
title: 'Răspuns #%{number}'
|
58
58
|
display_condition:
|
59
|
-
answer_option: Opțiune răspuns
|
59
|
+
answer_option: Opțiune de răspuns
|
60
60
|
condition_question: Întrebare
|
61
61
|
condition_type: Condiție
|
62
62
|
condition_types:
|
63
|
-
answered:
|
64
|
-
equal: Egal
|
63
|
+
answered: Răspunse
|
64
|
+
equal: Egal cu
|
65
65
|
match: Include textul
|
66
|
-
not_answered:
|
67
|
-
not_equal: Nu este egal
|
66
|
+
not_answered: Fără răspuns
|
67
|
+
not_equal: Nu este egal cu
|
68
68
|
condition_value: Text inclus
|
69
|
-
display_condition:
|
70
|
-
mandatory: Această condiție trebuie îndeplinită întotdeauna indiferent de
|
69
|
+
display_condition: Afișează condiția
|
70
|
+
mandatory: Această condiție trebuie îndeplinită întotdeauna indiferent de stadiul altor condiții
|
71
71
|
remove: Elimină
|
72
|
-
save_warning:
|
73
|
-
select_answer_option:
|
72
|
+
save_warning: Ține minte să salvezi chestionarul înainte de configurarea condiţiilor de afişare
|
73
|
+
select_answer_option: Selectează opțiunea de răspuns
|
74
74
|
select_condition_question: Selectează o întrebare
|
75
|
-
select_condition_type:
|
75
|
+
select_condition_type: Selectează un tip de condiție
|
76
76
|
edit:
|
77
77
|
save: Salvează
|
78
|
-
title:
|
78
|
+
title: Editează chestionarul
|
79
79
|
form:
|
80
80
|
add_question: Adaugă întrebare
|
81
81
|
add_separator: Adaugă separator
|
82
|
-
|
82
|
+
add_title_and_description: Adaugă titlu și descriere
|
83
|
+
already_answered_warning: Au fost înregistrare deja câteva răspunsuri de la utilizatori pentru acest chestionar. De aceea, nu mai poți modifica întrebările.
|
83
84
|
collapse: Restrânge toate întrebările
|
84
85
|
expand: Extinde toate întrebările
|
85
|
-
preview:
|
86
|
-
title:
|
87
|
-
unpublished_warning:
|
86
|
+
preview: Previzualizează
|
87
|
+
title: Editează chestionarul pentru %{questionnaire_for}
|
88
|
+
unpublished_warning: Chestionarul nu este publicat. Poți modifica întrebările, dar această acțiune va duce la stergerea automată a răspunsurilor curente.
|
88
89
|
matrix_row:
|
89
90
|
matrix_row: Rând
|
90
91
|
remove: Elimină
|
91
92
|
statement: Declarație
|
92
93
|
question:
|
93
|
-
add_answer_option: Adaugă opțiune răspuns
|
94
|
-
add_display_condition:
|
95
|
-
add_display_condition_info:
|
94
|
+
add_answer_option: Adaugă opțiune de răspuns
|
95
|
+
add_display_condition: Adaugă condiție de afișare
|
96
|
+
add_display_condition_info: Salvează formularul pentru a configura condițiile de afișare
|
96
97
|
add_matrix_row: Adaugă rând
|
97
98
|
any: Oricare
|
98
99
|
collapse: Restrânge
|
99
100
|
description: Descriere
|
100
|
-
down:
|
101
|
+
down: Mergi în jos
|
101
102
|
expand: Extinde
|
102
103
|
question: Întrebare
|
103
104
|
remove: Elimină
|
104
105
|
statement: Declarație
|
105
|
-
up:
|
106
|
+
up: Mergi în sus
|
106
107
|
separator:
|
107
|
-
down:
|
108
|
+
down: Mergi în jos
|
108
109
|
remove: Elimină
|
109
110
|
separator: Separator
|
110
|
-
up:
|
111
|
+
up: Mergi în sus
|
112
|
+
title_and_description:
|
113
|
+
collapse: Restrânge
|
114
|
+
description: Descriere
|
115
|
+
expand: Extinde
|
116
|
+
remove: Șterge
|
117
|
+
title: Titlu
|
118
|
+
title_and_description: Titlu și descriere
|
111
119
|
update:
|
112
|
-
invalid: A apărut o eroare la salvarea
|
113
|
-
success:
|
120
|
+
invalid: A apărut o eroare la salvarea chestionarului.
|
121
|
+
success: Chestionarul a fost salvat cu succes.
|
114
122
|
errors:
|
115
123
|
answer:
|
116
|
-
body:
|
124
|
+
body: Conținutul nu poate fi gol
|
117
125
|
files:
|
118
126
|
extension_allowlist: 'Formate acceptate:'
|
119
127
|
images:
|
@@ -121,58 +129,59 @@ ro:
|
|
121
129
|
dimensions_info: 'Această imagine va fi:'
|
122
130
|
processors:
|
123
131
|
resize_and_pad: Redimensionat și padded la
|
124
|
-
resize_to_fit:
|
132
|
+
resize_to_fit: Redimensionată pentru a se potrivi
|
125
133
|
question_types:
|
126
134
|
files: Fișiere
|
127
135
|
long_answer: Răspuns lung
|
128
|
-
matrix_multiple:
|
129
|
-
matrix_single:
|
130
|
-
multiple_option:
|
136
|
+
matrix_multiple: Matrice (mai multe opțiuni)
|
137
|
+
matrix_single: Matrice (opțiune unică)
|
138
|
+
multiple_option: Mai multe opțiuni
|
131
139
|
short_answer: Răspuns scurt
|
132
140
|
single_option: Opțiune unică
|
133
141
|
sorting: Sortare
|
142
|
+
title_and_description: Titlu și descriere
|
134
143
|
questionnaires:
|
135
144
|
answer:
|
136
|
-
invalid: A apărut o problemă
|
145
|
+
invalid: A apărut o problemă la completarea chestionarului.
|
137
146
|
max_choices_alert: Există prea multe alegeri selectate
|
138
|
-
success:
|
147
|
+
success: Chestionarul a fost completat cu succes.
|
139
148
|
question:
|
140
|
-
max_choices: '
|
149
|
+
max_choices: 'Număr maxim de alegeri: %{n}'
|
141
150
|
show:
|
142
151
|
answer_questionnaire:
|
143
|
-
anonymous_user_message: <a href="%{sign_in_link}">Autentifică-te cu contul tău</a> sau <a href="%{sign_up_link}">înregistrează-te</a> pentru a răspunde la
|
144
|
-
title:
|
152
|
+
anonymous_user_message: <a href="%{sign_in_link}">Autentifică-te cu contul tău</a> sau <a href="%{sign_up_link}">înregistrează-te</a> pentru a răspunde la chestionar.
|
153
|
+
title: Completează chestionarul
|
145
154
|
current_step: Pasul %{step}
|
146
155
|
of_total_steps: din %{total_steps}
|
147
156
|
questionnaire_answered:
|
148
|
-
body:
|
149
|
-
title:
|
157
|
+
body: Ai completat deja la acest chestionar.
|
158
|
+
title: Un răspuns a fost deja trimis
|
150
159
|
questionnaire_closed:
|
151
|
-
body:
|
160
|
+
body: Chestionarul este închis și nu mai poate fi completat.
|
152
161
|
title: Formular închis
|
153
162
|
questionnaire_for_private_users:
|
154
|
-
body:
|
155
|
-
title:
|
163
|
+
body: Chestionarul este disponibil doar pentru utilizatorii privați
|
164
|
+
title: Chestionar închis
|
156
165
|
questionnaire_js_disabled:
|
157
|
-
body: Unele dintre
|
166
|
+
body: Unele dintre funcționalitățile acestui chestionar vor fi dezactivate. Pentru a îți îmbunătăți experiența, te rugăm să activezi JavaScript în browser-ul tău.
|
158
167
|
title: JavaScript este dezactivat
|
159
168
|
questionnaire_not_published:
|
160
|
-
body: Acest
|
161
|
-
tos_agreement: Prin participare
|
169
|
+
body: Acest chestionar nu este încă publicat.
|
170
|
+
tos_agreement: Prin participare accepți Termenii și condițiile sale de utilizare
|
162
171
|
step_navigation:
|
163
172
|
show:
|
164
|
-
are_you_sure: Această acțiune nu poate fi anulată și nu
|
173
|
+
are_you_sure: Această acțiune nu poate fi anulată și nu vei putea să îți editezi răspunsurile. Sigur dorești asta?
|
165
174
|
back: Înapoi
|
166
175
|
continue: Continuă
|
167
|
-
submit:
|
176
|
+
submit: Trimite
|
168
177
|
user_answers_serializer:
|
169
178
|
body: Răspuns
|
170
179
|
completion: Finalizare
|
171
|
-
created_at: Răspuns
|
180
|
+
created_at: Răspuns completat la
|
172
181
|
id: ID răspuns
|
173
|
-
ip_hash: Hash
|
182
|
+
ip_hash: IP Hash
|
174
183
|
question: Întrebare
|
175
184
|
registered: Înregistrat
|
176
185
|
session_token: Identificator utilizator
|
177
186
|
unregistered: Neînregistrat
|
178
|
-
user_status:
|
187
|
+
user_status: Stadiul utilizatorului
|
@@ -0,0 +1,18 @@
|
|
1
|
+
val:
|
2
|
+
decidim:
|
3
|
+
forms:
|
4
|
+
admin:
|
5
|
+
questionnaires:
|
6
|
+
form:
|
7
|
+
add_title_and_description: Afig títol i descripció
|
8
|
+
title_and_description:
|
9
|
+
collapse: Redueix
|
10
|
+
description: Descripció
|
11
|
+
down: Baixar
|
12
|
+
expand: Expandeix
|
13
|
+
remove: Elimina
|
14
|
+
title: Títol
|
15
|
+
title_and_description: Títol i descripció
|
16
|
+
up: Pujar
|
17
|
+
question_types:
|
18
|
+
title_and_description: Títol i descripció
|
data/lib/decidim/forms/engine.rb
CHANGED
@@ -11,6 +11,10 @@ module Decidim
|
|
11
11
|
initializer "decidim_forms.add_cells_view_paths" do
|
12
12
|
Cell::ViewModel.view_paths << File.expand_path("#{Decidim::Forms::Engine.root}/app/cells")
|
13
13
|
end
|
14
|
+
|
15
|
+
initializer "decidim_forms.webpacker.assets_path" do
|
16
|
+
Decidim.register_assets_path File.expand_path("app/packs", root)
|
17
|
+
end
|
14
18
|
end
|
15
19
|
end
|
16
20
|
end
|
@@ -123,6 +123,10 @@ FactoryBot.define do
|
|
123
123
|
trait :separator do
|
124
124
|
question_type { :separator }
|
125
125
|
end
|
126
|
+
|
127
|
+
trait :title_and_description do
|
128
|
+
question_type { :title_and_description }
|
129
|
+
end
|
126
130
|
end
|
127
131
|
|
128
132
|
factory :answer, class: "Decidim::Forms::Answer" do
|
@@ -144,6 +148,14 @@ FactoryBot.define do
|
|
144
148
|
question { create(:questionnaire_question) }
|
145
149
|
body { generate_localized_title }
|
146
150
|
free_text { false }
|
151
|
+
|
152
|
+
trait :free_text_enabled do
|
153
|
+
free_text { true }
|
154
|
+
end
|
155
|
+
|
156
|
+
trait :free_text_disabled do
|
157
|
+
free_text { false }
|
158
|
+
end
|
147
159
|
end
|
148
160
|
|
149
161
|
factory :answer_choice, class: "Decidim::Forms::AnswerChoice" do
|
@@ -69,6 +69,24 @@ shared_examples_for "manage questionnaire answers" do
|
|
69
69
|
expect(page).to have_content("User identifier")
|
70
70
|
end
|
71
71
|
end
|
72
|
+
|
73
|
+
context "when multiple answer choice" do
|
74
|
+
let(:first_type) { "multiple_option" }
|
75
|
+
let!(:answer1) { create :answer, questionnaire: questionnaire, question: first, body: nil }
|
76
|
+
let!(:answer_option) { create :answer_option, question: first }
|
77
|
+
let!(:answer_choice) { create :answer_choice, answer: answer1, answer_option: answer_option, body: translated(answer_option.body, locale: I18n.locale) }
|
78
|
+
|
79
|
+
before do
|
80
|
+
find_all("a.action-icon.action-icon--eye").first.click
|
81
|
+
end
|
82
|
+
|
83
|
+
it "shows the answers page with custom body" do
|
84
|
+
within "#answers" do
|
85
|
+
expect(page).to have_css("dt", text: translated(first.body))
|
86
|
+
expect(page).to have_css("li", text: translated(answer_option.body))
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
72
90
|
end
|
73
91
|
|
74
92
|
context "and managing individual answer page" do
|
@@ -4,20 +4,21 @@ require "spec_helper"
|
|
4
4
|
|
5
5
|
shared_examples_for "add questions" do
|
6
6
|
it "adds a few questions and separators to the questionnaire" do
|
7
|
-
|
7
|
+
fields_body = ["This is the first question", "This is the second question", "This is the first title and description"]
|
8
8
|
|
9
9
|
within "form.edit_questionnaire" do
|
10
10
|
click_button "Add question"
|
11
11
|
click_button "Add separator"
|
12
|
+
click_button "Add title and description"
|
12
13
|
click_button "Add question"
|
13
14
|
|
14
|
-
expect(page).to have_selector(".questionnaire-question", count:
|
15
|
+
expect(page).to have_selector(".questionnaire-question", count: 4)
|
15
16
|
|
16
17
|
expand_all_questions
|
17
18
|
|
18
|
-
page.all(".questionnaire-question .collapsible").each_with_index do |
|
19
|
-
within
|
20
|
-
fill_in find_nested_form_field_locator("body_en"), with:
|
19
|
+
page.all(".questionnaire-question .collapsible").each_with_index do |field, idx|
|
20
|
+
within field do
|
21
|
+
fill_in find_nested_form_field_locator("body_en"), with: fields_body[idx]
|
21
22
|
end
|
22
23
|
end
|
23
24
|
|
@@ -30,6 +31,7 @@ shared_examples_for "add questions" do
|
|
30
31
|
|
31
32
|
expect(page).to have_selector("input[value='This is the first question']")
|
32
33
|
expect(page).to have_selector("input[value='This is the second question']")
|
34
|
+
expect(page).to have_selector("input[value='This is the first title and description']")
|
33
35
|
expect(page).to have_content("Separator #2")
|
34
36
|
end
|
35
37
|
|
@@ -62,6 +64,35 @@ shared_examples_for "add questions" do
|
|
62
64
|
expect(page).to have_selector("strong", text: "Superkalifragilistic description")
|
63
65
|
end
|
64
66
|
|
67
|
+
it "adds a title-and-description" do
|
68
|
+
within "form.edit_questionnaire" do
|
69
|
+
click_button "Add title and description"
|
70
|
+
expand_all_questions
|
71
|
+
|
72
|
+
within ".questionnaire-question" do
|
73
|
+
fill_in find_nested_form_field_locator("body_en"), with: "Body"
|
74
|
+
|
75
|
+
fill_in_editor find_nested_form_field_locator("description_en", visible: false), with: "<strong>Superkalifragilistic description</strong>"
|
76
|
+
end
|
77
|
+
|
78
|
+
click_button "Save"
|
79
|
+
end
|
80
|
+
|
81
|
+
expect(page).to have_admin_callout("successfully")
|
82
|
+
|
83
|
+
component.update!(
|
84
|
+
step_settings: {
|
85
|
+
component.participatory_space.active_step.id => {
|
86
|
+
allow_answers: true
|
87
|
+
}
|
88
|
+
}
|
89
|
+
)
|
90
|
+
|
91
|
+
visit questionnaire_public_path
|
92
|
+
|
93
|
+
expect(page).to have_selector("strong", text: "Superkalifragilistic description")
|
94
|
+
end
|
95
|
+
|
65
96
|
it "adds a question with answer options" do
|
66
97
|
question_body = ["This is the first question", "This is the second question"]
|
67
98
|
answer_options_body = [
|