decidim-forms 0.29.4 → 0.30.0.rc1

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 (106) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/forms/step_navigation_cell.rb +18 -5
  3. data/app/commands/decidim/forms/admin/update_questionnaire.rb +1 -82
  4. data/app/commands/decidim/forms/admin/update_questions.rb +109 -0
  5. data/app/commands/decidim/forms/answer_questionnaire.rb +10 -3
  6. data/app/controllers/decidim/forms/admin/concerns/has_questionnaire.rb +39 -3
  7. data/app/controllers/decidim/forms/admin/concerns/has_questionnaire_answers.rb +2 -2
  8. data/app/controllers/decidim/forms/concerns/has_questionnaire.rb +12 -4
  9. data/app/forms/decidim/forms/admin/display_condition_form.rb +1 -1
  10. data/app/forms/decidim/forms/admin/questionnaire_form.rb +0 -9
  11. data/app/forms/decidim/forms/admin/questions_form.rb +18 -0
  12. data/app/forms/decidim/forms/answer_choice_form.rb +5 -0
  13. data/app/forms/decidim/forms/answer_form.rb +1 -0
  14. data/app/forms/decidim/forms/questionnaire_form.rb +7 -0
  15. data/app/helpers/decidim/forms/admin/concerns/has_questionnaire_answers_pagination_helper.rb +1 -1
  16. data/app/helpers/decidim/forms/admin/concerns/has_questionnaire_answers_url_helper.rb +5 -5
  17. data/app/jobs/decidim/forms/export_questionnaire_answers_job.rb +5 -1
  18. data/app/models/decidim/forms/answer_choice.rb +0 -2
  19. data/app/models/decidim/forms/answer_option.rb +1 -1
  20. data/app/models/decidim/forms/question.rb +10 -0
  21. data/app/packs/entrypoints/decidim_forms.js +0 -1
  22. data/app/packs/entrypoints/decidim_forms_admin.js +6 -0
  23. data/app/packs/src/decidim/forms/admin/publish_answers_buttons.js +72 -0
  24. data/app/packs/src/decidim/forms/forms.js +22 -18
  25. data/app/presenters/decidim/forms/admin/questionnaire_participant_presenter.rb +1 -1
  26. data/app/presenters/decidim/forms/admin_log/question_presenter.rb +31 -0
  27. data/app/queries/decidim/forms/questionnaire_user_answers.rb +1 -1
  28. data/app/views/decidim/forms/admin/questionnaires/_answer_option_template.html.erb +1 -1
  29. data/app/views/decidim/forms/admin/questionnaires/_display_condition_template.html.erb +1 -1
  30. data/app/views/decidim/forms/admin/questionnaires/_form.html.erb +0 -89
  31. data/app/views/decidim/forms/admin/questionnaires/_matrix_row_template.html.erb +1 -1
  32. data/app/views/decidim/forms/admin/questionnaires/_question.html.erb +3 -3
  33. data/app/views/decidim/forms/admin/questionnaires/_questions_form.html.erb +80 -0
  34. data/app/views/decidim/forms/admin/questionnaires/edit.html.erb +0 -20
  35. data/app/views/decidim/forms/admin/questionnaires/edit_questions.html.erb +47 -0
  36. data/app/views/decidim/forms/questionnaires/_questionnaire.html.erb +8 -1
  37. data/app/views/decidim/forms/questionnaires/answers/_files.html.erb +1 -1
  38. data/app/views/decidim/forms/questionnaires/answers/_sorting.html.erb +12 -6
  39. data/app/views/decidim/forms/questionnaires/edit.html.erb +47 -0
  40. data/app/views/decidim/forms/questionnaires/show.html.erb +13 -2
  41. data/config/assets.rb +1 -2
  42. data/config/locales/ar.yml +16 -1
  43. data/config/locales/bg.yml +36 -2
  44. data/config/locales/ca.yml +53 -13
  45. data/config/locales/cs.yml +48 -8
  46. data/config/locales/de.yml +52 -12
  47. data/config/locales/el.yml +35 -2
  48. data/config/locales/en.yml +45 -5
  49. data/config/locales/es-MX.yml +55 -15
  50. data/config/locales/es-PY.yml +55 -15
  51. data/config/locales/es.yml +54 -14
  52. data/config/locales/eu.yml +51 -11
  53. data/config/locales/fi-plain.yml +50 -10
  54. data/config/locales/fi.yml +50 -10
  55. data/config/locales/fr-CA.yml +45 -13
  56. data/config/locales/fr.yml +45 -13
  57. data/config/locales/ga-IE.yml +5 -0
  58. data/config/locales/gl.yml +7 -1
  59. data/config/locales/hu.yml +10 -1
  60. data/config/locales/id-ID.yml +7 -1
  61. data/config/locales/it.yml +27 -3
  62. data/config/locales/ja.yml +7 -12
  63. data/config/locales/lb.yml +28 -1
  64. data/config/locales/lt.yml +35 -2
  65. data/config/locales/lv.yml +11 -1
  66. data/config/locales/nl.yml +23 -0
  67. data/config/locales/no.yml +27 -0
  68. data/config/locales/pl.yml +37 -2
  69. data/config/locales/pt-BR.yml +29 -0
  70. data/config/locales/pt.yml +27 -0
  71. data/config/locales/ro-RO.yml +44 -17
  72. data/config/locales/ru.yml +1 -2
  73. data/config/locales/sk.yml +10 -1
  74. data/config/locales/sl.yml +7 -0
  75. data/config/locales/sv.yml +12 -16
  76. data/config/locales/tr-TR.yml +23 -0
  77. data/config/locales/zh-CN.yml +23 -0
  78. data/config/locales/zh-TW.yml +35 -2
  79. data/db/migrate/20190315203056_add_session_token_to_decidim_forms_answers.rb +1 -1
  80. data/db/migrate/20241122142230_add_survey_answers_published_at_to_questions.rb +7 -0
  81. data/decidim-forms.gemspec +1 -2
  82. data/lib/decidim/api/answer_option_type.rb +1 -1
  83. data/lib/decidim/api/question_type.rb +4 -4
  84. data/lib/decidim/api/questionnaire_type.rb +4 -4
  85. data/lib/decidim/exporters/form_pdf.rb +114 -11
  86. data/lib/decidim/forms/download_your_data_user_answers_serializer.rb +0 -4
  87. data/lib/decidim/forms/test/factories.rb +2 -2
  88. data/lib/decidim/forms/test/shared_examples/has_questionnaire.rb +44 -4
  89. data/lib/decidim/forms/test/shared_examples/manage_questionnaire_answers.rb +17 -17
  90. data/lib/decidim/forms/test/shared_examples/manage_questionnaires/add_display_conditions.rb +19 -21
  91. data/lib/decidim/forms/test/shared_examples/manage_questionnaires/add_questions.rb +70 -94
  92. data/lib/decidim/forms/test/shared_examples/manage_questionnaires/update_display_conditions.rb +15 -18
  93. data/lib/decidim/forms/test/shared_examples/manage_questionnaires/update_questions.rb +90 -125
  94. data/lib/decidim/forms/test/shared_examples/manage_questionnaires.rb +4 -25
  95. data/lib/decidim/forms/version.rb +1 -1
  96. data/lib/decidim/forms.rb +0 -1
  97. metadata +18 -33
  98. data/app/packs/entrypoints/decidim_questionnaire_answers_pdf.js +0 -1
  99. data/app/packs/entrypoints/decidim_questionnaire_answers_pdf.scss +0 -1
  100. data/app/packs/stylesheets/decidim/forms/questionnaire-answers-pdf.scss +0 -69
  101. data/app/views/decidim/forms/admin/questionnaires/answers/export/_answer.html.erb +0 -31
  102. data/app/views/decidim/forms/admin/questionnaires/answers/export/pdf.html.erb +0 -13
  103. data/app/views/layouts/decidim/forms/admin/questionnaires/questionnaire_answers.html.erb +0 -12
  104. data/config/initializers/wicked_pdf.rb +0 -26
  105. data/config/locales/ca-IT.yml +0 -198
  106. data/lib/decidim/exporters/form_pdf_controller_helper.rb +0 -13
@@ -1,69 +0,0 @@
1
- .questionnaire-answers {
2
- .header {
3
- h1 {
4
- margin: 0;
5
- padding: 25px;
6
- background: rgb(59, 69, 87);
7
- color: white;
8
- border-radius: 4px 4px 0 0;
9
- }
10
-
11
- .description {
12
- margin: 0;
13
- padding: 25px;
14
- background: #f6f6f6;
15
- color: #202751;
16
- border-radius: 0 0 4px 4px;
17
- }
18
- }
19
-
20
- .answer {
21
- margin-top: 25px;
22
- background: #f6f6f6;
23
- border-radius: 0 0 4px 4px;
24
-
25
- .title {
26
- page-break-inside: avoid;
27
- border-radius: 4px 4px 0 0;
28
- padding: 10px 25px;
29
- background: rgb(59, 69, 87);
30
- color: white;
31
- }
32
-
33
- .participant-info {
34
- margin-top: 0;
35
- padding: 10px 25px;
36
- width: 100%;
37
- text-align: center;
38
- background: #eee;
39
- color: #202751;
40
- page-break-inside: avoid;
41
-
42
- th:first-child {
43
- text-align: left;
44
- }
45
-
46
- td:first-child {
47
- text-align: left;
48
- }
49
-
50
- th:last-child {
51
- text-align: right;
52
- }
53
-
54
- td:last-child {
55
- text-align: right;
56
- }
57
- }
58
-
59
- .answers {
60
- padding: 25px;
61
-
62
- .question {
63
- page-break-inside: avoid;
64
- font-size: inherit;
65
- color: #202751;
66
- }
67
- }
68
- }
69
- }
@@ -1,31 +0,0 @@
1
- <div class="answer">
2
- <h2 class="title"><%= t(".title", number: participant_counter + 1) %></h2>
3
-
4
- <table class="participant-info">
5
- <thead>
6
- <tr>
7
- <th class='token'><%= t("session_token", scope: "decidim.forms.user_answers_serializer") %></th>
8
- <th><%= t("user_status", scope: "decidim.forms.user_answers_serializer") %></th>
9
- <th><%= t("ip_hash", scope: "decidim.forms.user_answers_serializer") %></th>
10
- <th><%= t("completion", scope: "decidim.forms.user_answers_serializer") %></th>
11
- <th><%= t("created_at", scope: "decidim.forms.user_answers_serializer") %></th>
12
- </tr>
13
- </thead>
14
- <tbody>
15
- <tr>
16
- <td><%= participant.session_token %></td>
17
- <td><%= participant.status %></td>
18
- <td><%= participant.ip_hash %></td>
19
- <td><%= display_percentage(participant.completion) %></td>
20
- <td><%= l participant.answered_at, format: :short %></td>
21
- </tr>
22
- </tbody>
23
- </table>
24
-
25
- <div class="answers">
26
- <% participant.answers.each do |answer| %>
27
- <h3 class="question"><%= answer.question %></h3>
28
- <p><%= answer.body %></p>
29
- <% end %>
30
- </div>
31
- </div>
@@ -1,13 +0,0 @@
1
- <div class="questionnaire-answers">
2
- <div class="header">
3
- <h1><%= translated_attribute(questionnaire.title) %></h1>
4
- <div class="description">
5
- <%== translated_attribute(questionnaire.description).html_safe %>
6
- </div>
7
- <% if collection.count > 1 %>
8
- <h2><%= t("title", scope: "decidim.forms.admin.questionnaires.answers.index", total: collection.count) %></h2>
9
- <% end %>
10
- </div>
11
-
12
- <%= render partial: "decidim/forms/admin/questionnaires/answers/export/answer", collection:, locals: { questionnaire: }, as: :participant %>
13
- </div>
@@ -1,12 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="<%= I18n.locale %>" class="no-js">
3
- <head>
4
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
- <meta name="viewport" content="width=device-width">
6
- <%= wicked_pdf_stylesheet_pack_tag "decidim_questionnaire_answers_pdf" %>
7
- <title><%= @title %></title>
8
- </head>
9
- <body>
10
- <%= yield %>
11
- </body>
12
- </html>
@@ -1,26 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "wicked_pdf"
4
-
5
- # frozen_string_literal: true
6
-
7
- # WickedPDF Global Configuration
8
- #
9
- # Use this to set up shared configuration options for your entire application.
10
- # Any of the configuration options shown here can also be applied to single
11
- # models by passing arguments to the `render :pdf` call.
12
- #
13
- # To learn more, check out the README:
14
- #
15
- # https://github.com/mileszs/wicked_pdf/blob/master/README.md
16
-
17
- WickedPdf.configure do |config|
18
- # Path to the wkhtmltopdf executable: This usually is not needed if using
19
- # one of the wkhtmltopdf-binary family of gems.
20
- # or
21
- # config.exe_path = '/usr/local/bin/wkhtmltopdf',
22
-
23
- # Layout file to be used for all PDFs
24
- # (but can be overridden in `render :pdf` calls)
25
- # config.layout = 'pdf.html'
26
- end
@@ -1,198 +0,0 @@
1
- ---
2
- ca-IT:
3
- activemodel:
4
- attributes:
5
- answer:
6
- body: Resposta
7
- choices: Opcions
8
- selected_choices: Opcions seleccionades
9
- question:
10
- max_choices: Nombre màxim d'opcions
11
- question_type: Tipus
12
- questionnaire_question:
13
- mandatory: Obligatori
14
- max_characters: Límit de caràcters (deixa-ho a 0 si no hi ha límit)
15
- errors:
16
- models:
17
- answer:
18
- attributes:
19
- add_documents:
20
- needs_to_be_reattached: És necessari tornar a adjuntar el fitxer
21
- body:
22
- too_long: és massa llarg
23
- choices:
24
- missing: no estan completes
25
- too_many: Pots triar un màxim de %{count} opcions.
26
- questionnaire:
27
- request_invalid: Hi ha hagut un problema gestionant la petició. Si us plau, torna-ho a provar.
28
- decidim:
29
- forms:
30
- admin:
31
- models:
32
- components:
33
- description: Descripció
34
- tos: Termes del servei
35
- questionnaires:
36
- actions:
37
- back: Tornar a les preguntes
38
- show: Mostrar les respostes
39
- answer_option:
40
- answer_option: Opció de resposta
41
- free_text: Text lliure
42
- remove: Eliminar
43
- statement: Declaració
44
- answers:
45
- actions:
46
- back: Tornar a les respostes
47
- export: Exportar
48
- next: Següent &rsaquo;
49
- previous: "&lsaquo; Anterior"
50
- show: Mostrar les respostes
51
- empty: Encara no hi ha respostes
52
- export:
53
- answer:
54
- title: 'Resposta #%{number}'
55
- export_response:
56
- title: survey_user_answers_%{token}
57
- index:
58
- title: "%{total} respostes en total"
59
- show:
60
- title: 'Resposta #%{number}'
61
- display_condition:
62
- answer_option: Opció de resposta
63
- condition_question: Pregunta
64
- condition_type: Condició
65
- condition_types:
66
- answered: Amb resposta
67
- equal: Igual a
68
- match: Inclou text
69
- not_answered: No resposta
70
- not_equal: No és igual
71
- condition_value: Text inclòs
72
- display_condition: Condicions de visualització
73
- mandatory: Aquesta condició s'ha de complir sempre independentment de l'estat d'altres condicions
74
- remove: Eliminar
75
- save_warning: Recorda de guardar l'enquesta abans de configurar les condicions de visualitzacióó
76
- select_answer_option: Eliminar l'opció de resposta
77
- select_condition_question: Seleccionar una pregunta
78
- select_condition_type: Seleccionar un tipus de condició
79
- edit:
80
- save: Desa
81
- title: Editar el qüestionari
82
- form:
83
- add_question: Afegeix una pregunta
84
- add_separator: Afegir separador
85
- add_title_and_description: Afegir títol i descripció
86
- already_answered_warning: No pots modificar les preguntes d'aquest formulari perquè algunes participants ja han respost el formulari.
87
- collapse: Redueix totes les preguntes
88
- expand: Expandeix totes les preguntes
89
- preview: Previsualitzar
90
- title: Editar formulari per %{questionnaire_for}
91
- unpublished_warning: El formulari no està publicat. Pots modificar les preguntes, però en fer-ho s'esborraran les respostes actuals.
92
- matrix_row:
93
- matrix_row: Fila
94
- remove: Elimina
95
- statement: Declaració
96
- question:
97
- add_answer_option: Afegeix una opció de resposta
98
- add_display_condition: Afegir condició de visualització
99
- add_display_condition_info: Guardar l'enquesta per a configurar les condicions de visualització
100
- add_matrix_row: Afegir fila
101
- any: Cap
102
- collapse: Redueix
103
- description: Descripció
104
- down: Avall
105
- expand: Expandeix
106
- question: Pregunta
107
- remove: Eliminar
108
- statement: Declaració
109
- up: Amunt
110
- separator:
111
- down: Baixar
112
- remove: Eliminar
113
- separator: Separador
114
- up: Pujar
115
- title_and_description:
116
- collapse: Replegar
117
- description: Descripció
118
- down: Baixar
119
- expand: Expandir
120
- remove: Esborrar
121
- title: Títol
122
- title_and_description: Títol i descripció
123
- up: Pujar
124
- update:
125
- invalid: S'ha produït un error en desar el formulari.
126
- success: Formulari desat correctament.
127
- admin_log:
128
- questionnaire:
129
- update: "%{user_name} ha actualitzat el qüestionari %{resource_name}"
130
- errors:
131
- answer:
132
- body: El camp no pot estar en blanc
133
- images:
134
- dimensions: "%{width} x %{height} px"
135
- processors:
136
- resize_and_pad: Aquesta imatge serà redimensionada i ajustada a %{dimensions}.
137
- resize_to_fit: Aquesta imatge serà redimensionada per ajustar-se a %{dimensions}.
138
- question_types:
139
- files: Arxius
140
- long_answer: Resposta llarga
141
- matrix_multiple: Matriu (opció multiple)
142
- matrix_single: Matriu (opció única)
143
- multiple_option: Opció múltiple
144
- short_answer: Resposta curta
145
- single_option: Opció única
146
- sorting: Ordenació
147
- title_and_description: Títol i descripció
148
- questionnaire_answer_presenter:
149
- download_attachment: Descarregar l'arxiu adjunt
150
- questionnaires:
151
- answer:
152
- invalid: S'han produït un error en respondre el formulari.
153
- max_choices_alert: Has seleccionat massa opcions
154
- success: Has contestat el formulari correctament.
155
- question:
156
- max_choices: 'Opcions màximes: %{n}'
157
- show:
158
- answer_questionnaire:
159
- already_have_an_account?: Ja tens un compte?
160
- are_you_new?: Ets una nova usuària?
161
- sign_in_description: Inicia la teva sessió per respondre l'enquesta
162
- sign_up_description: Crea un compte de participant per a respondre l'enquesta
163
- title: Respon el formulari
164
- current_step: Pas %{step}
165
- empty: No s'ha configurat cap pregunta encara en aquest formulari.
166
- of_total_steps: de %{total_steps}
167
- questionnaire_answered:
168
- body: Ja has respost a aquest formulari.
169
- title: Ja has respost
170
- questionnaire_closed:
171
- body: El formulari està tancat i no es pot respondre.
172
- title: S'ha tancat el formulari
173
- questionnaire_for_private_users:
174
- body: El formulari només està disponible per a participants privades
175
- title: S'ha tancat el formulari
176
- questionnaire_js_disabled:
177
- body: Algunes de les característiques d'aquest formulari es deshabilitaran. Per millorar la teva experiència, si us plau, habilita JavaScript al teu navegador.
178
- title: JavaScript està desactivat
179
- questionnaire_not_published:
180
- body: Aquest formulari no s'ha publicat encara.
181
- tos_agreement: En participar acceptes els Termes i condicions d'ús
182
- step_navigation:
183
- show:
184
- are_you_sure: Aquesta acció no es pot desfer i no podràs editar les respostes. Segur que vols continuar?
185
- back: Enrere
186
- continue: Continuar
187
- submit: Enviar respostes
188
- user_answers_serializer:
189
- body: Resposta
190
- completion: Finalització
191
- created_at: Respost el
192
- id: Identificador de resposta
193
- ip_hash: Hash de l'adreça IP
194
- question: Pregunta
195
- registered: Registrada
196
- session_token: Identificador d'usuària
197
- unregistered: No registrada
198
- user_status: Estat de la usuària
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Exporters
5
- # rubocop: disable Rails/ApplicationController
6
- # A dummy controller to render views while exporting questionnaires
7
- class FormPDFControllerHelper < ActionController::Base
8
- # rubocop: enable Rails/ApplicationController
9
- helper Decidim::TranslationsHelper
10
- helper Decidim::Forms::Admin::QuestionnaireAnswersHelper
11
- end
12
- end
13
- end