decidim-forms 0.27.10 → 0.28.0.rc4

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.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/app/cells/decidim/forms/answer_readonly/show.erb +1 -1
  4. data/app/cells/decidim/forms/matrix_readonly/show.erb +1 -1
  5. data/app/cells/decidim/forms/question_readonly/show.erb +8 -8
  6. data/app/cells/decidim/forms/question_readonly/title_and_description.erb +8 -0
  7. data/app/cells/decidim/forms/question_readonly_cell.rb +7 -0
  8. data/app/cells/decidim/forms/step_navigation/show.erb +13 -26
  9. data/app/cells/decidim/forms/step_navigation_cell.rb +7 -0
  10. data/app/commands/decidim/forms/answer_questionnaire.rb +31 -11
  11. data/app/controllers/decidim/forms/admin/concerns/has_questionnaire.rb +4 -4
  12. data/app/controllers/decidim/forms/admin/concerns/has_questionnaire_answers.rb +1 -1
  13. data/app/controllers/decidim/forms/concerns/has_questionnaire.rb +3 -3
  14. data/app/forms/decidim/forms/answer_form.rb +7 -3
  15. data/app/forms/decidim/forms/questionnaire_form.rb +1 -1
  16. data/app/helpers/decidim/forms/admin/application_helper.rb +1 -1
  17. data/app/helpers/decidim/forms/admin/concerns/has_questionnaire_answers_url_helper.rb +2 -2
  18. data/app/models/decidim/forms/answer.rb +1 -1
  19. data/app/models/decidim/forms/display_condition.rb +2 -2
  20. data/app/models/decidim/forms/question.rb +0 -4
  21. data/app/models/decidim/forms/questionnaire.rb +1 -1
  22. data/app/packs/entrypoints/decidim_forms.js +4 -0
  23. data/app/packs/src/decidim/forms/admin/collapsible_questions.js +12 -6
  24. data/app/packs/src/decidim/forms/admin/forms.js +7 -7
  25. data/app/packs/src/decidim/forms/display_conditions.component.js +3 -3
  26. data/app/packs/src/decidim/forms/forms.js +15 -9
  27. data/app/packs/src/decidim/forms/option_attached_inputs.component.js +1 -1
  28. data/app/packs/stylesheets/decidim/forms/forms.scss +82 -52
  29. data/app/packs/stylesheets/decidim/forms/questionnaire-answers-pdf.scss +13 -13
  30. data/app/presenters/decidim/forms/admin/questionnaire_participant_presenter.rb +2 -2
  31. data/app/presenters/decidim/forms/admin_log/questionnaire_presenter.rb +2 -2
  32. data/app/presenters/decidim/forms/answer_option_presenter.rb +1 -1
  33. data/app/queries/decidim/forms/questionnaire_participants.rb +1 -1
  34. data/app/views/decidim/forms/admin/questionnaires/_answer_option.html.erb +1 -1
  35. data/app/views/decidim/forms/admin/questionnaires/_answer_option_template.html.erb +1 -1
  36. data/app/views/decidim/forms/admin/questionnaires/_display_condition.html.erb +2 -2
  37. data/app/views/decidim/forms/admin/questionnaires/_display_condition_template.html.erb +1 -1
  38. data/app/views/decidim/forms/admin/questionnaires/_form.html.erb +52 -74
  39. data/app/views/decidim/forms/admin/questionnaires/_matrix_row.html.erb +1 -1
  40. data/app/views/decidim/forms/admin/questionnaires/_matrix_row_template.html.erb +1 -1
  41. data/app/views/decidim/forms/admin/questionnaires/_question.html.erb +147 -135
  42. data/app/views/decidim/forms/admin/questionnaires/_separator.html.erb +15 -13
  43. data/app/views/decidim/forms/admin/questionnaires/_title_and_description.html.erb +69 -63
  44. data/app/views/decidim/forms/admin/questionnaires/answers/export/_answer.html.erb +4 -4
  45. data/app/views/decidim/forms/admin/questionnaires/answers/export/pdf.html.erb +1 -1
  46. data/app/views/decidim/forms/admin/questionnaires/answers/index.html.erb +41 -45
  47. data/app/views/decidim/forms/admin/questionnaires/answers/show.html.erb +13 -18
  48. data/app/views/decidim/forms/admin/questionnaires/edit.html.erb +33 -6
  49. data/app/views/decidim/forms/questionnaires/_answer.html.erb +31 -27
  50. data/app/views/decidim/forms/questionnaires/_questionnaire.html.erb +78 -0
  51. data/app/views/decidim/forms/questionnaires/_questionnaire_readonly.html.erb +11 -0
  52. data/app/views/decidim/forms/questionnaires/answers/_files.html.erb +1 -1
  53. data/app/views/decidim/forms/questionnaires/answers/_long_answer.html.erb +3 -1
  54. data/app/views/decidim/forms/questionnaires/answers/_matrix_multiple.html.erb +44 -41
  55. data/app/views/decidim/forms/questionnaires/answers/_matrix_single.html.erb +44 -41
  56. data/app/views/decidim/forms/questionnaires/answers/_multiple_option.html.erb +7 -6
  57. data/app/views/decidim/forms/questionnaires/answers/_separator.html.erb +1 -1
  58. data/app/views/decidim/forms/questionnaires/answers/_short_answer.html.erb +3 -1
  59. data/app/views/decidim/forms/questionnaires/answers/_single_option.html.erb +13 -12
  60. data/app/views/decidim/forms/questionnaires/answers/_sorting.html.erb +9 -12
  61. data/app/views/decidim/forms/questionnaires/answers/_title_and_description.html.erb +1 -1
  62. data/app/views/decidim/forms/questionnaires/show.html.erb +35 -144
  63. data/config/initializers/wicked_pdf.rb +1 -1
  64. data/config/locales/ar.yml +0 -6
  65. data/config/locales/bg.yml +0 -177
  66. data/config/locales/ca.yml +7 -2
  67. data/config/locales/cs.yml +8 -3
  68. data/config/locales/de.yml +9 -4
  69. data/config/locales/el.yml +7 -2
  70. data/config/locales/en.yml +8 -3
  71. data/config/locales/es-MX.yml +7 -2
  72. data/config/locales/es-PY.yml +7 -2
  73. data/config/locales/es.yml +7 -2
  74. data/config/locales/eu.yml +8 -3
  75. data/config/locales/fi-plain.yml +7 -2
  76. data/config/locales/fi.yml +8 -3
  77. data/config/locales/fr-CA.yml +8 -3
  78. data/config/locales/fr.yml +8 -3
  79. data/config/locales/gl.yml +0 -4
  80. data/config/locales/hu.yml +3 -9
  81. data/config/locales/id-ID.yml +0 -4
  82. data/config/locales/it.yml +0 -6
  83. data/config/locales/ja.yml +6 -1
  84. data/config/locales/lb.yml +0 -6
  85. data/config/locales/lt.yml +7 -2
  86. data/config/locales/lv.yml +0 -6
  87. data/config/locales/nl.yml +0 -6
  88. data/config/locales/no.yml +0 -6
  89. data/config/locales/pl.yml +6 -8
  90. data/config/locales/pt-BR.yml +0 -25
  91. data/config/locales/pt.yml +0 -6
  92. data/config/locales/ro-RO.yml +19 -14
  93. data/config/locales/ru.yml +0 -3
  94. data/config/locales/sk.yml +0 -6
  95. data/config/locales/sv.yml +32 -43
  96. data/config/locales/tr-TR.yml +0 -6
  97. data/config/locales/zh-CN.yml +0 -6
  98. data/config/locales/zh-TW.yml +7 -2
  99. data/lib/decidim/forms/engine.rb +8 -0
  100. data/lib/decidim/forms/test/factories.rb +37 -51
  101. data/lib/decidim/forms/test/shared_examples/has_questionnaire.rb +129 -239
  102. data/lib/decidim/forms/test/shared_examples/manage_questionnaire_answers.rb +18 -18
  103. data/lib/decidim/forms/test/shared_examples/manage_questionnaires/add_display_conditions.rb +14 -14
  104. data/lib/decidim/forms/test/shared_examples/manage_questionnaires/add_questions.rb +60 -78
  105. data/lib/decidim/forms/test/shared_examples/manage_questionnaires/update_display_conditions.rb +6 -6
  106. data/lib/decidim/forms/test/shared_examples/manage_questionnaires/update_questions.rb +25 -25
  107. data/lib/decidim/forms/test/shared_examples/manage_questionnaires.rb +9 -9
  108. data/lib/decidim/forms/user_answers_serializer.rb +1 -1
  109. data/lib/decidim/forms/version.rb +1 -1
  110. metadata +23 -18
  111. data/app/packs/src/decidim/forms/autosortable_checkboxes.component.js +0 -83
  112. data/config/locales/he-IL.yml +0 -1
  113. data/decidim-forms.gemspec +0 -34
@@ -24,7 +24,7 @@ ro:
24
24
  missing: nu sunt completate
25
25
  too_many: sunt prea multe
26
26
  questionnaire:
27
- request_invalid: A apărut o eroare la procesarea cererii. Te rugăm să încerci din nou
27
+ request_invalid: A apărut o eroare la procesarea cererii. Te rugăm să încerci din nou.
28
28
  decidim:
29
29
  forms:
30
30
  admin:
@@ -39,12 +39,14 @@ ro:
39
39
  answer_option:
40
40
  answer_option: Opțiune de răspuns
41
41
  free_text: Text liber
42
- remove: Eliminați
42
+ remove: Elimină
43
43
  statement: Declarație
44
44
  answers:
45
45
  actions:
46
46
  back: Înapoi la răspunsuri
47
47
  export: Exportă
48
+ next: Următoarea ›
49
+ previous: "‹ Anterioara"
48
50
  show: Afişează răspunsurile
49
51
  empty: Niciun răspuns încă
50
52
  export:
@@ -53,7 +55,7 @@ ro:
53
55
  export_response:
54
56
  title: survey_user_answers_%{token}
55
57
  index:
56
- title: "%{total} răspunsuri în total"
58
+ title: "%{total} total răspunsuri"
57
59
  show:
58
60
  title: 'Răspuns #%{number}'
59
61
  display_condition:
@@ -71,21 +73,21 @@ ro:
71
73
  mandatory: Această condiție trebuie îndeplinită întotdeauna indiferent de stadiul altor condiții
72
74
  remove: Elimină
73
75
  save_warning: Ține minte să salvezi chestionarul înainte de configurarea condiţiilor de afişare
74
- select_answer_option: Selectați opțiunea de răspuns
76
+ select_answer_option: Selectează opțiunea de răspuns
75
77
  select_condition_question: Selectează o întrebare
76
- select_condition_type: Selectați un tip de condiție
78
+ select_condition_type: Selectează un tip de condiție
77
79
  edit:
78
80
  save: Salvează
79
- title: Editare chestionar
81
+ title: Editează chestionarul
80
82
  form:
81
83
  add_question: Adaugă întrebare
82
84
  add_separator: Adaugă separator
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
+ add_title_and_description: Adaugă titlu și descriere
86
+ 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.
85
87
  collapse: Restrânge toate întrebările
86
88
  expand: Extinde toate întrebările
87
89
  preview: Previzualizează
88
- title: Actualizați chestionarul pentru %{questionnaire_for}
90
+ title: Editează chestionarul pentru %{questionnaire_for}
89
91
  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
92
  matrix_row:
91
93
  matrix_row: Rând
@@ -95,14 +97,14 @@ ro:
95
97
  add_answer_option: Adaugă opțiune de răspuns
96
98
  add_display_condition: Adaugă condiție de afișare
97
99
  add_display_condition_info: Salvează formularul pentru a configura condițiile de afișare
98
- add_matrix_row: Adaugați rând
100
+ add_matrix_row: Adaugă rând
99
101
  any: Oricare
100
- collapse: Restrângeți
102
+ collapse: Restrânge
101
103
  description: Descriere
102
104
  down: Mergi în jos
103
- expand: Extindeți
105
+ expand: Extinde
104
106
  question: Întrebare
105
- remove: Eliminați
107
+ remove: Elimină
106
108
  statement: Declarație
107
109
  up: Mergi în sus
108
110
  separator:
@@ -154,7 +156,10 @@ ro:
154
156
  max_choices: 'Număr maxim de alegeri: %{n}'
155
157
  show:
156
158
  answer_questionnaire:
157
- 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.
159
+ already_have_an_account?: Ai deja un cont?
160
+ are_you_new?: Utilizator nou?
161
+ sign_in_description: Autentifică-te pentru a participa la sondaj
162
+ sign_up_description: Creați un cont de participant pentru a participa la sondaj
158
163
  title: Completează chestionarul
159
164
  current_step: Pasul %{step}
160
165
  of_total_steps: din %{total_steps}
@@ -27,9 +27,6 @@ ru:
27
27
  up: Вверх
28
28
  update:
29
29
  invalid: При попытке сохранить форму произошли ошибки.
30
- errors:
31
- answer:
32
- body: Основной текст не может быть пустым
33
30
  question_types:
34
31
  long_answer: Длинный ответ
35
32
  multiple_option: Несколько вариантов
@@ -16,8 +16,6 @@ sk:
16
16
  choices:
17
17
  missing: nie je kompletné
18
18
  too_many: je príliš veľa
19
- questionnaire:
20
- request_invalid: Počas požiadavku sa vyskytla chyba, skúste to znova.
21
19
  decidim:
22
20
  forms:
23
21
  admin:
@@ -50,9 +48,6 @@ sk:
50
48
  up: Hore
51
49
  update:
52
50
  invalid: Vyskytol sa problém s ukladaním formulára.
53
- errors:
54
- answer:
55
- body: Telo nemôže byť prázdne
56
51
  question_types:
57
52
  long_answer: Dlhá odpoveď
58
53
  multiple_option: Viacero možností
@@ -67,7 +62,6 @@ sk:
67
62
  max_choices: 'Maximum možností: %{n}'
68
63
  show:
69
64
  answer_questionnaire:
70
- anonymous_user_message: <a href="%{sign_in_link}">Prihláste sa so svojím účtom</a> alebo <a href="%{sign_up_link}"> sa zaregistrujte</a>, aby ste mohli odpovedať.
71
65
  title: Odpovedať na formulár
72
66
  questionnaire_answered:
73
67
  body: Na tento formulár už ste dopovedali.
@@ -4,14 +4,14 @@ sv:
4
4
  attributes:
5
5
  answer:
6
6
  body: Svar
7
- choices: Alternativ
8
- selected_choices: Valda alternativ
7
+ choices: Val
8
+ selected_choices: Utvalda val
9
9
  question:
10
- max_choices: Högst antal alternativ
10
+ max_choices: Högst antal val
11
11
  question_type: Typ
12
12
  questionnaire_question:
13
- mandatory: Obligatoriskt
14
- max_characters: Teckengräns (skriv 0 för obegränsad)
13
+ mandatory: Obligatorisk
14
+ max_characters: Teckengräns (lämna till 0 om ingen gräns)
15
15
  errors:
16
16
  models:
17
17
  answer:
@@ -23,8 +23,6 @@ sv:
23
23
  choices:
24
24
  missing: är inte fullständiga
25
25
  too_many: är för många
26
- questionnaire:
27
- request_invalid: Ett fel uppstod när begäran skulle hanteras. Försök igen
28
26
  decidim:
29
27
  forms:
30
28
  admin:
@@ -45,13 +43,15 @@ sv:
45
43
  actions:
46
44
  back: Tillbaka till svar
47
45
  export: Exportera
46
+ next: Nästa &rsaquo;
47
+ previous: "&lsaquo; Föregående"
48
48
  show: Visa svar
49
49
  empty: Inga svar ännu
50
50
  export:
51
51
  answer:
52
52
  title: 'Svar #%{number}'
53
53
  export_response:
54
- title: survey_user_answers_%{token}
54
+ title: Undersökning_användare_svar_%{token}
55
55
  index:
56
56
  title: "%{total} svar totalt"
57
57
  show:
@@ -59,34 +59,34 @@ sv:
59
59
  display_condition:
60
60
  answer_option: Svarsalternativ
61
61
  condition_question: Fråga
62
- condition_type: Villkor
62
+ condition_type: Skick
63
63
  condition_types:
64
64
  answered: Besvarad
65
- equal: Lika med
66
- match: Innehåller text
65
+ equal: Lika
66
+ match: Inkluderar text
67
67
  not_answered: Ej besvarad
68
- not_equal: Ej lika med
69
- condition_value: Innehåller text
68
+ not_equal: Inte lika
69
+ condition_value: Inkluderad text
70
70
  display_condition: Visa villkor
71
- mandatory: Detta villkor måste alltid uppfyllas, oavsett status för andra villkor
71
+ mandatory: Detta villkor måste uppfyllas alltid oavsett status för andra villkor
72
72
  remove: Radera
73
73
  save_warning: Kom ihåg att spara formuläret innan du konfigurerar visningsvillkor
74
74
  select_answer_option: Välj svarsalternativ
75
75
  select_condition_question: Välj en fråga
76
- select_condition_type: Välj en typ av villkor
76
+ select_condition_type: Välj en villkorstyp
77
77
  edit:
78
78
  save: Spara
79
- title: Redigera enkät
79
+ title: Redigera frågeformulär
80
80
  form:
81
81
  add_question: Lägg till fråga
82
- add_separator: Lägg till avgränsare
82
+ add_separator: Lägg till separator
83
83
  add_title_and_description: Lägg till titel och beskrivning
84
- already_answered_warning: Frågeformuläret har redan besvarats av användare och du kan inte längre ändra frågorna.
85
- collapse: Dölj alla frågor
86
- expand: Visa alla frågor
84
+ already_answered_warning: Frågeformuläret har redan besvarats av vissa användare du inte kan ändra dess frågor.
85
+ collapse: Komprimera alla frågor
86
+ expand: Expandera alla frågor
87
87
  preview: Förhandsgranska
88
88
  title: Redigera formulär för %{questionnaire_for}
89
- unpublished_warning: Formuläret har inte publicerats. Du kan ändra frågorna, men det kommer att göra att befintliga svar raderas.
89
+ unpublished_warning: Formuläret är inte publicerat. Du kan ändra dess frågor, men det kommer att ta bort aktuella svar.
90
90
  matrix_row:
91
91
  matrix_row: Rad
92
92
  remove: Ta bort
@@ -97,10 +97,10 @@ sv:
97
97
  add_display_condition_info: Spara formuläret för att konfigurera visningsvillkor
98
98
  add_matrix_row: Lägg till rad
99
99
  any: Någon
100
- collapse: Dölj
100
+ collapse: Komprimera
101
101
  description: Beskrivning
102
102
  down: Ned
103
- expand: Visa
103
+ expand: Expandera
104
104
  question: Fråga
105
105
  remove: Ta bort
106
106
  statement: Påstående
@@ -111,50 +111,39 @@ sv:
111
111
  separator: Avgränsare
112
112
  up: Upp
113
113
  title_and_description:
114
- collapse: Dölj
114
+ collapse: Kollapsa
115
115
  description: Beskrivning
116
116
  down: Ner
117
- expand: Visa
118
- remove: Radera
117
+ expand: Expandera
118
+ remove: Ta bort
119
119
  title: Titel
120
120
  title_and_description: Titel och beskrivning
121
121
  up: Upp
122
122
  update:
123
123
  invalid: Det gick inte att spara formuläret.
124
124
  success: Formuläret har sparats.
125
- admin_log:
126
- questionnaire:
127
- update: "%{user_name} uppdaterade enkäten %{resource_name}"
128
- errors:
129
- answer:
130
- body: Kroppen kan inte vara to
131
125
  images:
132
126
  dimensions: "%{width} x %{height} px"
133
- processors:
134
- resize_and_pad: Bilden skalas om till %{dimensions}.
135
- resize_to_fit: Bilden skalas om till %{dimensions}.
136
127
  question_types:
137
128
  files: Filer
138
129
  long_answer: Långt svar
139
130
  matrix_multiple: Matris (flera alternativ)
140
- matrix_single: Matris (ett alternativ)
131
+ matrix_single: Matris (Single alternativ)
141
132
  multiple_option: Flera alternativ
142
133
  short_answer: Kort svar
143
134
  single_option: Ett alternativ
144
135
  sorting: Sortering
145
136
  title_and_description: Titel och beskrivning
146
- questionnaire_answer_presenter:
147
- download_attachment: Ladda ner bilaga
148
137
  questionnaires:
149
138
  answer:
150
139
  invalid: Det gick inte att besvara formuläret.
151
- max_choices_alert: För många alternativ har valts
140
+ max_choices_alert: Det finns för många val valda
152
141
  success: Formuläret har besvarats.
153
142
  question:
154
143
  max_choices: 'Högst antal val: %{n}'
155
144
  show:
156
145
  answer_questionnaire:
157
- anonymous_user_message: <a href="%{sign_in_link}">Logga in med ditt konto</a> eller <a href="%{sign_up_link}">registrera dig</a> om du vill svara på formuläret.
146
+ are_you_new?: Ny användare?
158
147
  title: Besvara formuläret
159
148
  current_step: Steg %{step}
160
149
  of_total_steps: av %{total_steps}
@@ -168,10 +157,10 @@ sv:
168
157
  body: Formuläret är endast tillgängligt för privata användare
169
158
  title: Formuläret är stängt
170
159
  questionnaire_js_disabled:
171
- body: Vissa av formulärets funktioner kommer att inaktiveras. Aktivera JavaScript i webbläsaren för att förbättra upplevelsen.
160
+ body: Vissa av formulärens funktioner kommer att inaktiveras. För att förbättra din upplevelse, vänligen aktivera JavaScript i din webbläsare.
172
161
  title: JavaScript är inaktiverat
173
162
  questionnaire_not_published:
174
- body: Formulär är ännu inte publicerat.
163
+ body: Detta formulär är ännu inte publicerat.
175
164
  tos_agreement: Genom att delta godkänner du användarvillkoren
176
165
  step_navigation:
177
166
  show:
@@ -181,7 +170,7 @@ sv:
181
170
  submit: Skicka in
182
171
  user_answers_serializer:
183
172
  body: Svar
184
- completion: Slutfört
173
+ completion: Slutförande
185
174
  created_at: Besvarad
186
175
  id: Svars-ID
187
176
  ip_hash: IP Hash
@@ -18,8 +18,6 @@ tr:
18
18
  choices:
19
19
  missing: tamamlanmadı
20
20
  too_many: çok fazla
21
- questionnaire:
22
- request_invalid: İsteği işlerken bir hata oluştu. Lütfen tekrar deneyin
23
21
  decidim:
24
22
  forms:
25
23
  admin:
@@ -107,9 +105,6 @@ tr:
107
105
  update:
108
106
  invalid: Formu kaydederken bir sorun oluştu.
109
107
  success: Başarıyla kaydedildi.
110
- errors:
111
- answer:
112
- body: Vücut boş olamaz
113
108
  images:
114
109
  dimensions: "%{width} x %{height} px"
115
110
  question_types:
@@ -129,7 +124,6 @@ tr:
129
124
  max_choices: 'Maksimum seçenek: %{n}'
130
125
  show:
131
126
  answer_questionnaire:
132
- anonymous_user_message: <a href="%{sign_in_link}">Formu yanıtlamak için</a> veya <a href="%{sign_up_link}">hesabınızla giriş yapın</a>.
133
127
  title: Formu cevapla
134
128
  current_step: '%{step} adım'
135
129
  of_total_steps: '%{total_steps}'
@@ -18,8 +18,6 @@ zh-CN:
18
18
  choices:
19
19
  missing: 不完成
20
20
  too_many: 太多了
21
- questionnaire:
22
- request_invalid: 处理请求时出错。请再试一次
23
21
  decidim:
24
22
  forms:
25
23
  admin:
@@ -106,9 +104,6 @@ zh-CN:
106
104
  update:
107
105
  invalid: 保存表单时出错。
108
106
  success: 表单保存成功。
109
- errors:
110
- answer:
111
- body: 主体不能为空
112
107
  images:
113
108
  dimensions: "%{width} x %{height} px"
114
109
  question_types:
@@ -128,7 +123,6 @@ zh-CN:
128
123
  max_choices: '最大选择数: %{n}'
129
124
  show:
130
125
  answer_questionnaire:
131
- anonymous_user_message: <a href="%{sign_in_link}">使用您的帐户</a> 或 <a href="%{sign_up_link}">注册</a> 以回答表单。
132
126
  title: 回答表单
133
127
  current_step: 步骤 %{step}
134
128
  of_total_steps: '%{total_steps}'
@@ -24,7 +24,7 @@ zh-TW:
24
24
  missing: 尚未完成
25
25
  too_many: 太多了
26
26
  questionnaire:
27
- request_invalid: 處理請求時發生錯誤,請再試一次
27
+ request_invalid: 處理請求時發生錯誤。請再試一次。
28
28
  decidim:
29
29
  forms:
30
30
  admin:
@@ -45,6 +45,8 @@ zh-TW:
45
45
  actions:
46
46
  back: 返回回覆
47
47
  export: 匯出
48
+ next: 下一個 &rsaquo;
49
+ previous: "&lsaquo; 上一篇"
48
50
  show: 顯示答案
49
51
  empty: 目前尚未回答
50
52
  export:
@@ -154,7 +156,10 @@ zh-TW:
154
156
  max_choices: '最多選擇數量: %{n}'
155
157
  show:
156
158
  answer_questionnaire:
157
- anonymous_user_message: <a href="%{sign_in_link}">使用現有帳號登入</a> 或 <a href="%{sign_up_link}">註冊新帳戶</a> 以回答此表單。
159
+ already_have_an_account?: 已經有帳號了嗎?
160
+ are_you_new?: 新用戶?
161
+ sign_in_description: 登入以填寫問卷
162
+ sign_up_description: 建立參與者帳號以填寫問卷
158
163
  title: 回答表單
159
164
  current_step: 步驟%{step}
160
165
  of_total_steps: 的%{total_steps}
@@ -15,6 +15,14 @@ module Decidim
15
15
  initializer "decidim_forms.webpacker.assets_path" do
16
16
  Decidim.register_assets_path File.expand_path("app/packs", root)
17
17
  end
18
+
19
+ initializer "decidim_forms.authorization_transfer" do
20
+ config.to_prepare do
21
+ Decidim::AuthorizationTransfer.register(:forms) do |transfer|
22
+ transfer.move_records(Decidim::Forms::Answer, :decidim_user_id)
23
+ end
24
+ end
25
+ end
18
26
  end
19
27
  end
20
28
  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
- transient do
9
- skip_injection { false }
8
+ title { generate_localized_title }
9
+ description do
10
+ Decidim::Faker::Localized.wrapped("<p>", "</p>") do
11
+ generate_localized_title
12
+ end
10
13
  end
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) }
14
+ tos { generate_localized_title }
15
+ questionnaire_for { build(:participatory_process) }
15
16
  salt { SecureRandom.hex(32) }
16
17
 
17
18
  trait :with_questions do
18
19
  questions do
19
20
  position = 0
20
21
  qs = %w(short_answer long_answer).collect do |text_question_type|
21
- q = build(:questionnaire_question, question_type: text_question_type, position: position, skip_injection: skip_injection)
22
+ q = build(:questionnaire_question, question_type: text_question_type, position:)
22
23
  position += 1
23
24
  q
24
25
  end
25
- qs << build(:questionnaire_question, :with_answer_options, question_type: :single_option, position: position, skip_injection: skip_injection)
26
+ qs << build(:questionnaire_question, :with_answer_options, question_type: :single_option, position:)
26
27
  qs
27
28
  end
28
29
  end
29
30
 
30
31
  trait :with_all_questions do
31
- after(:build) do |questionaire, evaluator|
32
+ after(:build) do |questionaire, _evaluator|
32
33
  position = 0
33
34
  %w(short_answer long_answer).collect do |text_question_type|
34
35
  q = create(:questionnaire_question,
35
36
  question_type: text_question_type,
36
- position: position,
37
- questionnaire: questionaire,
38
- skip_injection: evaluator.skip_injection)
37
+ position:,
38
+ questionnaire: questionaire)
39
39
  position += 1
40
40
  questionaire.questions << q
41
41
  end
@@ -43,9 +43,8 @@ FactoryBot.define do
43
43
  %w(single_option multiple_option).each do |option_question_type|
44
44
  q = create(:questionnaire_question, :with_answer_options,
45
45
  question_type: option_question_type,
46
- position: position,
47
- questionnaire: questionaire,
48
- skip_injection: evaluator.skip_injection)
46
+ position:,
47
+ questionnaire: questionaire)
49
48
  q.display_conditions.build(
50
49
  condition_question: questionaire.questions[q.position - 1],
51
50
  question: q,
@@ -59,10 +58,9 @@ FactoryBot.define do
59
58
  %w(matrix_single matrix_multiple).collect do |matrix_question_type|
60
59
  q = build(:questionnaire_question, :with_answer_options,
61
60
  question_type: matrix_question_type,
62
- position: position,
61
+ position:,
63
62
  body: generate_localized_title,
64
- questionnaire: questionaire,
65
- skip_injection: evaluator.skip_injection)
63
+ questionnaire: questionaire)
66
64
  q.display_conditions.build(
67
65
  condition_question: questionaire.questions[q.position - 1],
68
66
  question: q,
@@ -84,13 +82,16 @@ FactoryBot.define do
84
82
 
85
83
  factory :questionnaire_question, class: "Decidim::Forms::Question" do
86
84
  transient do
87
- skip_injection { false }
88
85
  options { [] }
89
86
  rows { [] }
90
87
  end
91
88
 
92
- body { generate_localized_title(:questionnaire_question_body, skip_injection: skip_injection) }
93
- description { generate_localized_description(:questionnaire_question_description, skip_injection: skip_injection) }
89
+ body { generate_localized_title }
90
+ description do
91
+ Decidim::Faker::Localized.wrapped("<p>", "</p>") do
92
+ generate_localized_title
93
+ end
94
+ end
94
95
  mandatory { false }
95
96
  position { 0 }
96
97
  question_type { Decidim::Forms::Question::TYPES.first }
@@ -118,13 +119,13 @@ FactoryBot.define do
118
119
 
119
120
  trait :with_answer_options do
120
121
  answer_options do
121
- Array.new(3).collect { build(:answer_option, skip_injection: skip_injection) }
122
+ Array.new(3).collect { build(:answer_option) }
122
123
  end
123
124
  end
124
125
 
125
126
  trait :conditioned do
126
127
  display_conditions do
127
- Array.new(3).collect { build(:display_condition, skip_injection: skip_injection) }
128
+ Array.new(3).collect { build(:display_condition) }
128
129
  end
129
130
  end
130
131
 
@@ -138,28 +139,22 @@ FactoryBot.define do
138
139
  end
139
140
 
140
141
  factory :answer, class: "Decidim::Forms::Answer" do
141
- transient do
142
- skip_injection { false }
143
- end
144
142
  body { "hola" }
145
143
  questionnaire
146
- question { create(:questionnaire_question, questionnaire: questionnaire, skip_injection: skip_injection) }
147
- user { create(:user, organization: questionnaire.questionnaire_for.organization, skip_injection: skip_injection) }
144
+ question { create(:questionnaire_question, questionnaire:) }
145
+ user { create(:user, organization: questionnaire.questionnaire_for.organization) }
148
146
  session_token { Digest::MD5.hexdigest(user.id.to_s) }
149
147
 
150
148
  trait :with_attachments do
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
149
+ after(:create) do |answer, _evaluator|
150
+ create :attachment, :with_image, attached_to: answer
151
+ create :attachment, :with_pdf, attached_to: answer
154
152
  end
155
153
  end
156
154
  end
157
155
 
158
156
  factory :answer_option, class: "Decidim::Forms::AnswerOption" do
159
- transient do
160
- skip_injection { false }
161
- end
162
- question { create(:questionnaire_question, skip_injection: skip_injection) }
157
+ question { create(:questionnaire_question) }
163
158
  body { generate_localized_title }
164
159
  free_text { false }
165
160
 
@@ -173,40 +168,31 @@ FactoryBot.define do
173
168
  end
174
169
 
175
170
  factory :answer_choice, class: "Decidim::Forms::AnswerChoice" do
176
- transient do
177
- skip_injection { false }
178
- end
179
171
  answer
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) }
172
+ answer_option { create(:answer_option, question: answer.question) }
173
+ matrix_row { create(:question_matrix_row, question: answer.question) }
182
174
  end
183
175
 
184
176
  factory :question_matrix_row, class: "Decidim::Forms::QuestionMatrixRow" do
185
- transient do
186
- skip_injection { false }
187
- end
188
- question { create(:questionnaire_question, skip_injection: skip_injection) }
177
+ question { create(:questionnaire_question) }
189
178
  body { generate_localized_title }
190
179
  position { 0 }
191
180
  end
192
181
 
193
182
  factory :display_condition, class: "Decidim::Forms::DisplayCondition" do
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) }
183
+ condition_question { create(:questionnaire_question) }
184
+ question { create(:questionnaire_question, position: 1) }
199
185
  condition_type { :answered }
200
186
  mandatory { true }
201
187
 
202
188
  trait :equal do
203
189
  condition_type { :equal }
204
- answer_option { create(:answer_option, question: condition_question, skip_injection: skip_injection) }
190
+ answer_option { create(:answer_option, question: condition_question) }
205
191
  end
206
192
 
207
193
  trait :match do
208
194
  condition_type { :match }
209
- condition_value { generate_localized_title(:condition_value, skip_injection: skip_injection) }
195
+ condition_value { generate_localized_title }
210
196
  end
211
197
  end
212
198
  end