decidim-accountability 0.29.2 → 0.30.0.rc2

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 (141) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/accountability/project/show.erb +6 -0
  3. data/app/cells/decidim/accountability/project_cell.rb +23 -42
  4. data/app/cells/decidim/accountability/result_history_cell.rb +57 -0
  5. data/app/cells/decidim/accountability/result_metadata_cell.rb +17 -17
  6. data/app/cells/decidim/accountability/status_cell.rb +9 -13
  7. data/app/commands/decidim/accountability/admin/create_imported_result.rb +1 -1
  8. data/app/commands/decidim/accountability/admin/create_result.rb +3 -2
  9. data/app/commands/decidim/accountability/admin/import_component_to_accountability.rb +47 -0
  10. data/app/commands/decidim/accountability/admin/update_imported_result.rb +1 -1
  11. data/app/commands/decidim/accountability/admin/update_result.rb +3 -2
  12. data/app/commands/decidim/accountability/admin/update_result_dates.rb +56 -0
  13. data/app/commands/decidim/accountability/admin/update_result_status.rb +61 -0
  14. data/app/commands/decidim/accountability/admin/update_result_taxonomies.rb +18 -0
  15. data/app/controllers/concerns/decidim/accountability/admin/filterable.rb +8 -6
  16. data/app/controllers/decidim/accountability/admin/import_components_controller.rb +36 -0
  17. data/app/controllers/decidim/accountability/admin/results_bulk_actions_controller.rb +102 -0
  18. data/app/controllers/decidim/accountability/admin/results_controller.rb +21 -11
  19. data/app/controllers/decidim/accountability/results_controller.rb +10 -7
  20. data/app/forms/decidim/accountability/admin/import_component_form.rb +98 -0
  21. data/app/forms/decidim/accountability/admin/result_bulk_actions_form.rb +18 -0
  22. data/app/forms/decidim/accountability/admin/result_form.rb +17 -23
  23. data/app/helpers/decidim/accountability/admin/application_helper.rb +0 -1
  24. data/app/helpers/decidim/accountability/application_helper.rb +1 -32
  25. data/app/helpers/decidim/accountability/breadcrumb_helper.rb +10 -14
  26. data/app/jobs/decidim/accountability/admin/import_projects_job.rb +5 -3
  27. data/app/jobs/decidim/accountability/admin/import_proposals_job.rb +70 -0
  28. data/app/mailers/decidim/accountability/import_proposals_mailer.rb +28 -0
  29. data/app/models/decidim/accountability/result.rb +23 -1
  30. data/app/models/decidim/accountability/status.rb +4 -0
  31. data/app/packs/entrypoints/decidim_accountability_admin_form.js +1 -0
  32. data/app/packs/src/decidim/accountability/admin/imports.js +37 -14
  33. data/app/packs/src/decidim/accountability/admin/index/action_button.js +42 -0
  34. data/app/packs/src/decidim/accountability/admin/index/action_form.js +46 -0
  35. data/app/packs/src/decidim/accountability/admin/index/action_selector.js +37 -0
  36. data/app/packs/src/decidim/accountability/admin/index/counter.js +40 -0
  37. data/app/packs/src/decidim/accountability/admin/index/select_all.js +29 -0
  38. data/app/packs/src/decidim/accountability/admin/index.js +17 -7
  39. data/app/packs/src/decidim/accountability/admin/result_form.js +21 -0
  40. data/app/packs/stylesheets/accountability.scss +5 -0
  41. data/app/permissions/decidim/accountability/admin/permissions.rb +3 -2
  42. data/app/presenters/decidim/accountability/admin_log/result_presenter.rb +1 -1
  43. data/app/presenters/decidim/accountability/result_presenter.rb +30 -0
  44. data/app/queries/decidim/accountability/metrics/results_metric_manage.rb +6 -6
  45. data/app/services/decidim/accountability/results_calculator.rb +4 -6
  46. data/app/services/decidim/accountability/results_csv_importer.rb +1 -1
  47. data/app/views/decidim/accountability/admin/import_components/_filters.html.erb +26 -0
  48. data/app/views/decidim/accountability/admin/import_components/_form.html.erb +26 -0
  49. data/app/views/decidim/accountability/admin/import_components/new.html.erb +14 -0
  50. data/app/views/decidim/accountability/admin/results/_actions.html.erb +29 -0
  51. data/app/views/decidim/accountability/admin/results/_form.html.erb +15 -8
  52. data/app/views/decidim/accountability/admin/results/_result-tr.html.erb +32 -0
  53. data/app/views/decidim/accountability/admin/results/_results-thead.html.erb +26 -0
  54. data/app/views/decidim/accountability/admin/results/bulk_actions/_dates_form.html.erb +19 -0
  55. data/app/views/decidim/accountability/admin/results/bulk_actions/_dropdown.html.erb +40 -0
  56. data/app/views/decidim/accountability/admin/results/bulk_actions/_status_form.html.erb +16 -0
  57. data/app/views/decidim/accountability/admin/results/bulk_actions/_submit_buttons.html.erb +4 -0
  58. data/app/views/decidim/accountability/admin/results/bulk_actions/_taxonomies_form.html.erb +18 -0
  59. data/app/views/decidim/accountability/admin/results/edit.html.erb +2 -2
  60. data/app/views/decidim/accountability/admin/results/index.html.erb +50 -111
  61. data/app/views/decidim/accountability/admin/results/manage_trash.html.erb +26 -0
  62. data/app/views/decidim/accountability/admin/results/new.html.erb +2 -2
  63. data/app/views/decidim/accountability/import_proposals_mailer/import.html.erb +2 -0
  64. data/app/views/decidim/accountability/results/{_home_categories.html.erb → _home_taxonomies.html.erb} +6 -8
  65. data/app/views/decidim/accountability/results/_project.html.erb +1 -3
  66. data/app/views/decidim/accountability/results/_projects_aside.html.erb +9 -7
  67. data/app/views/decidim/accountability/results/home.html.erb +18 -6
  68. data/app/views/decidim/accountability/results/index.html.erb +8 -2
  69. data/app/views/decidim/accountability/results/show.html.erb +5 -5
  70. data/config/assets.rb +3 -2
  71. data/config/locales/ar.yml +97 -55
  72. data/config/locales/bg.yml +0 -50
  73. data/config/locales/bs-BA.yml +0 -16
  74. data/config/locales/ca.yml +128 -40
  75. data/config/locales/cs.yml +147 -56
  76. data/config/locales/da.yml +0 -20
  77. data/config/locales/de.yml +126 -39
  78. data/config/locales/el.yml +0 -48
  79. data/config/locales/en.yml +128 -40
  80. data/config/locales/es-MX.yml +129 -41
  81. data/config/locales/es-PY.yml +129 -41
  82. data/config/locales/es.yml +129 -41
  83. data/config/locales/eu.yml +140 -53
  84. data/config/locales/fi-plain.yml +136 -49
  85. data/config/locales/fi.yml +136 -49
  86. data/config/locales/fr-CA.yml +111 -54
  87. data/config/locales/fr.yml +111 -54
  88. data/config/locales/ga-IE.yml +0 -13
  89. data/config/locales/gl.yml +0 -17
  90. data/config/locales/gn-PY.yml +0 -11
  91. data/config/locales/he-IL.yml +45 -54
  92. data/config/locales/hu.yml +0 -50
  93. data/config/locales/id-ID.yml +0 -16
  94. data/config/locales/is-IS.yml +0 -17
  95. data/config/locales/it.yml +0 -18
  96. data/config/locales/ja.yml +132 -47
  97. data/config/locales/kaa.yml +0 -8
  98. data/config/locales/ko.yml +0 -47
  99. data/config/locales/lb.yml +0 -17
  100. data/config/locales/lt.yml +0 -50
  101. data/config/locales/lv.yml +0 -19
  102. data/config/locales/nl.yml +0 -17
  103. data/config/locales/no.yml +0 -17
  104. data/config/locales/pl.yml +0 -47
  105. data/config/locales/pt-BR.yml +6 -50
  106. data/config/locales/pt.yml +35 -23
  107. data/config/locales/ro-RO.yml +0 -29
  108. data/config/locales/ru.yml +0 -16
  109. data/config/locales/si-LK.yml +0 -11
  110. data/config/locales/sk.yml +0 -19
  111. data/config/locales/sl.yml +0 -17
  112. data/config/locales/sq-AL.yml +0 -50
  113. data/config/locales/sr-CS.yml +0 -16
  114. data/config/locales/sv.yml +124 -36
  115. data/config/locales/th-TH.yml +0 -50
  116. data/config/locales/tr-TR.yml +0 -47
  117. data/config/locales/uk.yml +0 -16
  118. data/config/locales/zh-CN.yml +0 -20
  119. data/config/locales/zh-TW.yml +0 -47
  120. data/db/migrate/20200827154103_add_commentable_counter_cache_to_results.rb +1 -1
  121. data/db/migrate/20240828103202_add_deleted_at_to_decidim_accountability_results.rb +8 -0
  122. data/db/migrate/20240916112128_add_geolocation_fields_to_results.rb +9 -0
  123. data/decidim-accountability.gemspec +1 -1
  124. data/lib/decidim/accountability/admin_engine.rb +16 -2
  125. data/lib/decidim/accountability/component.rb +3 -3
  126. data/lib/decidim/accountability/result_serializer.rb +9 -13
  127. data/lib/decidim/accountability/seeds.rb +28 -21
  128. data/lib/decidim/accountability/test/factories.rb +6 -4
  129. data/lib/decidim/accountability/version.rb +1 -1
  130. data/lib/decidim/api/accountability_type.rb +4 -5
  131. data/lib/decidim/api/result_type.rb +10 -13
  132. data/lib/decidim/api/status_type.rb +3 -4
  133. data/lib/decidim/api/timeline_entry_type.rb +5 -6
  134. metadata +58 -30
  135. data/app/commands/decidim/accountability/admin/import_projects_to_accountability.rb +0 -37
  136. data/app/controllers/decidim/accountability/admin/projects_import_controller.rb +0 -31
  137. data/app/forms/decidim/accountability/admin/result_import_projects_form.rb +0 -51
  138. data/app/views/decidim/accountability/admin/projects_import/new.html.erb +0 -45
  139. data/app/views/decidim/accountability/results/_nav_breadcrumb.html.erb +0 -37
  140. data/app/views/decidim/accountability/results/_scope_filters.html.erb +0 -31
  141. /data/app/packs/entrypoints/{decidim_accountability_admin.js → decidim_accountability_admin_index.js} +0 -0
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-accountability
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.29.2
4
+ version: 0.30.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josep Jaume Rey Peroy
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2025-02-12 00:00:00.000000000 Z
13
+ date: 2025-03-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: decidim-comments
@@ -18,126 +18,126 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 0.29.2
21
+ version: 0.30.0.rc2
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - '='
27
27
  - !ruby/object:Gem::Version
28
- version: 0.29.2
28
+ version: 0.30.0.rc2
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: decidim-core
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 0.29.2
35
+ version: 0.30.0.rc2
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - '='
41
41
  - !ruby/object:Gem::Version
42
- version: 0.29.2
42
+ version: 0.30.0.rc2
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: decidim-admin
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - '='
48
48
  - !ruby/object:Gem::Version
49
- version: 0.29.2
49
+ version: 0.30.0.rc2
50
50
  type: :development
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - '='
55
55
  - !ruby/object:Gem::Version
56
- version: 0.29.2
56
+ version: 0.30.0.rc2
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: decidim-assemblies
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
61
  - - '='
62
62
  - !ruby/object:Gem::Version
63
- version: 0.29.2
63
+ version: 0.30.0.rc2
64
64
  type: :development
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
68
  - - '='
69
69
  - !ruby/object:Gem::Version
70
- version: 0.29.2
70
+ version: 0.30.0.rc2
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: decidim-comments
73
73
  requirement: !ruby/object:Gem::Requirement
74
74
  requirements:
75
75
  - - '='
76
76
  - !ruby/object:Gem::Version
77
- version: 0.29.2
77
+ version: 0.30.0.rc2
78
78
  type: :development
79
79
  prerelease: false
80
80
  version_requirements: !ruby/object:Gem::Requirement
81
81
  requirements:
82
82
  - - '='
83
83
  - !ruby/object:Gem::Version
84
- version: 0.29.2
84
+ version: 0.30.0.rc2
85
85
  - !ruby/object:Gem::Dependency
86
86
  name: decidim-dev
87
87
  requirement: !ruby/object:Gem::Requirement
88
88
  requirements:
89
89
  - - '='
90
90
  - !ruby/object:Gem::Version
91
- version: 0.29.2
91
+ version: 0.30.0.rc2
92
92
  type: :development
93
93
  prerelease: false
94
94
  version_requirements: !ruby/object:Gem::Requirement
95
95
  requirements:
96
96
  - - '='
97
97
  - !ruby/object:Gem::Version
98
- version: 0.29.2
98
+ version: 0.30.0.rc2
99
99
  - !ruby/object:Gem::Dependency
100
100
  name: decidim-meetings
101
101
  requirement: !ruby/object:Gem::Requirement
102
102
  requirements:
103
103
  - - '='
104
104
  - !ruby/object:Gem::Version
105
- version: 0.29.2
105
+ version: 0.30.0.rc2
106
106
  type: :development
107
107
  prerelease: false
108
108
  version_requirements: !ruby/object:Gem::Requirement
109
109
  requirements:
110
110
  - - '='
111
111
  - !ruby/object:Gem::Version
112
- version: 0.29.2
112
+ version: 0.30.0.rc2
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: decidim-participatory_processes
115
115
  requirement: !ruby/object:Gem::Requirement
116
116
  requirements:
117
117
  - - '='
118
118
  - !ruby/object:Gem::Version
119
- version: 0.29.2
119
+ version: 0.30.0.rc2
120
120
  type: :development
121
121
  prerelease: false
122
122
  version_requirements: !ruby/object:Gem::Requirement
123
123
  requirements:
124
124
  - - '='
125
125
  - !ruby/object:Gem::Version
126
- version: 0.29.2
126
+ version: 0.30.0.rc2
127
127
  - !ruby/object:Gem::Dependency
128
128
  name: decidim-proposals
129
129
  requirement: !ruby/object:Gem::Requirement
130
130
  requirements:
131
131
  - - '='
132
132
  - !ruby/object:Gem::Version
133
- version: 0.29.2
133
+ version: 0.30.0.rc2
134
134
  type: :development
135
135
  prerelease: false
136
136
  version_requirements: !ruby/object:Gem::Requirement
137
137
  requirements:
138
138
  - - '='
139
139
  - !ruby/object:Gem::Version
140
- version: 0.29.2
140
+ version: 0.30.0.rc2
141
141
  description: An accountability component for decidim's participatory spaces.
142
142
  email:
143
143
  - josepjaume@gmail.com
@@ -160,6 +160,7 @@ files:
160
160
  - app/cells/decidim/accountability/result_activity_cell.rb
161
161
  - app/cells/decidim/accountability/result_card_cell.rb
162
162
  - app/cells/decidim/accountability/result_cell.rb
163
+ - app/cells/decidim/accountability/result_history_cell.rb
163
164
  - app/cells/decidim/accountability/result_l/extra_data.erb
164
165
  - app/cells/decidim/accountability/result_l_cell.rb
165
166
  - app/cells/decidim/accountability/result_metadata/project_aside.erb
@@ -176,17 +177,21 @@ files:
176
177
  - app/commands/decidim/accountability/admin/create_status.rb
177
178
  - app/commands/decidim/accountability/admin/create_timeline_entry.rb
178
179
  - app/commands/decidim/accountability/admin/has_result_command.rb
179
- - app/commands/decidim/accountability/admin/import_projects_to_accountability.rb
180
+ - app/commands/decidim/accountability/admin/import_component_to_accountability.rb
180
181
  - app/commands/decidim/accountability/admin/update_imported_result.rb
181
182
  - app/commands/decidim/accountability/admin/update_result.rb
183
+ - app/commands/decidim/accountability/admin/update_result_dates.rb
184
+ - app/commands/decidim/accountability/admin/update_result_status.rb
185
+ - app/commands/decidim/accountability/admin/update_result_taxonomies.rb
182
186
  - app/commands/decidim/accountability/admin/update_status.rb
183
187
  - app/commands/decidim/accountability/admin/update_timeline_entry.rb
184
188
  - app/controllers/concerns/decidim/accountability/admin/filterable.rb
185
189
  - app/controllers/decidim/accountability/admin/application_controller.rb
186
190
  - app/controllers/decidim/accountability/admin/attachment_collections_controller.rb
187
191
  - app/controllers/decidim/accountability/admin/attachments_controller.rb
192
+ - app/controllers/decidim/accountability/admin/import_components_controller.rb
188
193
  - app/controllers/decidim/accountability/admin/import_results_controller.rb
189
- - app/controllers/decidim/accountability/admin/projects_import_controller.rb
194
+ - app/controllers/decidim/accountability/admin/results_bulk_actions_controller.rb
190
195
  - app/controllers/decidim/accountability/admin/results_controller.rb
191
196
  - app/controllers/decidim/accountability/admin/statuses_controller.rb
192
197
  - app/controllers/decidim/accountability/admin/timeline_entries_controller.rb
@@ -196,9 +201,10 @@ files:
196
201
  - app/events/decidim/accountability/base_result_event.rb
197
202
  - app/events/decidim/accountability/proposal_linked_event.rb
198
203
  - app/events/decidim/accountability/result_progress_updated_event.rb
204
+ - app/forms/decidim/accountability/admin/import_component_form.rb
199
205
  - app/forms/decidim/accountability/admin/import_results_form.rb
206
+ - app/forms/decidim/accountability/admin/result_bulk_actions_form.rb
200
207
  - app/forms/decidim/accountability/admin/result_form.rb
201
- - app/forms/decidim/accountability/admin/result_import_projects_form.rb
202
208
  - app/forms/decidim/accountability/admin/status_form.rb
203
209
  - app/forms/decidim/accountability/admin/timeline_entry_form.rb
204
210
  - app/helpers/decidim/accountability/admin/application_helper.rb
@@ -207,20 +213,29 @@ files:
207
213
  - app/helpers/decidim/accountability/breadcrumb_helper.rb
208
214
  - app/jobs/application_job.rb
209
215
  - app/jobs/decidim/accountability/admin/import_projects_job.rb
216
+ - app/jobs/decidim/accountability/admin/import_proposals_job.rb
210
217
  - app/jobs/decidim/accountability/admin/import_results_csv_job.rb
211
218
  - app/mailers/decidim/accountability/import_mailer.rb
212
219
  - app/mailers/decidim/accountability/import_projects_mailer.rb
220
+ - app/mailers/decidim/accountability/import_proposals_mailer.rb
213
221
  - app/models/decidim/accountability/application_record.rb
214
222
  - app/models/decidim/accountability/result.rb
215
223
  - app/models/decidim/accountability/status.rb
216
224
  - app/models/decidim/accountability/timeline_entry.rb
217
225
  - app/packs/entrypoints/decidim_accountability.js
218
- - app/packs/entrypoints/decidim_accountability_admin.js
226
+ - app/packs/entrypoints/decidim_accountability_admin_form.js
219
227
  - app/packs/entrypoints/decidim_accountability_admin_imports.js
228
+ - app/packs/entrypoints/decidim_accountability_admin_index.js
220
229
  - app/packs/images/decidim/accountability/breadcrumb_arrow.svg
221
230
  - app/packs/images/decidim/accountability/decidim_accountability.svg
222
231
  - app/packs/src/decidim/accountability/admin/imports.js
223
232
  - app/packs/src/decidim/accountability/admin/index.js
233
+ - app/packs/src/decidim/accountability/admin/index/action_button.js
234
+ - app/packs/src/decidim/accountability/admin/index/action_form.js
235
+ - app/packs/src/decidim/accountability/admin/index/action_selector.js
236
+ - app/packs/src/decidim/accountability/admin/index/counter.js
237
+ - app/packs/src/decidim/accountability/admin/index/select_all.js
238
+ - app/packs/src/decidim/accountability/admin/result_form.js
224
239
  - app/packs/src/decidim/accountability/index.js
225
240
  - app/packs/src/decidim/accountability/version_diff.js
226
241
  - app/packs/stylesheets/accountability.scss
@@ -230,15 +245,27 @@ files:
230
245
  - app/presenters/decidim/accountability/admin_log/status_presenter.rb
231
246
  - app/presenters/decidim/accountability/admin_log/timeline_entry_presenter.rb
232
247
  - app/presenters/decidim/accountability/admin_log/value_types/parent_presenter.rb
248
+ - app/presenters/decidim/accountability/result_presenter.rb
233
249
  - app/queries/decidim/accountability/metrics/results_metric_manage.rb
234
250
  - app/services/decidim/accountability/diff_renderer.rb
235
251
  - app/services/decidim/accountability/results_calculator.rb
236
252
  - app/services/decidim/accountability/results_csv_importer.rb
253
+ - app/views/decidim/accountability/admin/import_components/_filters.html.erb
254
+ - app/views/decidim/accountability/admin/import_components/_form.html.erb
255
+ - app/views/decidim/accountability/admin/import_components/new.html.erb
237
256
  - app/views/decidim/accountability/admin/import_results/new.html.erb
238
- - app/views/decidim/accountability/admin/projects_import/new.html.erb
257
+ - app/views/decidim/accountability/admin/results/_actions.html.erb
239
258
  - app/views/decidim/accountability/admin/results/_form.html.erb
259
+ - app/views/decidim/accountability/admin/results/_result-tr.html.erb
260
+ - app/views/decidim/accountability/admin/results/_results-thead.html.erb
261
+ - app/views/decidim/accountability/admin/results/bulk_actions/_dates_form.html.erb
262
+ - app/views/decidim/accountability/admin/results/bulk_actions/_dropdown.html.erb
263
+ - app/views/decidim/accountability/admin/results/bulk_actions/_status_form.html.erb
264
+ - app/views/decidim/accountability/admin/results/bulk_actions/_submit_buttons.html.erb
265
+ - app/views/decidim/accountability/admin/results/bulk_actions/_taxonomies_form.html.erb
240
266
  - app/views/decidim/accountability/admin/results/edit.html.erb
241
267
  - app/views/decidim/accountability/admin/results/index.html.erb
268
+ - app/views/decidim/accountability/admin/results/manage_trash.html.erb
242
269
  - app/views/decidim/accountability/admin/results/new.html.erb
243
270
  - app/views/decidim/accountability/admin/shared/_subnav.html.erb
244
271
  - app/views/decidim/accountability/admin/statuses/_form.html.erb
@@ -251,12 +278,11 @@ files:
251
278
  - app/views/decidim/accountability/admin/timeline_entries/new.html.erb
252
279
  - app/views/decidim/accountability/import_mailer/import.html.erb
253
280
  - app/views/decidim/accountability/import_projects_mailer/import.html.erb
254
- - app/views/decidim/accountability/results/_home_categories.html.erb
281
+ - app/views/decidim/accountability/import_proposals_mailer/import.html.erb
282
+ - app/views/decidim/accountability/results/_home_taxonomies.html.erb
255
283
  - app/views/decidim/accountability/results/_linked_results.html.erb
256
- - app/views/decidim/accountability/results/_nav_breadcrumb.html.erb
257
284
  - app/views/decidim/accountability/results/_project.html.erb
258
285
  - app/views/decidim/accountability/results/_projects_aside.html.erb
259
- - app/views/decidim/accountability/results/_scope_filters.html.erb
260
286
  - app/views/decidim/accountability/results/_search.html.erb
261
287
  - app/views/decidim/accountability/results/home.html.erb
262
288
  - app/views/decidim/accountability/results/index.html.erb
@@ -361,6 +387,8 @@ files:
361
387
  - db/migrate/20200827154103_add_commentable_counter_cache_to_results.rb
362
388
  - db/migrate/20220331150008_add_title_to_timeline_entries.rb
363
389
  - db/migrate/20220331150155_move_legacy_description_to_title_of_timeline_entries.rb
390
+ - db/migrate/20240828103202_add_deleted_at_to_decidim_accountability_results.rb
391
+ - db/migrate/20240916112128_add_geolocation_fields_to_results.rb
364
392
  - decidim-accountability.gemspec
365
393
  - lib/decidim/accountability.rb
366
394
  - lib/decidim/accountability/admin.rb
@@ -393,14 +421,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
393
421
  requirements:
394
422
  - - "~>"
395
423
  - !ruby/object:Gem::Version
396
- version: 3.2.0
424
+ version: 3.3.0
397
425
  required_rubygems_version: !ruby/object:Gem::Requirement
398
426
  requirements:
399
427
  - - ">="
400
428
  - !ruby/object:Gem::Version
401
429
  version: '0'
402
430
  requirements: []
403
- rubygems_version: 3.4.10
431
+ rubygems_version: 3.5.11
404
432
  signing_key:
405
433
  specification_version: 4
406
434
  summary: Decidim accountability module
@@ -1,37 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Accountability
5
- module Admin
6
- # A command with all the business logic when an admin imports projects from
7
- # one component to accountability.
8
- class ImportProjectsToAccountability < Decidim::Command
9
- # Public: Initializes the command.
10
- #
11
- # form - A form object with the params.
12
- def initialize(form)
13
- @form = form
14
- end
15
-
16
- def call
17
- return broadcast(:invalid) unless @form.valid?
18
-
19
- ImportProjectsJob.perform_later(projects.pluck(:id), @form.current_component, @form.current_user)
20
- broadcast(:ok, projects.count)
21
- end
22
-
23
- private
24
-
25
- def projects
26
- Decidim::Budgets::Project.joins(:budget).selected.where(
27
- budget: { component: origin_component }
28
- ).reject { |item| @form.project_already_copied?(item) }
29
- end
30
-
31
- def origin_component
32
- @form.origin_component
33
- end
34
- end
35
- end
36
- end
37
- end
@@ -1,31 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Accountability
5
- module Admin
6
- # This controller allows an admin to import results from a csv file for the Accountability component
7
- class ProjectsImportController < Admin::ApplicationController
8
- def new
9
- enforce_permission_to :create, :import_projects
10
- @form = form(Admin::ResultImportProjectsForm).instance
11
- end
12
-
13
- def create
14
- enforce_permission_to :create, :import_projects
15
- @form = form(Admin::ResultImportProjectsForm).from_params(params, accountability_component: current_component)
16
- Admin::ImportProjectsToAccountability.call(@form) do
17
- on(:ok) do |projects|
18
- flash[:notice] = I18n.t("projects_import.new.success", scope: "decidim.accountability.admin", count: projects)
19
- redirect_to results_path
20
- end
21
-
22
- on(:invalid) do
23
- flash[:alert] = I18n.t("projects_import.create.invalid", scope: "decidim.accountability.admin")
24
- render action: "new"
25
- end
26
- end
27
- end
28
- end
29
- end
30
- end
31
- end
@@ -1,51 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Accountability
5
- module Admin
6
- # A form object to be used when admin users want to import a collection of projects
7
- # from another component into Accountability component.
8
- class ResultImportProjectsForm < Decidim::Form
9
- attribute :origin_component_id, Integer
10
- attribute :import_all_selected_projects, Boolean
11
-
12
- validates :origin_component_id, presence: true
13
- validates :import_all_selected_projects, allow_nil: false, acceptance: true
14
- validates :origin_projects_count, numericality: { greater_than: 0 }, if: ->(form) { form.origin_component_id }
15
-
16
- def origin_component
17
- @origin_component ||= origin_components.find_by(id: origin_component_id)
18
- end
19
-
20
- def origin_components_collection
21
- origin_components.map do |component|
22
- [component.name[I18n.locale.to_s], component.id]
23
- end
24
- end
25
-
26
- def origin_components
27
- @budgets_component ||= current_participatory_space.components.where(manifest_name: "budgets")
28
- end
29
-
30
- def selected_projects_count(component)
31
- projects = Decidim::Budgets::Project.joins(:budget).selected.where(
32
- budget: { component: }
33
- )
34
- projects.reject { |project| project_already_copied?(project) }.count
35
- end
36
-
37
- def project_already_copied?(original_project)
38
- original_project.linked_resources(:results, "included_projects").any? do |result|
39
- result.component == current_component
40
- end
41
- end
42
-
43
- private
44
-
45
- def origin_projects_count
46
- selected_projects_count(origin_component_id)
47
- end
48
- end
49
- end
50
- end
51
- end
@@ -1,45 +0,0 @@
1
- <% add_decidim_page_title(t(".title")) %>
2
- <div class="item_show__header">
3
- <h1 class="item_show__header-title">
4
- <%= t(".title") %>
5
- </h1>
6
- </div>
7
-
8
- <div class="item__edit item__edit-1col">
9
- <div class="item__edit-form">
10
- <%= form_for(@form, url: projects_import_index_path(@accountability), html: { class: "form form-defaults import_projects" }) do |f| %>
11
- <% if @form.origin_components.any? %>
12
- <div class="form__wrapper">
13
- <div class="card pt-4">
14
- <div class="card-section">
15
- <div class="row column">
16
- <%= f.select :origin_component_id, @form.origin_components_collection, prompt: t(".select_component"), label: t(".origin_component_id") %>
17
- </div>
18
- <div class="row column">
19
- <% @form.origin_components.each do |component| %>
20
- <small id="component_<%= component.id %>" class="help-text hide
21
- <%= " form-error is-visible" if @form.selected_projects_count(component).zero? %>">
22
- <%= t(".new_items", count: @form.selected_projects_count(component)) %>
23
- </small>
24
- <% end %>
25
- </div>
26
- <div class="row column">
27
- <%= f.check_box :import_all_selected_projects, label: t(".import_all_selected_projects") %>
28
- </div>
29
- </div>
30
- </div>
31
- </div>
32
-
33
- <div class="item__edit-sticky">
34
- <div class="item__edit-sticky-container">
35
- <%= f.submit t(".create"), class: "button button__sm button__secondary" %>
36
- </div>
37
- </div>
38
- <% else %>
39
- <p><%= t(".no_components") %></p>
40
- <% end %>
41
- <% end %>
42
- </div>
43
- </div>
44
-
45
- <%= append_javascript_pack_tag "decidim_accountability_admin_imports" %>
@@ -1,37 +0,0 @@
1
- <div>
2
- <%= link_to t(".global"), root_path %>
3
- <% if component_settings.display_progress_enabled? %>
4
- <span><%= display_percentage progress_calculator(current_scope, nil) %></span>
5
- <% end %>
6
-
7
- <% if category.present? && category.parent.present? %>
8
- <span>&gt;</span>
9
- <div>
10
- <%= link_to translated_attribute(category.parent.name), results_path(filter: { with_category: category.parent_id, with_scope: current_scope }) %>
11
- <% if component_settings.display_progress_enabled? %>
12
- <span><%= display_percentage progress_calculator(current_scope, category.parent_id) %></span>
13
- <% end %>
14
- </div>
15
- <% end %>
16
-
17
- <% if category.present? %>
18
- <span>&gt;</span>
19
- <div>
20
- <%= link_to translated_attribute(category.name), results_path(filter: { with_category: category.id, with_scope: current_scope }) %>
21
- <% if component_settings.display_progress_enabled? %>
22
- <span><%= display_percentage progress_calculator(current_scope, category.id) %></span>
23
- <% end %>
24
- </div>
25
- <% end %>
26
-
27
- <% if result && result.parent.present? %>
28
- <span>&gt;</span>
29
- <div>
30
- <%= link_to translated_attribute(result.parent.title), result_path(result.parent, filter: { with_category: current_scope }) %>
31
- <% if component_settings.display_progress_enabled? %>
32
- <span><%= display_percentage result.parent.progress %></span>
33
- <% end %>
34
- </div>
35
- <% end %>
36
-
37
- </div>
@@ -1,31 +0,0 @@
1
- <% items = filter_items_for(participatory_space: current_participatory_space, category:) %>
2
- <div class="accountability__filters">
3
- <%= render partial: "search" %>
4
-
5
- <% if current_component.has_subscopes? %>
6
- <div class="filter-container">
7
- <button id="dropdown-trigger-accountability" data-component="dropdown" data-target="dropdown-menu-accountability" data-open-md="true">
8
- <% items.each do |item| %>
9
- <%= content_tag :span, class: "#{"is-active" if item[:active]}" do %>
10
- <span class="sr-only"><%= item[:sr_text] %></span>
11
- <%= icon item[:icon] %>
12
- <span><%= item[:text] %></span>
13
- <% end %>
14
- <% end %>
15
- <%= icon "arrow-down-s-line", class: "w-8 h-8 flex-none text-secondary fill-current" %>
16
- <%= icon "arrow-up-s-line", class: "w-8 h-8 flex-none text-secondary fill-current" %>
17
- </button>
18
- <ul id="dropdown-menu-accountability" data-scope-filters>
19
- <% items.each do |item| %>
20
- <li role="menuitem">
21
- <%= link_to item[:url], class: "filter#{" is-active" if item[:active]}" do %>
22
- <span class="sr-only"><%= item[:sr_text] %></span>
23
- <%= icon item[:icon] %>
24
- <span><%= item[:text] %></span>
25
- <% end %>
26
- </li>
27
- <% end %>
28
- </ul>
29
- </div>
30
- <% end %>
31
- </div>