decidim-admin 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 (236) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/admin/multi_select_picker/show.erb +10 -0
  3. data/app/cells/decidim/admin/multi_select_picker_cell.rb +38 -0
  4. data/app/commands/decidim/admin/bulk_action.rb +92 -0
  5. data/app/commands/decidim/admin/bulk_block_users.rb +75 -0
  6. data/app/commands/decidim/admin/bulk_unblock_users.rb +66 -0
  7. data/app/commands/decidim/admin/bulk_unreport_users.rb +69 -0
  8. data/app/commands/decidim/admin/content_blocks/update_content_block.rb +1 -1
  9. data/app/commands/decidim/admin/create_participatory_space_private_user.rb +3 -1
  10. data/app/commands/decidim/admin/create_share_token.rb +39 -0
  11. data/app/commands/decidim/admin/create_taxonomy.rb +23 -0
  12. data/app/commands/decidim/admin/create_taxonomy_filter.rb +24 -0
  13. data/app/commands/decidim/admin/destroy_share_token.rb +22 -0
  14. data/app/commands/decidim/admin/destroy_taxonomy.rb +18 -0
  15. data/app/commands/decidim/admin/destroy_taxonomy_filter.rb +20 -0
  16. data/app/commands/decidim/admin/hide_menu_component.rb +37 -0
  17. data/app/commands/decidim/admin/hide_resource.rb +4 -3
  18. data/app/commands/decidim/admin/publish_all_participatory_space_private_users.rb +50 -0
  19. data/app/commands/decidim/admin/publish_component.rb +3 -0
  20. data/app/commands/decidim/admin/reorder_components.rb +47 -0
  21. data/app/commands/decidim/admin/reorder_taxonomies.rb +76 -0
  22. data/app/commands/decidim/admin/unhide_resource.rb +11 -3
  23. data/app/commands/decidim/admin/unpublish_all_participatory_space_private_users.rb +50 -0
  24. data/app/commands/decidim/admin/unreport_resource.rb +11 -3
  25. data/app/commands/decidim/admin/update_component_permissions.rb +53 -13
  26. data/app/commands/decidim/admin/update_participatory_space_private_user.rb +11 -0
  27. data/app/commands/decidim/admin/update_share_token.rb +24 -0
  28. data/app/commands/decidim/admin/update_taxonomy.rb +20 -0
  29. data/app/commands/decidim/admin/update_taxonomy_filter.rb +28 -0
  30. data/app/controllers/concerns/decidim/admin/component_taxonomies_helper.rb +19 -0
  31. data/app/controllers/concerns/decidim/admin/filterable.rb +15 -18
  32. data/app/controllers/concerns/decidim/admin/has_trashable_resources.rb +170 -0
  33. data/app/controllers/concerns/decidim/admin/needs_admin_tos_accepted.rb +2 -29
  34. data/app/controllers/concerns/decidim/admin/participatory_space_admin_context.rb +12 -2
  35. data/app/controllers/concerns/decidim/admin/taxonomies/filterable.rb +27 -0
  36. data/app/controllers/decidim/admin/application_controller.rb +1 -2
  37. data/app/controllers/decidim/admin/areas_controller.rb +1 -0
  38. data/app/controllers/decidim/admin/block_user_controller.rb +42 -0
  39. data/app/controllers/decidim/admin/component_permissions_controller.rb +2 -4
  40. data/app/controllers/decidim/admin/components_controller.rb +50 -9
  41. data/app/controllers/decidim/admin/concerns/has_private_users.rb +59 -2
  42. data/app/controllers/decidim/admin/global_moderations_controller.rb +4 -0
  43. data/app/controllers/decidim/admin/moderated_users_controller.rb +26 -0
  44. data/app/controllers/decidim/admin/moderations_controller.rb +18 -0
  45. data/app/controllers/decidim/admin/newsletters_controller.rb +50 -7
  46. data/app/controllers/decidim/admin/resource_permissions_controller.rb +1 -1
  47. data/app/controllers/decidim/admin/scopes_controller.rb +1 -0
  48. data/app/controllers/decidim/admin/share_tokens_controller.rb +109 -7
  49. data/app/controllers/decidim/admin/taxonomies_controller.rb +129 -0
  50. data/app/controllers/decidim/admin/taxonomy_filters_controller.rb +112 -0
  51. data/app/controllers/decidim/admin/taxonomy_filters_selector_controller.rb +81 -0
  52. data/app/controllers/decidim/admin/taxonomy_items_controller.rb +91 -0
  53. data/app/forms/concerns/decidim/has_taxonomy_form_attributes.rb +57 -0
  54. data/app/forms/decidim/admin/block_users_form.rb +21 -0
  55. data/app/forms/decidim/admin/import_example_form.rb +1 -1
  56. data/app/forms/decidim/admin/newsletter_form.rb +1 -1
  57. data/app/forms/decidim/admin/participatory_space_private_user_form.rb +5 -0
  58. data/app/forms/decidim/admin/selective_newsletter_form.rb +46 -11
  59. data/app/forms/decidim/admin/share_token_form.rb +55 -0
  60. data/app/forms/decidim/admin/taxonomy_filter_form.rb +85 -0
  61. data/app/forms/decidim/admin/taxonomy_form.rb +20 -0
  62. data/app/forms/decidim/admin/taxonomy_item_form.rb +54 -0
  63. data/app/helpers/decidim/admin/application_helper.rb +0 -1
  64. data/app/helpers/decidim/admin/bulk_actions_helper.rb +0 -31
  65. data/app/helpers/decidim/admin/moderations/reports_helper.rb +1 -1
  66. data/app/helpers/decidim/admin/moderations_helper.rb +1 -1
  67. data/app/helpers/decidim/admin/newsletters_helper.rb +57 -27
  68. data/app/helpers/decidim/admin/scopes_helper.rb +0 -6
  69. data/app/helpers/decidim/admin/search_form_helper.rb +1 -1
  70. data/app/helpers/decidim/admin/settings_helper.rb +85 -11
  71. data/app/jobs/decidim/admin/newsletter_job.rb +3 -1
  72. data/app/packs/entrypoints/decidim_admin.js +4 -0
  73. data/app/packs/src/decidim/admin/application.js +2 -0
  74. data/app/packs/src/decidim/admin/draggable-table.js +33 -0
  75. data/app/packs/src/decidim/admin/form.js +0 -1
  76. data/app/packs/src/decidim/admin/global_moderations.js +186 -0
  77. data/app/packs/src/decidim/admin/managed_moderated_users.js +186 -0
  78. data/app/packs/src/decidim/admin/newsletters.js +164 -82
  79. data/app/packs/src/decidim/admin/proposal_infinite_edit.js +3 -6
  80. data/app/packs/src/decidim/admin/sortable.js +28 -16
  81. data/app/packs/src/decidim/admin/taxonomy_filters.js +93 -0
  82. data/app/packs/stylesheets/decidim/admin/_component-show.scss +66 -5
  83. data/app/packs/stylesheets/decidim/admin/_legacy_foundation.scss +13 -0
  84. data/app/packs/stylesheets/decidim/admin/_select_picker.scss +20 -0
  85. data/app/packs/stylesheets/decidim/admin/_table-list.scss +22 -0
  86. data/app/packs/stylesheets/decidim/admin/_taxonomies.scss +74 -0
  87. data/app/packs/stylesheets/decidim/admin/application.scss +3 -0
  88. data/app/permissions/decidim/admin/permissions.rb +32 -1
  89. data/app/queries/decidim/admin/newsletter_recipients.rb +50 -14
  90. data/app/views/decidim/admin/areas/index.html.erb +3 -0
  91. data/app/views/decidim/admin/block_user/bulk_new.html.erb +45 -0
  92. data/app/views/decidim/admin/components/_actions.html.erb +50 -33
  93. data/app/views/decidim/admin/components/{_component.html.erb → _component_row.html.erb} +10 -5
  94. data/app/views/decidim/admin/components/_components_table.html.erb +18 -0
  95. data/app/views/decidim/admin/components/_form.html.erb +0 -12
  96. data/app/views/decidim/admin/components/_taxonomy_filters_drawer.html.erb +2 -0
  97. data/app/views/decidim/admin/components/_visibility_label.html.erb +9 -0
  98. data/app/views/decidim/admin/components/index.html.erb +12 -14
  99. data/app/views/decidim/admin/components/manage_trash.html.erb +11 -0
  100. data/app/views/decidim/admin/moderated_users/_bulk-actions.html.erb +6 -0
  101. data/app/views/decidim/admin/moderated_users/bulk_actions/_block.html.erb +20 -0
  102. data/app/views/decidim/admin/moderated_users/bulk_actions/_dropdown.html.erb +40 -0
  103. data/app/views/decidim/admin/moderated_users/bulk_actions/_unblock.html.erb +20 -0
  104. data/app/views/decidim/admin/moderated_users/bulk_actions/_unreport.html.erb +20 -0
  105. data/app/views/decidim/admin/moderated_users/index.html.erb +14 -6
  106. data/app/views/decidim/admin/moderations/_bulk-actions.html.erb +7 -0
  107. data/app/views/decidim/admin/moderations/_moderation-tr.html.erb +50 -0
  108. data/app/views/decidim/admin/moderations/_moderations-thead.html.erb +18 -0
  109. data/app/views/decidim/admin/moderations/bulk_actions/_dropdown.html.erb +43 -0
  110. data/app/views/decidim/admin/moderations/bulk_actions/_hide.html.erb +20 -0
  111. data/app/views/decidim/admin/moderations/bulk_actions/_unhide.html.erb +20 -0
  112. data/app/views/decidim/admin/moderations/bulk_actions/_unreport.html.erb +20 -0
  113. data/app/views/decidim/admin/moderations/index.html.erb +13 -81
  114. data/app/views/decidim/admin/newsletters/confirm_recipients.html.erb +64 -0
  115. data/app/views/decidim/admin/newsletters/select_recipients_to_deliver.html.erb +44 -20
  116. data/app/views/decidim/admin/participatory_space_private_users/_form.html.erb +6 -0
  117. data/app/views/decidim/admin/participatory_space_private_users/edit.html.erb +19 -0
  118. data/app/views/decidim/admin/participatory_space_private_users/index.html.erb +15 -1
  119. data/app/views/decidim/admin/resource_permissions/_options_form.html.erb +5 -0
  120. data/app/views/decidim/admin/resource_permissions/edit.html.erb +2 -2
  121. data/app/views/decidim/admin/scope_types/index.html.erb +3 -0
  122. data/app/views/decidim/admin/scopes/index.html.erb +3 -0
  123. data/app/views/decidim/admin/share_tokens/_form.html.erb +52 -0
  124. data/app/views/decidim/admin/share_tokens/edit.html.erb +33 -0
  125. data/app/views/decidim/admin/share_tokens/index.html.erb +47 -0
  126. data/app/views/decidim/admin/share_tokens/new.html.erb +69 -0
  127. data/app/views/decidim/admin/taxonomies/_filters.html.erb +19 -0
  128. data/app/views/decidim/admin/taxonomies/_form.html.erb +5 -0
  129. data/app/views/decidim/admin/taxonomies/_row.html.erb +40 -0
  130. data/app/views/decidim/admin/taxonomies/_row_children.html.erb +8 -0
  131. data/app/views/decidim/admin/taxonomies/_table.html.erb +86 -0
  132. data/app/views/decidim/admin/taxonomies/_taxonomy_actions.html.erb +15 -0
  133. data/app/views/decidim/admin/taxonomies/edit.html.erb +87 -0
  134. data/app/views/decidim/admin/taxonomies/index.html.erb +28 -0
  135. data/app/views/decidim/admin/taxonomies/new.html.erb +16 -0
  136. data/app/views/decidim/admin/taxonomy_filters/_check_boxes.html.erb +10 -0
  137. data/app/views/decidim/admin/taxonomy_filters/_form.html.erb +96 -0
  138. data/app/views/decidim/admin/taxonomy_filters/_table.html.erb +33 -0
  139. data/app/views/decidim/admin/taxonomy_filters/edit.html.erb +22 -0
  140. data/app/views/decidim/admin/taxonomy_filters/index.html.erb +26 -0
  141. data/app/views/decidim/admin/taxonomy_filters/new.html.erb +32 -0
  142. data/app/views/decidim/admin/taxonomy_filters_selector/_check_boxes.html.erb +7 -0
  143. data/app/views/decidim/admin/taxonomy_filters_selector/_component_table.html.erb +25 -0
  144. data/app/views/decidim/admin/taxonomy_filters_selector/_taxonomies_select.html.erb +16 -0
  145. data/app/views/decidim/admin/taxonomy_filters_selector/index.html.erb +1 -0
  146. data/app/views/decidim/admin/taxonomy_filters_selector/new.html.erb +27 -0
  147. data/app/views/decidim/admin/taxonomy_filters_selector/show.html.erb +18 -0
  148. data/app/views/decidim/admin/taxonomy_items/_form.html.erb +8 -0
  149. data/app/views/decidim/admin/taxonomy_items/edit.html.erb +12 -0
  150. data/app/views/decidim/admin/taxonomy_items/new.html.erb +12 -0
  151. data/app/views/layouts/decidim/admin/taxonomy_filters.html.erb +17 -0
  152. data/app/views/layouts/decidim/admin/taxonomy_filters_selector.html.erb +10 -0
  153. data/config/locales/ar.yml +45 -37
  154. data/config/locales/bg.yml +48 -51
  155. data/config/locales/bs-BA.yml +1 -27
  156. data/config/locales/ca.yml +301 -50
  157. data/config/locales/cs.yml +299 -46
  158. data/config/locales/de.yml +301 -50
  159. data/config/locales/el.yml +1 -50
  160. data/config/locales/en.yml +301 -50
  161. data/config/locales/es-MX.yml +298 -47
  162. data/config/locales/es-PY.yml +298 -47
  163. data/config/locales/es.yml +298 -47
  164. data/config/locales/eu.yml +302 -51
  165. data/config/locales/fi-plain.yml +298 -47
  166. data/config/locales/fi.yml +298 -47
  167. data/config/locales/fr-CA.yml +184 -47
  168. data/config/locales/fr.yml +184 -47
  169. data/config/locales/ga-IE.yml +0 -23
  170. data/config/locales/gl.yml +1 -46
  171. data/config/locales/hu.yml +1 -51
  172. data/config/locales/id-ID.yml +0 -24
  173. data/config/locales/is-IS.yml +0 -30
  174. data/config/locales/it.yml +2 -46
  175. data/config/locales/ja.yml +299 -50
  176. data/config/locales/kaa.yml +0 -7
  177. data/config/locales/ko.yml +0 -50
  178. data/config/locales/lb.yml +1 -46
  179. data/config/locales/lt.yml +1 -50
  180. data/config/locales/lv.yml +1 -28
  181. data/config/locales/nl.yml +1 -46
  182. data/config/locales/no.yml +1 -46
  183. data/config/locales/pl.yml +3 -51
  184. data/config/locales/pt-BR.yml +38 -50
  185. data/config/locales/pt.yml +29 -49
  186. data/config/locales/ro-RO.yml +38 -52
  187. data/config/locales/ru.yml +1 -24
  188. data/config/locales/sk.yml +1 -28
  189. data/config/locales/sl.yml +0 -5
  190. data/config/locales/sq-AL.yml +0 -22
  191. data/config/locales/sr-CS.yml +1 -27
  192. data/config/locales/sv.yml +296 -46
  193. data/config/locales/th-TH.yml +0 -10
  194. data/config/locales/tr-TR.yml +1 -44
  195. data/config/locales/uk.yml +0 -23
  196. data/config/locales/zh-CN.yml +0 -38
  197. data/config/locales/zh-TW.yml +1 -50
  198. data/config/routes.rb +13 -12
  199. data/decidim-admin.gemspec +1 -1
  200. data/lib/decidim/admin/engine.rb +2 -1
  201. data/lib/decidim/admin/import/creator.rb +2 -6
  202. data/lib/decidim/admin/import/readers/json.rb +1 -1
  203. data/lib/decidim/admin/menu.rb +9 -1
  204. data/lib/decidim/admin/search_form_builder.rb +1 -1
  205. data/lib/decidim/admin/test/destroy_admin_examples.rb +2 -2
  206. data/lib/decidim/admin/test/filterable_examples.rb +100 -9
  207. data/lib/decidim/admin/test/forms/attachment_collection_form_examples.rb +1 -1
  208. data/lib/decidim/admin/test/forms/attachment_form_examples.rb +1 -1
  209. data/lib/decidim/admin/test/invite_participatory_space_admins_shared_examples.rb +2 -4
  210. data/lib/decidim/admin/test/manage_component_permissions_examples.rb +5 -5
  211. data/lib/decidim/admin/test/manage_hide_content_examples.rb +0 -1
  212. data/lib/decidim/admin/test/manage_moderations_examples.rb +3 -3
  213. data/lib/decidim/admin/test/manage_resource_soft_deletion_examples.rb +113 -0
  214. data/lib/decidim/admin/test/manage_taxonomy_filters_examples.rb +127 -0
  215. data/lib/decidim/admin/test/taxonomy_filters_examples.rb +32 -0
  216. data/lib/decidim/admin/test.rb +3 -1
  217. data/lib/decidim/admin/version.rb +1 -1
  218. metadata +103 -29
  219. data/app/commands/decidim/admin/create_category.rb +0 -15
  220. data/app/commands/decidim/admin/destroy_category.rb +0 -15
  221. data/app/commands/decidim/admin/destroy_component.rb +0 -19
  222. data/app/commands/decidim/admin/update_category.rb +0 -11
  223. data/app/controllers/decidim/admin/categories_controller.rb +0 -98
  224. data/app/forms/decidim/admin/category_form.rb +0 -32
  225. data/app/helpers/decidim/admin/resource_scope_helper.rb +0 -52
  226. data/app/packs/src/decidim/admin/scope_picker_enabler.component.js +0 -12
  227. data/app/views/decidim/admin/categories/_form.html.erb +0 -18
  228. data/app/views/decidim/admin/categories/edit.html.erb +0 -19
  229. data/app/views/decidim/admin/categories/index.html.erb +0 -65
  230. data/app/views/decidim/admin/categories/new.html.erb +0 -19
  231. data/app/views/decidim/admin/share_tokens/_share_tokens.html.erb +0 -45
  232. data/lib/decidim/admin/test/commands/create_category_examples.rb +0 -74
  233. data/lib/decidim/admin/test/commands/destroy_category_examples.rb +0 -83
  234. data/lib/decidim/admin/test/commands/update_category_examples.rb +0 -76
  235. data/lib/decidim/admin/test/forms/category_form_examples.rb +0 -70
  236. data/lib/decidim/admin/test/manage_categories_examples.rb +0 -128
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-admin
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: active_link_to
@@ -32,14 +32,14 @@ dependencies:
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: devise
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -94,28 +94,28 @@ dependencies:
94
94
  requirements:
95
95
  - - '='
96
96
  - !ruby/object:Gem::Version
97
- version: 0.29.2
97
+ version: 0.30.0.rc2
98
98
  type: :development
99
99
  prerelease: false
100
100
  version_requirements: !ruby/object:Gem::Requirement
101
101
  requirements:
102
102
  - - '='
103
103
  - !ruby/object:Gem::Version
104
- version: 0.29.2
104
+ version: 0.30.0.rc2
105
105
  - !ruby/object:Gem::Dependency
106
106
  name: decidim-participatory_processes
107
107
  requirement: !ruby/object:Gem::Requirement
108
108
  requirements:
109
109
  - - '='
110
110
  - !ruby/object:Gem::Version
111
- version: 0.29.2
111
+ version: 0.30.0.rc2
112
112
  type: :development
113
113
  prerelease: false
114
114
  version_requirements: !ruby/object:Gem::Requirement
115
115
  requirements:
116
116
  - - '='
117
117
  - !ruby/object:Gem::Version
118
- version: 0.29.2
118
+ version: 0.30.0.rc2
119
119
  description: Organization administration to manage a single organization.
120
120
  email:
121
121
  - josepjaume@gmail.com
@@ -132,10 +132,16 @@ files:
132
132
  - app/cells/decidim/admin/content_block/show.erb
133
133
  - app/cells/decidim/admin/content_block_cell.rb
134
134
  - app/cells/decidim/admin/homepage_content_block_cell.rb
135
+ - app/cells/decidim/admin/multi_select_picker/show.erb
136
+ - app/cells/decidim/admin/multi_select_picker_cell.rb
135
137
  - app/cells/decidim/admin/results_per_page/show.erb
136
138
  - app/cells/decidim/admin/results_per_page_cell.rb
137
139
  - app/cells/decidim/admin/static_page_content_block_cell.rb
138
140
  - app/commands/decidim/admin/block_user.rb
141
+ - app/commands/decidim/admin/bulk_action.rb
142
+ - app/commands/decidim/admin/bulk_block_users.rb
143
+ - app/commands/decidim/admin/bulk_unblock_users.rb
144
+ - app/commands/decidim/admin/bulk_unreport_users.rb
139
145
  - app/commands/decidim/admin/close_session_managed_user.rb
140
146
  - app/commands/decidim/admin/content_blocks/create_content_block.rb
141
147
  - app/commands/decidim/admin/content_blocks/destroy_content_block.rb
@@ -145,7 +151,6 @@ files:
145
151
  - app/commands/decidim/admin/create_area_type.rb
146
152
  - app/commands/decidim/admin/create_attachment.rb
147
153
  - app/commands/decidim/admin/create_attachment_collection.rb
148
- - app/commands/decidim/admin/create_category.rb
149
154
  - app/commands/decidim/admin/create_component.rb
150
155
  - app/commands/decidim/admin/create_import.rb
151
156
  - app/commands/decidim/admin/create_import_example.rb
@@ -153,15 +158,20 @@ files:
153
158
  - app/commands/decidim/admin/create_participatory_space_private_user.rb
154
159
  - app/commands/decidim/admin/create_scope.rb
155
160
  - app/commands/decidim/admin/create_scope_type.rb
161
+ - app/commands/decidim/admin/create_share_token.rb
156
162
  - app/commands/decidim/admin/create_static_page.rb
157
163
  - app/commands/decidim/admin/create_static_page_topic.rb
164
+ - app/commands/decidim/admin/create_taxonomy.rb
165
+ - app/commands/decidim/admin/create_taxonomy_filter.rb
158
166
  - app/commands/decidim/admin/deliver_newsletter.rb
159
167
  - app/commands/decidim/admin/destroy_area.rb
160
- - app/commands/decidim/admin/destroy_category.rb
161
- - app/commands/decidim/admin/destroy_component.rb
162
168
  - app/commands/decidim/admin/destroy_newsletter.rb
163
169
  - app/commands/decidim/admin/destroy_participatory_space_private_user.rb
164
170
  - app/commands/decidim/admin/destroy_scope.rb
171
+ - app/commands/decidim/admin/destroy_share_token.rb
172
+ - app/commands/decidim/admin/destroy_taxonomy.rb
173
+ - app/commands/decidim/admin/destroy_taxonomy_filter.rb
174
+ - app/commands/decidim/admin/hide_menu_component.rb
165
175
  - app/commands/decidim/admin/hide_resource.rb
166
176
  - app/commands/decidim/admin/impersonate_user.rb
167
177
  - app/commands/decidim/admin/invite_admin.rb
@@ -174,13 +184,17 @@ files:
174
184
  - app/commands/decidim/admin/process_participatory_space_private_user_import_csv.rb
175
185
  - app/commands/decidim/admin/process_user_group_verification_csv.rb
176
186
  - app/commands/decidim/admin/promote_managed_user.rb
187
+ - app/commands/decidim/admin/publish_all_participatory_space_private_users.rb
177
188
  - app/commands/decidim/admin/publish_component.rb
178
189
  - app/commands/decidim/admin/reject_user_group.rb
179
190
  - app/commands/decidim/admin/remove_admin.rb
191
+ - app/commands/decidim/admin/reorder_components.rb
192
+ - app/commands/decidim/admin/reorder_taxonomies.rb
180
193
  - app/commands/decidim/admin/transfer_user.rb
181
194
  - app/commands/decidim/admin/unblock_user.rb
182
195
  - app/commands/decidim/admin/unhide_resource.rb
183
196
  - app/commands/decidim/admin/unofficialize_user.rb
197
+ - app/commands/decidim/admin/unpublish_all_participatory_space_private_users.rb
184
198
  - app/commands/decidim/admin/unpublish_component.rb
185
199
  - app/commands/decidim/admin/unreport_resource.rb
186
200
  - app/commands/decidim/admin/unreport_user.rb
@@ -188,7 +202,6 @@ files:
188
202
  - app/commands/decidim/admin/update_area_type.rb
189
203
  - app/commands/decidim/admin/update_attachment.rb
190
204
  - app/commands/decidim/admin/update_attachment_collection.rb
191
- - app/commands/decidim/admin/update_category.rb
192
205
  - app/commands/decidim/admin/update_component.rb
193
206
  - app/commands/decidim/admin/update_component_permissions.rb
194
207
  - app/commands/decidim/admin/update_external_domain_allowlist.rb
@@ -197,24 +210,31 @@ files:
197
210
  - app/commands/decidim/admin/update_organization.rb
198
211
  - app/commands/decidim/admin/update_organization_appearance.rb
199
212
  - app/commands/decidim/admin/update_organization_tos_version.rb
213
+ - app/commands/decidim/admin/update_participatory_space_private_user.rb
200
214
  - app/commands/decidim/admin/update_resource_permissions.rb
201
215
  - app/commands/decidim/admin/update_scope.rb
202
216
  - app/commands/decidim/admin/update_scope_type.rb
217
+ - app/commands/decidim/admin/update_share_token.rb
203
218
  - app/commands/decidim/admin/update_static_page.rb
204
219
  - app/commands/decidim/admin/update_static_page_topic.rb
220
+ - app/commands/decidim/admin/update_taxonomy.rb
221
+ - app/commands/decidim/admin/update_taxonomy_filter.rb
205
222
  - app/commands/decidim/admin/update_user_groups.rb
206
223
  - app/commands/decidim/admin/verify_user_group.rb
207
224
  - app/constraints/decidim/admin/organization_dashboard_constraint.rb
225
+ - app/controllers/concerns/decidim/admin/component_taxonomies_helper.rb
208
226
  - app/controllers/concerns/decidim/admin/content_blocks/landing_page.rb
209
227
  - app/controllers/concerns/decidim/admin/content_blocks/landing_page_content_blocks.rb
210
228
  - app/controllers/concerns/decidim/admin/filterable.rb
211
229
  - app/controllers/concerns/decidim/admin/global_moderation_context.rb
230
+ - app/controllers/concerns/decidim/admin/has_trashable_resources.rb
212
231
  - app/controllers/concerns/decidim/admin/logs/filterable.rb
213
232
  - app/controllers/concerns/decidim/admin/needs_admin_tos_accepted.rb
214
233
  - app/controllers/concerns/decidim/admin/officializations/filterable.rb
215
234
  - app/controllers/concerns/decidim/admin/participatory_space_admin_breadcrumb.rb
216
235
  - app/controllers/concerns/decidim/admin/participatory_space_admin_context.rb
217
236
  - app/controllers/concerns/decidim/admin/participatory_space_export.rb
237
+ - app/controllers/concerns/decidim/admin/taxonomies/filterable.rb
218
238
  - app/controllers/concerns/decidim/admin/user_groups.rb
219
239
  - app/controllers/concerns/decidim/admin/user_groups/filterable.rb
220
240
  - app/controllers/concerns/decidim/admin/verification_conflicts/filterable.rb
@@ -227,7 +247,6 @@ files:
227
247
  - app/controllers/decidim/admin/areas_controller.rb
228
248
  - app/controllers/decidim/admin/authorization_workflows_controller.rb
229
249
  - app/controllers/decidim/admin/block_user_controller.rb
230
- - app/controllers/decidim/admin/categories_controller.rb
231
250
  - app/controllers/decidim/admin/component_permissions_controller.rb
232
251
  - app/controllers/decidim/admin/components/base_controller.rb
233
252
  - app/controllers/decidim/admin/components_controller.rb
@@ -272,18 +291,23 @@ files:
272
291
  - app/controllers/decidim/admin/static_page_content_blocks_controller.rb
273
292
  - app/controllers/decidim/admin/static_page_topics_controller.rb
274
293
  - app/controllers/decidim/admin/static_pages_controller.rb
294
+ - app/controllers/decidim/admin/taxonomies_controller.rb
295
+ - app/controllers/decidim/admin/taxonomy_filters_controller.rb
296
+ - app/controllers/decidim/admin/taxonomy_filters_selector_controller.rb
297
+ - app/controllers/decidim/admin/taxonomy_items_controller.rb
275
298
  - app/controllers/decidim/admin/user_groups_controller.rb
276
299
  - app/controllers/decidim/admin/user_groups_csv_verifications_controller.rb
277
300
  - app/controllers/decidim/admin/users_controller.rb
278
301
  - app/events/decidim/attachment_created_event.rb
279
302
  - app/events/decidim/component_published_event.rb
280
303
  - app/events/decidim/resource_hidden_event.rb
304
+ - app/forms/concerns/decidim/has_taxonomy_form_attributes.rb
281
305
  - app/forms/decidim/admin/area_form.rb
282
306
  - app/forms/decidim/admin/area_type_form.rb
283
307
  - app/forms/decidim/admin/attachment_collection_form.rb
284
308
  - app/forms/decidim/admin/attachment_form.rb
285
309
  - app/forms/decidim/admin/block_user_form.rb
286
- - app/forms/decidim/admin/category_form.rb
310
+ - app/forms/decidim/admin/block_users_form.rb
287
311
  - app/forms/decidim/admin/component_form.rb
288
312
  - app/forms/decidim/admin/content_block_form.rb
289
313
  - app/forms/decidim/admin/external_domain_form.rb
@@ -307,8 +331,12 @@ files:
307
331
  - app/forms/decidim/admin/scope_type_form.rb
308
332
  - app/forms/decidim/admin/selective_newsletter_form.rb
309
333
  - app/forms/decidim/admin/selective_newsletter_participatory_space_type_form.rb
334
+ - app/forms/decidim/admin/share_token_form.rb
310
335
  - app/forms/decidim/admin/static_page_form.rb
311
336
  - app/forms/decidim/admin/static_page_topic_form.rb
337
+ - app/forms/decidim/admin/taxonomy_filter_form.rb
338
+ - app/forms/decidim/admin/taxonomy_form.rb
339
+ - app/forms/decidim/admin/taxonomy_item_form.rb
312
340
  - app/forms/decidim/admin/transfer_user_form.rb
313
341
  - app/forms/decidim/admin/user_group_csv_verification_form.rb
314
342
  - app/helpers/decidim/admin/admin_terms_helper.rb
@@ -330,7 +358,6 @@ files:
330
358
  - app/helpers/decidim/admin/newsletters_helper.rb
331
359
  - app/helpers/decidim/admin/reminders_helper.rb
332
360
  - app/helpers/decidim/admin/resource_permissions_helper.rb
333
- - app/helpers/decidim/admin/resource_scope_helper.rb
334
361
  - app/helpers/decidim/admin/scopes_helper.rb
335
362
  - app/helpers/decidim/admin/search_form_helper.rb
336
363
  - app/helpers/decidim/admin/settings_helper.rb
@@ -356,10 +383,13 @@ files:
356
383
  - app/packs/src/decidim/admin/choose_language.js
357
384
  - app/packs/src/decidim/admin/css_preview.js
358
385
  - app/packs/src/decidim/admin/draggable-list.js
386
+ - app/packs/src/decidim/admin/draggable-table.js
359
387
  - app/packs/src/decidim/admin/dynamic_fields.component.js
360
388
  - app/packs/src/decidim/admin/external_domain_allowlist.js
361
389
  - app/packs/src/decidim/admin/field_dependent_inputs.component.js
362
390
  - app/packs/src/decidim/admin/form.js
391
+ - app/packs/src/decidim/admin/global_moderations.js
392
+ - app/packs/src/decidim/admin/managed_moderated_users.js
363
393
  - app/packs/src/decidim/admin/managed_users.js
364
394
  - app/packs/src/decidim/admin/moderations.js
365
395
  - app/packs/src/decidim/admin/newsletters.js
@@ -367,13 +397,13 @@ files:
367
397
  - app/packs/src/decidim/admin/participatory_space_search.js
368
398
  - app/packs/src/decidim/admin/proposal_infinite_edit.js
369
399
  - app/packs/src/decidim/admin/resources_permissions.js
370
- - app/packs/src/decidim/admin/scope_picker_enabler.component.js
371
400
  - app/packs/src/decidim/admin/sort_list.component.js
372
401
  - app/packs/src/decidim/admin/sortable.js
373
402
  - app/packs/src/decidim/admin/subform_multi_toggler.component.js
374
403
  - app/packs/src/decidim/admin/subform_toggler.component.js
375
404
  - app/packs/src/decidim/admin/sync_radio_buttons.js
376
405
  - app/packs/src/decidim/admin/tab_focus.js
406
+ - app/packs/src/decidim/admin/taxonomy_filters.js
377
407
  - app/packs/src/decidim/admin/text_copy.js
378
408
  - app/packs/src/decidim/admin/toggle_nav.js
379
409
  - app/packs/src/decidim/admin/triadic_color_picker.js
@@ -397,10 +427,12 @@ files:
397
427
  - app/packs/stylesheets/decidim/admin/_moderations.scss
398
428
  - app/packs/stylesheets/decidim/admin/_proposal_status.scss
399
429
  - app/packs/stylesheets/decidim/admin/_secondary-nav.scss
430
+ - app/packs/stylesheets/decidim/admin/_select_picker.scss
400
431
  - app/packs/stylesheets/decidim/admin/_show_email.scss
401
432
  - app/packs/stylesheets/decidim/admin/_sidebar-menu.scss
402
433
  - app/packs/stylesheets/decidim/admin/_table-list.scss
403
434
  - app/packs/stylesheets/decidim/admin/_tabs.scss
435
+ - app/packs/stylesheets/decidim/admin/_taxonomies.scss
404
436
  - app/packs/stylesheets/decidim/admin/_title-bar.scss
405
437
  - app/packs/stylesheets/decidim/admin/_user-login.scss
406
438
  - app/packs/stylesheets/decidim/admin/application.scss
@@ -435,18 +467,19 @@ files:
435
467
  - app/views/decidim/admin/attachments/index.html.erb
436
468
  - app/views/decidim/admin/attachments/new.html.erb
437
469
  - app/views/decidim/admin/authorization_workflows/index.html.erb
470
+ - app/views/decidim/admin/block_user/bulk_new.html.erb
438
471
  - app/views/decidim/admin/block_user/new.html.erb
439
- - app/views/decidim/admin/categories/_form.html.erb
440
- - app/views/decidim/admin/categories/edit.html.erb
441
- - app/views/decidim/admin/categories/index.html.erb
442
- - app/views/decidim/admin/categories/new.html.erb
443
472
  - app/views/decidim/admin/components/_actions.html.erb
444
- - app/views/decidim/admin/components/_component.html.erb
473
+ - app/views/decidim/admin/components/_component_row.html.erb
474
+ - app/views/decidim/admin/components/_components_table.html.erb
445
475
  - app/views/decidim/admin/components/_form.html.erb
446
476
  - app/views/decidim/admin/components/_resource_action.html.erb
447
477
  - app/views/decidim/admin/components/_settings_fields.html.erb
478
+ - app/views/decidim/admin/components/_taxonomy_filters_drawer.html.erb
479
+ - app/views/decidim/admin/components/_visibility_label.html.erb
448
480
  - app/views/decidim/admin/components/edit.html.erb
449
481
  - app/views/decidim/admin/components/index.html.erb
482
+ - app/views/decidim/admin/components/manage_trash.html.erb
450
483
  - app/views/decidim/admin/components/new.html.erb
451
484
  - app/views/decidim/admin/conflicts/edit.html.erb
452
485
  - app/views/decidim/admin/conflicts/index.html.erb
@@ -472,15 +505,28 @@ files:
472
505
  - app/views/decidim/admin/managed_users/promotions/new.html.erb
473
506
  - app/views/decidim/admin/metrics/_metrics.html.erb
474
507
  - app/views/decidim/admin/metrics/index.html.erb
508
+ - app/views/decidim/admin/moderated_users/_bulk-actions.html.erb
475
509
  - app/views/decidim/admin/moderated_users/_report.html.erb
510
+ - app/views/decidim/admin/moderated_users/bulk_actions/_block.html.erb
511
+ - app/views/decidim/admin/moderated_users/bulk_actions/_dropdown.html.erb
512
+ - app/views/decidim/admin/moderated_users/bulk_actions/_unblock.html.erb
513
+ - app/views/decidim/admin/moderated_users/bulk_actions/_unreport.html.erb
476
514
  - app/views/decidim/admin/moderated_users/index.html.erb
515
+ - app/views/decidim/admin/moderations/_bulk-actions.html.erb
516
+ - app/views/decidim/admin/moderations/_moderation-tr.html.erb
517
+ - app/views/decidim/admin/moderations/_moderations-thead.html.erb
477
518
  - app/views/decidim/admin/moderations/_report.html.erb
519
+ - app/views/decidim/admin/moderations/bulk_actions/_dropdown.html.erb
520
+ - app/views/decidim/admin/moderations/bulk_actions/_hide.html.erb
521
+ - app/views/decidim/admin/moderations/bulk_actions/_unhide.html.erb
522
+ - app/views/decidim/admin/moderations/bulk_actions/_unreport.html.erb
478
523
  - app/views/decidim/admin/moderations/index.html.erb
479
524
  - app/views/decidim/admin/moderations/reports/index.html.erb
480
525
  - app/views/decidim/admin/moderations/reports/show.html.erb
481
526
  - app/views/decidim/admin/newsletter_templates/index.html.erb
482
527
  - app/views/decidim/admin/newsletter_templates/show.html.erb
483
528
  - app/views/decidim/admin/newsletters/_form.html.erb
529
+ - app/views/decidim/admin/newsletters/confirm_recipients.html.erb
484
530
  - app/views/decidim/admin/newsletters/edit.html.erb
485
531
  - app/views/decidim/admin/newsletters/index.html.erb
486
532
  - app/views/decidim/admin/newsletters/new.html.erb
@@ -502,6 +548,7 @@ files:
502
548
  - app/views/decidim/admin/organization_external_domain_allowlist/_form.html.erb
503
549
  - app/views/decidim/admin/organization_external_domain_allowlist/edit.html.erb
504
550
  - app/views/decidim/admin/participatory_space_private_users/_form.html.erb
551
+ - app/views/decidim/admin/participatory_space_private_users/edit.html.erb
505
552
  - app/views/decidim/admin/participatory_space_private_users/index.html.erb
506
553
  - app/views/decidim/admin/participatory_space_private_users/new.html.erb
507
554
  - app/views/decidim/admin/participatory_space_private_users_csv_imports/new.html.erb
@@ -516,7 +563,10 @@ files:
516
563
  - app/views/decidim/admin/scopes/edit.html.erb
517
564
  - app/views/decidim/admin/scopes/index.html.erb
518
565
  - app/views/decidim/admin/scopes/new.html.erb
519
- - app/views/decidim/admin/share_tokens/_share_tokens.html.erb
566
+ - app/views/decidim/admin/share_tokens/_form.html.erb
567
+ - app/views/decidim/admin/share_tokens/edit.html.erb
568
+ - app/views/decidim/admin/share_tokens/index.html.erb
569
+ - app/views/decidim/admin/share_tokens/new.html.erb
520
570
  - app/views/decidim/admin/shared/_adjacent_navigation.html.erb
521
571
  - app/views/decidim/admin/shared/_admin_confirm_modal.html.erb
522
572
  - app/views/decidim/admin/shared/_filters.html.erb
@@ -535,6 +585,30 @@ files:
535
585
  - app/views/decidim/admin/static_pages/edit.html.erb
536
586
  - app/views/decidim/admin/static_pages/index.html.erb
537
587
  - app/views/decidim/admin/static_pages/new.html.erb
588
+ - app/views/decidim/admin/taxonomies/_filters.html.erb
589
+ - app/views/decidim/admin/taxonomies/_form.html.erb
590
+ - app/views/decidim/admin/taxonomies/_row.html.erb
591
+ - app/views/decidim/admin/taxonomies/_row_children.html.erb
592
+ - app/views/decidim/admin/taxonomies/_table.html.erb
593
+ - app/views/decidim/admin/taxonomies/_taxonomy_actions.html.erb
594
+ - app/views/decidim/admin/taxonomies/edit.html.erb
595
+ - app/views/decidim/admin/taxonomies/index.html.erb
596
+ - app/views/decidim/admin/taxonomies/new.html.erb
597
+ - app/views/decidim/admin/taxonomy_filters/_check_boxes.html.erb
598
+ - app/views/decidim/admin/taxonomy_filters/_form.html.erb
599
+ - app/views/decidim/admin/taxonomy_filters/_table.html.erb
600
+ - app/views/decidim/admin/taxonomy_filters/edit.html.erb
601
+ - app/views/decidim/admin/taxonomy_filters/index.html.erb
602
+ - app/views/decidim/admin/taxonomy_filters/new.html.erb
603
+ - app/views/decidim/admin/taxonomy_filters_selector/_check_boxes.html.erb
604
+ - app/views/decidim/admin/taxonomy_filters_selector/_component_table.html.erb
605
+ - app/views/decidim/admin/taxonomy_filters_selector/_taxonomies_select.html.erb
606
+ - app/views/decidim/admin/taxonomy_filters_selector/index.html.erb
607
+ - app/views/decidim/admin/taxonomy_filters_selector/new.html.erb
608
+ - app/views/decidim/admin/taxonomy_filters_selector/show.html.erb
609
+ - app/views/decidim/admin/taxonomy_items/_form.html.erb
610
+ - app/views/decidim/admin/taxonomy_items/edit.html.erb
611
+ - app/views/decidim/admin/taxonomy_items/new.html.erb
538
612
  - app/views/decidim/admin/user_groups/index.html.erb
539
613
  - app/views/decidim/admin/user_groups_csv_verifications/new.html.erb
540
614
  - app/views/decidim/admin/users/_form.html.erb
@@ -554,6 +628,8 @@ files:
554
628
  - app/views/layouts/decidim/admin/global_moderations.html.erb
555
629
  - app/views/layouts/decidim/admin/newsletters.erb
556
630
  - app/views/layouts/decidim/admin/settings.html.erb
631
+ - app/views/layouts/decidim/admin/taxonomy_filters.html.erb
632
+ - app/views/layouts/decidim/admin/taxonomy_filters_selector.html.erb
557
633
  - app/views/layouts/decidim/admin/users.html.erb
558
634
  - config/assets.rb
559
635
  - config/brakeman.ignore
@@ -666,31 +742,29 @@ files:
666
742
  - lib/decidim/admin/test.rb
667
743
  - lib/decidim/admin/test/admin_participatory_space_access_examples.rb
668
744
  - lib/decidim/admin/test/commands/create_attachment_collection_examples.rb
669
- - lib/decidim/admin/test/commands/create_category_examples.rb
670
- - lib/decidim/admin/test/commands/destroy_category_examples.rb
671
745
  - lib/decidim/admin/test/commands/publish_participatory_space_examples.rb
672
746
  - lib/decidim/admin/test/commands/update_attachment_collection_examples.rb
673
- - lib/decidim/admin/test/commands/update_category_examples.rb
674
747
  - lib/decidim/admin/test/destroy_admin_examples.rb
675
748
  - lib/decidim/admin/test/filterable_examples.rb
676
749
  - lib/decidim/admin/test/filters_participatory_space_user_roles_examples.rb
677
750
  - lib/decidim/admin/test/filters_participatory_space_users_examples.rb
678
751
  - lib/decidim/admin/test/forms/attachment_collection_form_examples.rb
679
752
  - lib/decidim/admin/test/forms/attachment_form_examples.rb
680
- - lib/decidim/admin/test/forms/category_form_examples.rb
681
753
  - lib/decidim/admin/test/invite_participatory_space_admins_shared_examples.rb
682
754
  - lib/decidim/admin/test/invite_participatory_space_collaborators_shared_examples.rb
683
755
  - lib/decidim/admin/test/invite_participatory_space_moderators_shared_examples.rb
684
756
  - lib/decidim/admin/test/invite_participatory_space_users_shared_context.rb
685
757
  - lib/decidim/admin/test/manage_attachment_collections_examples.rb
686
758
  - lib/decidim/admin/test/manage_attachments_examples.rb
687
- - lib/decidim/admin/test/manage_categories_examples.rb
688
759
  - lib/decidim/admin/test/manage_component_permissions_examples.rb
689
760
  - lib/decidim/admin/test/manage_hide_content_examples.rb
690
761
  - lib/decidim/admin/test/manage_moderations_examples.rb
691
762
  - lib/decidim/admin/test/manage_paginated_collection_examples.rb
692
763
  - lib/decidim/admin/test/manage_participatory_space_publications_examples.rb
764
+ - lib/decidim/admin/test/manage_resource_soft_deletion_examples.rb
765
+ - lib/decidim/admin/test/manage_taxonomy_filters_examples.rb
693
766
  - lib/decidim/admin/test/needs_admin_tos_accepted_examples.rb
767
+ - lib/decidim/admin/test/taxonomy_filters_examples.rb
694
768
  - lib/decidim/admin/version.rb
695
769
  homepage: https://decidim.org
696
770
  licenses:
@@ -709,14 +783,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
709
783
  requirements:
710
784
  - - "~>"
711
785
  - !ruby/object:Gem::Version
712
- version: 3.2.0
786
+ version: 3.3.0
713
787
  required_rubygems_version: !ruby/object:Gem::Requirement
714
788
  requirements:
715
789
  - - ">="
716
790
  - !ruby/object:Gem::Version
717
791
  version: '0'
718
792
  requirements: []
719
- rubygems_version: 3.4.10
793
+ rubygems_version: 3.5.11
720
794
  signing_key:
721
795
  specification_version: 4
722
796
  summary: Decidim organization administration
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Admin
5
- # A command with all the business logic to create a new category in the
6
- # system.
7
- class CreateCategory < Decidim::Commands::CreateResource
8
- fetch_form_attributes :name, :weight, :parent_id, :participatory_space
9
-
10
- protected
11
-
12
- def resource_class = Decidim::Category
13
- end
14
- end
15
- end
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Admin
5
- # A command with all the business logic to destroy a category in the
6
- # system.
7
- class DestroyCategory < Decidim::Commands::DestroyResource
8
- protected
9
-
10
- def invalid?
11
- resource.nil? || resource.subcategories.any? || !resource.unused?
12
- end
13
- end
14
- end
15
- end
@@ -1,19 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Admin
5
- # This command deals with destroying a component from the admin panel.
6
- class DestroyComponent < Decidim::Commands::DestroyResource
7
- private
8
-
9
- def run_before_hooks
10
- Decidim::Reminder.where(component: resource).destroy_all
11
- resource.manifest.run_hooks(:before_destroy, resource)
12
- end
13
-
14
- def run_after_hooks
15
- resource.manifest.run_hooks(:destroy, resource)
16
- end
17
- end
18
- end
19
- end
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Admin
5
- # A command with all the business logic when updating a category in the
6
- # system.
7
- class UpdateCategory < Decidim::Commands::UpdateResource
8
- fetch_form_attributes :name, :weight, :parent_id
9
- end
10
- end
11
- end
@@ -1,98 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Admin
5
- # Controller that allows managing categories.
6
- #
7
- class CategoriesController < Decidim::Admin::ApplicationController
8
- include ParticipatorySpaceAdminContext
9
- participatory_space_admin_layout
10
-
11
- before_action :find_category, except: [:index, :new, :create]
12
- before_action :set_categories_breadcrumb_items
13
-
14
- def index
15
- enforce_permission_to :read, :category
16
- end
17
-
18
- def new
19
- enforce_permission_to :create, :category
20
- @form = form(CategoryForm).from_params({}, current_participatory_space:)
21
- end
22
-
23
- def create
24
- enforce_permission_to :create, :category
25
- @form = form(CategoryForm).from_params(params, current_participatory_space:)
26
-
27
- CreateCategory.call(@form) do
28
- on(:ok) do
29
- flash[:notice] = I18n.t("categories.create.success", scope: "decidim.admin")
30
- redirect_to categories_path(current_participatory_space)
31
- end
32
-
33
- on(:invalid) do
34
- flash.now[:alert] = I18n.t("categories.create.error", scope: "decidim.admin")
35
- render :new
36
- end
37
- end
38
- end
39
-
40
- def edit
41
- enforce_permission_to :update, :category, category: @category
42
- @form = form(CategoryForm).from_model(@category, current_participatory_space:)
43
- end
44
-
45
- def update
46
- enforce_permission_to :update, :category, category: @category
47
- @form = form(CategoryForm).from_params(params, current_participatory_space:)
48
-
49
- UpdateCategory.call(@form, @category) do
50
- on(:ok) do
51
- flash[:notice] = I18n.t("categories.update.success", scope: "decidim.admin")
52
- redirect_to categories_path(current_participatory_space)
53
- end
54
-
55
- on(:invalid) do
56
- flash.now[:alert] = I18n.t("categories.update.error", scope: "decidim.admin")
57
- render :edit
58
- end
59
- end
60
- end
61
-
62
- def destroy
63
- enforce_permission_to :destroy, :category, category: @category
64
-
65
- DestroyCategory.call(@category, current_user) do
66
- on(:ok) do
67
- flash[:notice] = I18n.t("categories.destroy.success", scope: "decidim.admin")
68
- end
69
-
70
- on(:invalid) do
71
- flash[:alert] = I18n.t("categories.destroy.error", scope: "decidim.admin")
72
- end
73
-
74
- redirect_back(fallback_location: categories_path(current_participatory_space))
75
- end
76
- end
77
-
78
- private
79
-
80
- def set_categories_breadcrumb_items
81
- return if @category.blank?
82
-
83
- controller_breadcrumb_items << {
84
- label: translated_attribute(@category.name),
85
- active: true
86
- }
87
- end
88
-
89
- def find_category
90
- @category ||= collection.find(params[:id])
91
- end
92
-
93
- def collection
94
- @collection ||= current_participatory_space.categories.includes(:subcategories)
95
- end
96
- end
97
- end
98
- end
@@ -1,32 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Admin
5
- # A form object used to create categories from the admin dashboard.
6
- #
7
- class CategoryForm < Form
8
- include TranslatableAttributes
9
-
10
- translatable_attribute :name, String
11
- attribute :weight, Integer, default: 0
12
- attribute :parent_id, Integer
13
-
14
- mimic :category
15
-
16
- validates :name, translatable_presence: true
17
- validates :parent_id, inclusion: { in: :parent_categories_ids }, allow_blank: true
18
-
19
- delegate :current_participatory_space, to: :context, prefix: false
20
-
21
- def parent_categories
22
- @parent_categories ||= current_participatory_space.categories.first_class.where.not(id:)
23
- end
24
-
25
- private
26
-
27
- def parent_categories_ids
28
- @parent_categories_ids ||= parent_categories.pluck(:id)
29
- end
30
- end
31
- end
32
- end