decidim-forms 0.22.0 → 0.23.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/config/admin/decidim_forms_manifest.css +3 -0
  3. data/app/assets/config/decidim_forms_manifest.css +1 -0
  4. data/app/assets/javascripts/decidim/forms/admin/auto_select_options_from_url.component.js.es6 +40 -0
  5. data/app/assets/javascripts/decidim/forms/admin/forms.js.es6 +181 -25
  6. data/app/assets/javascripts/decidim/forms/autosortable_checkboxes.component.js.es6 +54 -34
  7. data/app/assets/javascripts/decidim/forms/display_conditions.component.js.es6 +204 -0
  8. data/app/assets/javascripts/decidim/forms/forms.js.es6 +8 -1
  9. data/app/assets/stylesheets/decidim/forms/questionnaire-answers-pdf.scss +69 -0
  10. data/app/commands/decidim/forms/admin/update_questionnaire.rb +25 -1
  11. data/app/commands/decidim/forms/answer_questionnaire.rb +1 -1
  12. data/app/controllers/decidim/forms/admin/concerns/has_questionnaire.rb +47 -1
  13. data/app/controllers/decidim/forms/admin/concerns/has_questionnaire_answers.rb +97 -0
  14. data/app/forms/decidim/forms/admin/display_condition_form.rb +100 -0
  15. data/app/forms/decidim/forms/admin/question_form.rb +1 -0
  16. data/app/forms/decidim/forms/answer_form.rb +15 -0
  17. data/app/helpers/decidim/forms/admin/application_helper.rb +21 -0
  18. data/app/helpers/decidim/forms/admin/concerns/has_questionnaire_answers_pagination_helper.rb +49 -0
  19. data/app/helpers/decidim/forms/admin/concerns/has_questionnaire_answers_url_helper.rb +40 -0
  20. data/app/helpers/decidim/forms/admin/questionnaire_answers_helper.rb +27 -0
  21. data/app/jobs/decidim/forms/export_questionnaire_answers_job.rb +19 -0
  22. data/app/models/decidim/forms/answer.rb +0 -3
  23. data/app/models/decidim/forms/answer_option.rb +14 -0
  24. data/app/models/decidim/forms/display_condition.rb +51 -0
  25. data/app/models/decidim/forms/question.rb +34 -0
  26. data/app/models/decidim/forms/question_matrix_row.rb +3 -0
  27. data/app/models/decidim/forms/questionnaire.rb +11 -1
  28. data/app/presenters/decidim/forms/admin/questionnaire_answer_presenter.rb +43 -0
  29. data/app/presenters/decidim/forms/admin/questionnaire_participant_presenter.rb +60 -0
  30. data/app/presenters/decidim/forms/answer_option_presenter.rb +20 -0
  31. data/app/presenters/decidim/forms/question_presenter.rb +16 -0
  32. data/app/queries/decidim/forms/questionnaire_participant.rb +35 -0
  33. data/app/queries/decidim/forms/questionnaire_participants.rb +43 -0
  34. data/app/views/decidim/forms/admin/questionnaires/_display_condition.html.erb +88 -0
  35. data/app/views/decidim/forms/admin/questionnaires/_display_condition_template.html.erb +7 -0
  36. data/app/views/decidim/forms/admin/questionnaires/_form.html.erb +30 -4
  37. data/app/views/decidim/forms/admin/questionnaires/_question.html.erb +19 -3
  38. data/app/views/decidim/forms/admin/questionnaires/answers/export/_answer.html.erb +31 -0
  39. data/app/views/decidim/forms/admin/questionnaires/answers/export/pdf.html.erb +13 -0
  40. data/app/views/decidim/forms/admin/questionnaires/answers/index.html.erb +53 -0
  41. data/app/views/decidim/forms/admin/questionnaires/answers/show.html.erb +48 -0
  42. data/app/views/decidim/forms/admin/questionnaires/edit.html.erb +9 -5
  43. data/app/views/decidim/forms/questionnaires/_answer.html.erb +1 -1
  44. data/app/views/decidim/forms/questionnaires/show.html.erb +22 -2
  45. data/app/views/layouts/decidim/forms/admin/questionnaires/questionnaire_answers.html.erb +12 -0
  46. data/config/initializers/wicked_pdf.rb +25 -0
  47. data/config/locales/am-ET.yml +1 -0
  48. data/config/locales/ar.yml +0 -1
  49. data/config/locales/bg-BG.yml +0 -2
  50. data/config/locales/bg.yml +14 -0
  51. data/config/locales/ca.yml +56 -4
  52. data/config/locales/cs.yml +54 -2
  53. data/config/locales/da.yml +1 -0
  54. data/config/locales/de.yml +51 -1
  55. data/config/locales/el.yml +0 -2
  56. data/config/locales/en.yml +54 -2
  57. data/config/locales/eo.yml +1 -0
  58. data/config/locales/es-MX.yml +53 -1
  59. data/config/locales/es-PY.yml +53 -1
  60. data/config/locales/es.yml +54 -2
  61. data/config/locales/et.yml +1 -0
  62. data/config/locales/eu.yml +0 -1
  63. data/config/locales/fi-plain.yml +53 -1
  64. data/config/locales/fi.yml +53 -1
  65. data/config/locales/fr-CA.yml +54 -2
  66. data/config/locales/fr.yml +54 -2
  67. data/config/locales/gl.yml +0 -1
  68. data/config/locales/hr.yml +1 -0
  69. data/config/locales/hu.yml +0 -2
  70. data/config/locales/id-ID.yml +0 -1
  71. data/config/locales/is.yml +1 -0
  72. data/config/locales/it.yml +53 -1
  73. data/config/locales/ja-JP.yml +51 -1
  74. data/config/locales/ja.yml +170 -0
  75. data/config/locales/ko-KR.yml +1 -0
  76. data/config/locales/ko.yml +1 -0
  77. data/config/locales/lt.yml +1 -0
  78. data/config/locales/{lv-LV.yml → lv.yml} +0 -1
  79. data/config/locales/mt.yml +1 -0
  80. data/config/locales/nl.yml +59 -7
  81. data/config/locales/no.yml +47 -2
  82. data/config/locales/om-ET.yml +1 -0
  83. data/config/locales/pl.yml +52 -3
  84. data/config/locales/pt-BR.yml +0 -1
  85. data/config/locales/pt.yml +51 -2
  86. data/config/locales/ro-RO.yml +51 -2
  87. data/config/locales/ru.yml +0 -1
  88. data/config/locales/sk.yml +0 -2
  89. data/config/locales/sl.yml +7 -0
  90. data/config/locales/so-SO.yml +1 -0
  91. data/config/locales/sv.yml +51 -2
  92. data/config/locales/ti-ER.yml +1 -0
  93. data/config/locales/tr-TR.yml +0 -1
  94. data/config/locales/vi-VN.yml +1 -0
  95. data/config/locales/vi.yml +1 -0
  96. data/config/locales/zh-CN.yml +172 -0
  97. data/config/locales/zh-TW.yml +1 -0
  98. data/db/migrate/20200130194123_create_decidim_forms_display_conditions.rb +20 -0
  99. data/lib/decidim/exporters/form_pdf.rb +33 -0
  100. data/lib/decidim/exporters/form_pdf_controller_helper.rb +11 -0
  101. data/lib/decidim/forms.rb +5 -0
  102. data/lib/decidim/forms/admin_engine.rb +1 -1
  103. data/lib/decidim/forms/test.rb +6 -0
  104. data/lib/decidim/forms/test/factories.rb +30 -0
  105. data/lib/decidim/forms/test/shared_examples/has_questionnaire.rb +619 -38
  106. data/lib/decidim/forms/test/shared_examples/manage_questionnaire_answers.rb +108 -0
  107. data/lib/decidim/forms/test/shared_examples/manage_questionnaires.rb +21 -894
  108. data/lib/decidim/forms/test/shared_examples/manage_questionnaires/add_display_conditions.rb +179 -0
  109. data/lib/decidim/forms/test/shared_examples/manage_questionnaires/add_questions.rb +463 -0
  110. data/lib/decidim/forms/test/shared_examples/manage_questionnaires/update_display_conditions.rb +93 -0
  111. data/lib/decidim/forms/test/shared_examples/manage_questionnaires/update_questions.rb +461 -0
  112. data/lib/decidim/forms/version.rb +1 -1
  113. metadata +91 -11
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-forms version.
5
5
  module Forms
6
6
  def self.version
7
- "0.22.0"
7
+ "0.23.0"
8
8
  end
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-forms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.22.0
4
+ version: 0.23.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josep Jaume Rey Peroy
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2020-09-01 00:00:00.000000000 Z
14
+ date: 2020-11-05 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: decidim-core
@@ -19,42 +19,70 @@ dependencies:
19
19
  requirements:
20
20
  - - '='
21
21
  - !ruby/object:Gem::Version
22
- version: 0.22.0
22
+ version: 0.23.0
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.22.0
29
+ version: 0.23.0
30
+ - !ruby/object:Gem::Dependency
31
+ name: wicked_pdf
32
+ requirement: !ruby/object:Gem::Requirement
33
+ requirements:
34
+ - - "~>"
35
+ - !ruby/object:Gem::Version
36
+ version: '1.4'
37
+ type: :runtime
38
+ prerelease: false
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - "~>"
42
+ - !ruby/object:Gem::Version
43
+ version: '1.4'
44
+ - !ruby/object:Gem::Dependency
45
+ name: wkhtmltopdf-binary
46
+ requirement: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - "~>"
49
+ - !ruby/object:Gem::Version
50
+ version: '0.12'
51
+ type: :runtime
52
+ prerelease: false
53
+ version_requirements: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - "~>"
56
+ - !ruby/object:Gem::Version
57
+ version: '0.12'
30
58
  - !ruby/object:Gem::Dependency
31
59
  name: decidim-admin
32
60
  requirement: !ruby/object:Gem::Requirement
33
61
  requirements:
34
62
  - - '='
35
63
  - !ruby/object:Gem::Version
36
- version: 0.22.0
64
+ version: 0.23.0
37
65
  type: :development
38
66
  prerelease: false
39
67
  version_requirements: !ruby/object:Gem::Requirement
40
68
  requirements:
41
69
  - - '='
42
70
  - !ruby/object:Gem::Version
43
- version: 0.22.0
71
+ version: 0.23.0
44
72
  - !ruby/object:Gem::Dependency
45
73
  name: decidim-dev
46
74
  requirement: !ruby/object:Gem::Requirement
47
75
  requirements:
48
76
  - - '='
49
77
  - !ruby/object:Gem::Version
50
- version: 0.22.0
78
+ version: 0.23.0
51
79
  type: :development
52
80
  prerelease: false
53
81
  version_requirements: !ruby/object:Gem::Requirement
54
82
  requirements:
55
83
  - - '='
56
84
  - !ruby/object:Gem::Version
57
- version: 0.22.0
85
+ version: 0.23.0
58
86
  description: A forms gem for decidim.
59
87
  email:
60
88
  - josepjaume@gmail.com
@@ -67,20 +95,24 @@ extra_rdoc_files: []
67
95
  files:
68
96
  - README.md
69
97
  - Rakefile
98
+ - app/assets/config/admin/decidim_forms_manifest.css
70
99
  - app/assets/config/admin/decidim_forms_manifest.js
71
100
  - app/assets/config/decidim_forms_manifest.css
72
101
  - app/assets/config/decidim_forms_manifest.js
73
102
  - app/assets/images/decidim/surveys/icon.svg
74
103
  - app/assets/javascripts/decidim/forms/admin/auto_buttons_by_min_items.component.js.es6
75
104
  - app/assets/javascripts/decidim/forms/admin/auto_select_options_by_total_items.component.js.es6
105
+ - app/assets/javascripts/decidim/forms/admin/auto_select_options_from_url.component.js.es6
76
106
  - app/assets/javascripts/decidim/forms/admin/collapsible_questions.js.es6
77
107
  - app/assets/javascripts/decidim/forms/admin/forms.js.es6
78
108
  - app/assets/javascripts/decidim/forms/admin/live_text_update.component.js.es6
79
109
  - app/assets/javascripts/decidim/forms/autosortable_checkboxes.component.js.es6
110
+ - app/assets/javascripts/decidim/forms/display_conditions.component.js.es6
80
111
  - app/assets/javascripts/decidim/forms/forms.js.es6
81
112
  - app/assets/javascripts/decidim/forms/max_choices_alert.component.js.es6
82
113
  - app/assets/javascripts/decidim/forms/option_attached_inputs.component.js.es6
83
114
  - app/assets/stylesheets/decidim/forms/forms.scss
115
+ - app/assets/stylesheets/decidim/forms/questionnaire-answers-pdf.scss
84
116
  - app/cells/decidim/forms/answer_readonly/show.erb
85
117
  - app/cells/decidim/forms/answer_readonly_cell.rb
86
118
  - app/cells/decidim/forms/matrix_readonly/show.erb
@@ -92,8 +124,10 @@ files:
92
124
  - app/commands/decidim/forms/admin/update_questionnaire.rb
93
125
  - app/commands/decidim/forms/answer_questionnaire.rb
94
126
  - app/controllers/decidim/forms/admin/concerns/has_questionnaire.rb
127
+ - app/controllers/decidim/forms/admin/concerns/has_questionnaire_answers.rb
95
128
  - app/controllers/decidim/forms/concerns/has_questionnaire.rb
96
129
  - app/forms/decidim/forms/admin/answer_option_form.rb
130
+ - app/forms/decidim/forms/admin/display_condition_form.rb
97
131
  - app/forms/decidim/forms/admin/question_form.rb
98
132
  - app/forms/decidim/forms/admin/question_matrix_row_form.rb
99
133
  - app/forms/decidim/forms/admin/questionnaire_form.rb
@@ -101,26 +135,43 @@ files:
101
135
  - app/forms/decidim/forms/answer_form.rb
102
136
  - app/forms/decidim/forms/questionnaire_form.rb
103
137
  - app/helpers/decidim/forms/admin/application_helper.rb
138
+ - app/helpers/decidim/forms/admin/concerns/has_questionnaire_answers_pagination_helper.rb
139
+ - app/helpers/decidim/forms/admin/concerns/has_questionnaire_answers_url_helper.rb
140
+ - app/helpers/decidim/forms/admin/questionnaire_answers_helper.rb
104
141
  - app/helpers/decidim/forms/application_helper.rb
142
+ - app/jobs/decidim/forms/export_questionnaire_answers_job.rb
105
143
  - app/models/concerns/decidim/forms/has_questionnaire.rb
106
144
  - app/models/decidim/forms/answer.rb
107
145
  - app/models/decidim/forms/answer_choice.rb
108
146
  - app/models/decidim/forms/answer_option.rb
109
147
  - app/models/decidim/forms/application_record.rb
148
+ - app/models/decidim/forms/display_condition.rb
110
149
  - app/models/decidim/forms/question.rb
111
150
  - app/models/decidim/forms/question_matrix_row.rb
112
151
  - app/models/decidim/forms/questionnaire.rb
152
+ - app/presenters/decidim/forms/admin/questionnaire_answer_presenter.rb
153
+ - app/presenters/decidim/forms/admin/questionnaire_participant_presenter.rb
154
+ - app/presenters/decidim/forms/answer_option_presenter.rb
155
+ - app/presenters/decidim/forms/question_presenter.rb
156
+ - app/queries/decidim/forms/questionnaire_participant.rb
157
+ - app/queries/decidim/forms/questionnaire_participants.rb
113
158
  - app/queries/decidim/forms/questionnaire_user_answers.rb
114
159
  - app/types/decidim/forms/answer_option_type.rb
115
160
  - app/types/decidim/forms/question_type.rb
116
161
  - app/types/decidim/forms/questionnaire_type.rb
117
162
  - app/views/decidim/forms/admin/questionnaires/_answer_option.html.erb
118
163
  - app/views/decidim/forms/admin/questionnaires/_answer_option_template.html.erb
164
+ - app/views/decidim/forms/admin/questionnaires/_display_condition.html.erb
165
+ - app/views/decidim/forms/admin/questionnaires/_display_condition_template.html.erb
119
166
  - app/views/decidim/forms/admin/questionnaires/_form.html.erb
120
167
  - app/views/decidim/forms/admin/questionnaires/_matrix_row.html.erb
121
168
  - app/views/decidim/forms/admin/questionnaires/_matrix_row_template.html.erb
122
169
  - app/views/decidim/forms/admin/questionnaires/_question.html.erb
123
170
  - app/views/decidim/forms/admin/questionnaires/_separator.html.erb
171
+ - app/views/decidim/forms/admin/questionnaires/answers/export/_answer.html.erb
172
+ - app/views/decidim/forms/admin/questionnaires/answers/export/pdf.html.erb
173
+ - app/views/decidim/forms/admin/questionnaires/answers/index.html.erb
174
+ - app/views/decidim/forms/admin/questionnaires/answers/show.html.erb
124
175
  - app/views/decidim/forms/admin/questionnaires/edit.html.erb
125
176
  - app/views/decidim/forms/questionnaires/_answer.html.erb
126
177
  - app/views/decidim/forms/questionnaires/answers/_long_answer.html.erb
@@ -132,22 +183,29 @@ files:
132
183
  - app/views/decidim/forms/questionnaires/answers/_single_option.html.erb
133
184
  - app/views/decidim/forms/questionnaires/answers/_sorting.html.erb
134
185
  - app/views/decidim/forms/questionnaires/show.html.erb
186
+ - app/views/layouts/decidim/forms/admin/questionnaires/questionnaire_answers.html.erb
187
+ - config/initializers/wicked_pdf.rb
188
+ - config/locales/am-ET.yml
135
189
  - config/locales/ar-SA.yml
136
190
  - config/locales/ar.yml
137
191
  - config/locales/bg-BG.yml
192
+ - config/locales/bg.yml
138
193
  - config/locales/ca.yml
139
194
  - config/locales/cs-CZ.yml
140
195
  - config/locales/cs.yml
141
196
  - config/locales/da-DK.yml
197
+ - config/locales/da.yml
142
198
  - config/locales/de.yml
143
199
  - config/locales/el-GR.yml
144
200
  - config/locales/el.yml
145
201
  - config/locales/en.yml
146
202
  - config/locales/eo-UY.yml
203
+ - config/locales/eo.yml
147
204
  - config/locales/es-MX.yml
148
205
  - config/locales/es-PY.yml
149
206
  - config/locales/es.yml
150
207
  - config/locales/et-EE.yml
208
+ - config/locales/et.yml
151
209
  - config/locales/eu.yml
152
210
  - config/locales/fi-pl.yml
153
211
  - config/locales/fi-plain.yml
@@ -157,16 +215,24 @@ files:
157
215
  - config/locales/ga-IE.yml
158
216
  - config/locales/gl.yml
159
217
  - config/locales/hr-HR.yml
218
+ - config/locales/hr.yml
160
219
  - config/locales/hu.yml
161
220
  - config/locales/id-ID.yml
162
221
  - config/locales/is-IS.yml
222
+ - config/locales/is.yml
163
223
  - config/locales/it.yml
164
224
  - config/locales/ja-JP.yml
225
+ - config/locales/ja.yml
226
+ - config/locales/ko-KR.yml
227
+ - config/locales/ko.yml
165
228
  - config/locales/lt-LT.yml
166
- - config/locales/lv-LV.yml
229
+ - config/locales/lt.yml
230
+ - config/locales/lv.yml
167
231
  - config/locales/mt-MT.yml
232
+ - config/locales/mt.yml
168
233
  - config/locales/nl.yml
169
234
  - config/locales/no.yml
235
+ - config/locales/om-ET.yml
170
236
  - config/locales/pl.yml
171
237
  - config/locales/pt-BR.yml
172
238
  - config/locales/pt.yml
@@ -175,10 +241,16 @@ files:
175
241
  - config/locales/sk-SK.yml
176
242
  - config/locales/sk.yml
177
243
  - config/locales/sl.yml
244
+ - config/locales/so-SO.yml
178
245
  - config/locales/sr-CS.yml
179
246
  - config/locales/sv.yml
247
+ - config/locales/ti-ER.yml
180
248
  - config/locales/tr-TR.yml
181
249
  - config/locales/uk.yml
250
+ - config/locales/vi-VN.yml
251
+ - config/locales/vi.yml
252
+ - config/locales/zh-CN.yml
253
+ - config/locales/zh-TW.yml
182
254
  - db/migrate/20170511092231_create_decidim_forms_questionnaires.rb
183
255
  - db/migrate/20170515090916_create_decidim_forms_questions.rb
184
256
  - db/migrate/20170515144119_create_decidim_forms_answers.rb
@@ -186,9 +258,12 @@ files:
186
258
  - db/migrate/20180405015147_create_decidim_forms_answer_choices.rb
187
259
  - db/migrate/20190315203056_add_session_token_to_decidim_forms_answers.rb
188
260
  - db/migrate/20190930094710_add_ip_hash_to_decidim_form_answers.rb
261
+ - db/migrate/20200130194123_create_decidim_forms_display_conditions.rb
189
262
  - db/migrate/20200225123810_create_decidim_forms_question_matrix_rows.rb
190
263
  - db/migrate/20200304152939_add_matrix_row_id_to_decidim_forms_answer_choices.rb
191
264
  - lib/decidim/api/questionnaire_entity_interface.rb
265
+ - lib/decidim/exporters/form_pdf.rb
266
+ - lib/decidim/exporters/form_pdf_controller_helper.rb
192
267
  - lib/decidim/forms.rb
193
268
  - lib/decidim/forms/admin.rb
194
269
  - lib/decidim/forms/admin_engine.rb
@@ -198,7 +273,12 @@ files:
198
273
  - lib/decidim/forms/test.rb
199
274
  - lib/decidim/forms/test/factories.rb
200
275
  - lib/decidim/forms/test/shared_examples/has_questionnaire.rb
276
+ - lib/decidim/forms/test/shared_examples/manage_questionnaire_answers.rb
201
277
  - lib/decidim/forms/test/shared_examples/manage_questionnaires.rb
278
+ - lib/decidim/forms/test/shared_examples/manage_questionnaires/add_display_conditions.rb
279
+ - lib/decidim/forms/test/shared_examples/manage_questionnaires/add_questions.rb
280
+ - lib/decidim/forms/test/shared_examples/manage_questionnaires/update_display_conditions.rb
281
+ - lib/decidim/forms/test/shared_examples/manage_questionnaires/update_questions.rb
202
282
  - lib/decidim/forms/user_answers_serializer.rb
203
283
  - lib/decidim/forms/version.rb
204
284
  homepage: https://github.com/decidim/decidim
@@ -213,14 +293,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
213
293
  requirements:
214
294
  - - ">="
215
295
  - !ruby/object:Gem::Version
216
- version: '2.5'
296
+ version: '2.6'
217
297
  required_rubygems_version: !ruby/object:Gem::Requirement
218
298
  requirements:
219
299
  - - ">="
220
300
  - !ruby/object:Gem::Version
221
301
  version: '0'
222
302
  requirements: []
223
- rubygems_version: 3.1.2
303
+ rubygems_version: 3.0.3
224
304
  signing_key:
225
305
  specification_version: 4
226
306
  summary: Decidim forms