decidim-participatory_processes 0.27.6 → 0.28.0.rc4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (254) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/app/cells/decidim/participatory_process_groups/content_block_cell.rb +5 -1
  4. data/app/cells/decidim/participatory_process_groups/content_blocks/extra_data/recent_users.erb +1 -0
  5. data/app/cells/decidim/participatory_process_groups/content_blocks/extra_data_cell.rb +71 -0
  6. data/app/cells/decidim/participatory_process_groups/content_blocks/main_data/content.erb +30 -0
  7. data/app/cells/decidim/participatory_process_groups/content_blocks/main_data_cell.rb +77 -0
  8. data/app/cells/decidim/participatory_process_groups/content_blocks/related_processes_cell.rb +47 -0
  9. data/app/cells/decidim/participatory_process_groups/content_blocks/statistics_cell.rb +2 -2
  10. data/app/cells/decidim/participatory_process_groups/process_filters_cell.rb +4 -4
  11. data/app/cells/decidim/participatory_processes/content_block_cell.rb +21 -0
  12. data/app/cells/decidim/participatory_processes/content_blocks/extra_data/active_step.erb +1 -0
  13. data/app/cells/decidim/participatory_processes/content_blocks/extra_data_cell.rb +60 -0
  14. data/app/cells/decidim/participatory_processes/content_blocks/hero_cell.rb +29 -0
  15. data/app/cells/decidim/participatory_processes/content_blocks/highlighted_processes_cell.rb +14 -27
  16. data/app/cells/decidim/participatory_processes/content_blocks/highlighted_processes_settings_form/show.erb +1 -1
  17. data/app/cells/decidim/participatory_processes/content_blocks/main_data_cell.rb +34 -0
  18. data/app/cells/decidim/participatory_processes/content_blocks/metadata_cell.rb +23 -0
  19. data/app/cells/decidim/participatory_processes/content_blocks/metrics_cell.rb +25 -0
  20. data/app/cells/decidim/participatory_processes/content_blocks/processes_settings_form/show.erb +3 -0
  21. data/app/cells/decidim/participatory_processes/content_blocks/processes_settings_form_cell.rb +28 -0
  22. data/app/cells/decidim/participatory_processes/content_blocks/related_processes/content.erb +1 -0
  23. data/app/cells/decidim/participatory_processes/content_blocks/related_processes_cell.rb +53 -0
  24. data/app/cells/decidim/participatory_processes/content_blocks/stats_cell.rb +17 -0
  25. data/app/cells/decidim/participatory_processes/filtered_participatory_processes_cell.rb +1 -1
  26. data/app/cells/decidim/participatory_processes/process_cell.rb +2 -2
  27. data/app/cells/decidim/participatory_processes/process_dropdown_metadata/metadata.erb +22 -0
  28. data/app/cells/decidim/participatory_processes/process_dropdown_metadata_cell.rb +39 -0
  29. data/app/cells/decidim/participatory_processes/process_filters/show.erb +4 -5
  30. data/app/cells/decidim/participatory_processes/process_filters/type_filter.erb +1 -1
  31. data/app/cells/decidim/participatory_processes/process_filters_cell.rb +6 -6
  32. data/app/cells/decidim/participatory_processes/process_g_cell.rb +31 -0
  33. data/app/cells/decidim/participatory_processes/process_group_cell.rb +2 -2
  34. data/app/cells/decidim/participatory_processes/process_group_g_cell.rb +23 -0
  35. data/app/cells/decidim/participatory_processes/process_group_metadata_cell.rb +46 -0
  36. data/app/cells/decidim/participatory_processes/process_group_s_cell.rb +5 -13
  37. data/app/cells/decidim/participatory_processes/process_metadata_cell.rb +44 -0
  38. data/app/cells/decidim/participatory_processes/process_metadata_g_cell.rb +15 -0
  39. data/app/cells/decidim/participatory_processes/process_s_cell.rb +5 -25
  40. data/app/cells/decidim/participatory_processes/process_step/show.erb +48 -0
  41. data/app/cells/decidim/participatory_processes/process_step_cell.rb +30 -0
  42. data/app/cells/decidim/participatory_processes/processes/show.erb +16 -0
  43. data/app/cells/decidim/participatory_processes/processes_cell.rb +24 -0
  44. data/app/commands/decidim/participatory_processes/admin/activate_participatory_process_step.rb +1 -1
  45. data/app/commands/decidim/participatory_processes/admin/copy_participatory_process.rb +2 -2
  46. data/app/commands/decidim/participatory_processes/admin/create_participatory_process.rb +3 -1
  47. data/app/commands/decidim/participatory_processes/admin/create_participatory_process_group.rb +4 -2
  48. data/app/commands/decidim/participatory_processes/admin/create_participatory_process_step.rb +1 -1
  49. data/app/commands/decidim/participatory_processes/admin/create_participatory_process_type.rb +1 -1
  50. data/app/commands/decidim/participatory_processes/admin/destroy_participatory_process_group.rb +1 -1
  51. data/app/commands/decidim/participatory_processes/admin/destroy_participatory_process_step.rb +1 -1
  52. data/app/commands/decidim/participatory_processes/admin/destroy_participatory_process_type.rb +1 -1
  53. data/app/commands/decidim/participatory_processes/admin/import_participatory_process.rb +1 -1
  54. data/app/commands/decidim/participatory_processes/admin/reorder_participatory_process_steps.rb +1 -1
  55. data/app/commands/decidim/participatory_processes/admin/update_participatory_process.rb +1 -1
  56. data/app/commands/decidim/participatory_processes/admin/update_participatory_process_group.rb +2 -2
  57. data/app/commands/decidim/participatory_processes/admin/update_participatory_process_step.rb +1 -1
  58. data/app/commands/decidim/participatory_processes/admin/update_participatory_process_type.rb +1 -1
  59. data/app/constraints/decidim/participatory_processes/current_participatory_process.rb +1 -1
  60. data/app/controllers/decidim/participatory_processes/admin/application_controller.rb +29 -0
  61. data/app/controllers/decidim/participatory_processes/admin/categories_controller.rb +2 -0
  62. data/app/controllers/decidim/participatory_processes/admin/concerns/participatory_process_admin.rb +3 -1
  63. data/app/controllers/decidim/participatory_processes/admin/moderations/reports_controller.rb +1 -1
  64. data/app/controllers/decidim/participatory_processes/admin/moderations_controller.rb +1 -1
  65. data/app/controllers/decidim/participatory_processes/admin/participatory_process_attachment_collections_controller.rb +5 -0
  66. data/app/controllers/decidim/participatory_processes/admin/participatory_process_attachments_controller.rb +5 -0
  67. data/app/controllers/decidim/participatory_processes/admin/participatory_process_group_landing_page_content_blocks_controller.rb +1 -5
  68. data/app/controllers/decidim/participatory_processes/admin/participatory_process_group_landing_page_controller.rb +24 -7
  69. data/app/controllers/decidim/participatory_processes/admin/participatory_process_groups_controller.rb +16 -0
  70. data/app/controllers/decidim/participatory_processes/admin/participatory_process_imports_controller.rb +14 -0
  71. data/app/controllers/decidim/participatory_processes/admin/participatory_process_landing_page_content_blocks_controller.rb +37 -0
  72. data/app/controllers/decidim/participatory_processes/admin/participatory_process_landing_page_controller.rb +37 -0
  73. data/app/controllers/decidim/participatory_processes/admin/participatory_process_publications_controller.rb +9 -29
  74. data/app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb +1 -1
  75. data/app/controllers/decidim/participatory_processes/admin/participatory_process_steps_controller.rb +16 -4
  76. data/app/controllers/decidim/participatory_processes/admin/participatory_process_types_controller.rb +19 -0
  77. data/app/controllers/decidim/participatory_processes/admin/participatory_process_user_roles_controller.rb +8 -91
  78. data/app/controllers/decidim/participatory_processes/admin/participatory_processes_controller.rb +3 -0
  79. data/app/controllers/decidim/participatory_processes/participatory_process_groups_controller.rb +14 -1
  80. data/app/controllers/decidim/participatory_processes/participatory_processes_controller.rb +19 -4
  81. data/app/events/decidim/participatory_process_role_assigned_event.rb +6 -6
  82. data/app/events/decidim/participatory_process_step_activated_event.rb +5 -4
  83. data/app/events/decidim/participatory_process_step_changed_event.rb +5 -4
  84. data/app/forms/decidim/participatory_processes/admin/participatory_process_copy_form.rb +1 -1
  85. data/app/forms/decidim/participatory_processes/admin/participatory_process_form.rb +1 -1
  86. data/app/forms/decidim/participatory_processes/admin/participatory_process_import_form.rb +1 -1
  87. data/app/forms/decidim/participatory_processes/admin/participatory_process_step_form.rb +2 -2
  88. data/app/forms/decidim/participatory_processes/admin/participatory_process_user_role_form.rb +2 -18
  89. data/app/helpers/decidim/participatory_processes/admin/participatory_process_helper.rb +1 -0
  90. data/app/helpers/decidim/participatory_processes/application_helper.rb +5 -0
  91. data/app/helpers/decidim/participatory_processes/participatory_process_helper.rb +37 -9
  92. data/app/helpers/decidim/participatory_processes/participatory_space_content_blocks_helper.rb +17 -0
  93. data/app/jobs/decidim/participatory_processes/change_active_step_job.rb +35 -0
  94. data/app/models/decidim/participatory_process.rb +5 -5
  95. data/app/models/decidim/participatory_process_group.rb +4 -0
  96. data/app/models/decidim/participatory_process_user_role.rb +5 -34
  97. data/app/packs/entrypoints/decidim_participatory_processes.js +0 -2
  98. data/app/packs/src/decidim/participatory_processes/admin/participatory_processes.js +2 -2
  99. data/app/permissions/decidim/participatory_processes/permissions.rb +11 -15
  100. data/app/presenters/decidim/participatory_processes/admin_log/participatory_process_group_presenter.rb +2 -2
  101. data/app/presenters/decidim/participatory_processes/admin_log/participatory_process_presenter.rb +2 -2
  102. data/app/presenters/decidim/participatory_processes/admin_log/participatory_process_type_presenter.rb +2 -2
  103. data/app/presenters/decidim/participatory_processes/admin_log/participatory_process_user_role_presenter.rb +2 -2
  104. data/app/presenters/decidim/participatory_processes/admin_log/step_presenter.rb +2 -2
  105. data/app/presenters/decidim/participatory_processes/participatory_process_group_stats_presenter.rb +4 -40
  106. data/app/presenters/decidim/participatory_processes/participatory_process_metric_charts_presenter.rb +0 -68
  107. data/app/presenters/decidim/participatory_processes/participatory_process_presenter.rb +6 -0
  108. data/app/presenters/decidim/participatory_processes/participatory_process_stats_presenter.rb +3 -42
  109. data/app/queries/decidim/participatory_processes/admin/admin_users.rb +1 -1
  110. data/app/queries/decidim/participatory_processes/admin/moderators.rb +1 -1
  111. data/app/serializers/decidim/participatory_processes/participatory_process_importer.rb +4 -4
  112. data/app/views/decidim/participatory_processes/admin/participatory_process_copies/_form.html.erb +24 -29
  113. data/app/views/decidim/participatory_processes/admin/participatory_process_copies/new.html.erb +16 -5
  114. data/app/views/decidim/participatory_processes/admin/participatory_process_groups/_form.html.erb +72 -50
  115. data/app/views/decidim/participatory_processes/admin/participatory_process_groups/edit.html.erb +15 -9
  116. data/app/views/decidim/participatory_processes/admin/participatory_process_groups/index.html.erb +49 -54
  117. data/app/views/decidim/participatory_processes/admin/participatory_process_groups/new.html.erb +28 -5
  118. data/app/views/decidim/participatory_processes/admin/participatory_process_imports/_form.html.erb +33 -39
  119. data/app/views/decidim/participatory_processes/admin/participatory_process_imports/new.html.erb +18 -5
  120. data/app/views/decidim/participatory_processes/admin/participatory_process_steps/_form.html.erb +18 -25
  121. data/app/views/decidim/participatory_processes/admin/participatory_process_steps/edit.html.erb +16 -5
  122. data/app/views/decidim/participatory_processes/admin/participatory_process_steps/index.html.erb +54 -54
  123. data/app/views/decidim/participatory_processes/admin/participatory_process_steps/new.html.erb +18 -5
  124. data/app/views/decidim/participatory_processes/admin/participatory_process_steps/show.html.erb +2 -2
  125. data/app/views/decidim/participatory_processes/admin/participatory_process_types/_form.html.erb +6 -8
  126. data/app/views/decidim/participatory_processes/admin/participatory_process_types/edit.html.erb +14 -6
  127. data/app/views/decidim/participatory_processes/admin/participatory_process_types/index.html.erb +47 -50
  128. data/app/views/decidim/participatory_processes/admin/participatory_process_types/new.html.erb +14 -6
  129. data/app/views/decidim/participatory_processes/admin/participatory_process_user_roles/_form.html.erb +14 -18
  130. data/app/views/decidim/participatory_processes/admin/participatory_process_user_roles/edit.html.erb +17 -6
  131. data/app/views/decidim/participatory_processes/admin/participatory_process_user_roles/index.html.erb +59 -60
  132. data/app/views/decidim/participatory_processes/admin/participatory_process_user_roles/new.html.erb +16 -5
  133. data/app/views/decidim/participatory_processes/admin/participatory_processes/_form.html.erb +193 -146
  134. data/app/views/decidim/participatory_processes/admin/participatory_processes/edit.html.erb +25 -11
  135. data/app/views/decidim/participatory_processes/admin/participatory_processes/index.html.erb +111 -128
  136. data/app/views/decidim/participatory_processes/admin/participatory_processes/new.html.erb +16 -9
  137. data/app/views/decidim/participatory_processes/participatory_process_groups/show.html.erb +6 -10
  138. data/app/views/decidim/participatory_processes/participatory_processes/_collection.html.erb +8 -0
  139. data/app/views/decidim/participatory_processes/participatory_processes/all_metrics.html.erb +21 -8
  140. data/app/views/decidim/participatory_processes/participatory_processes/index.html.erb +19 -17
  141. data/app/views/decidim/participatory_processes/participatory_processes/index.js.erb +1 -8
  142. data/app/views/decidim/participatory_processes/participatory_processes/show.html.erb +14 -128
  143. data/app/views/layouts/decidim/_process_header.html.erb +15 -26
  144. data/app/views/layouts/decidim/_process_nav_item.html.erb +6 -0
  145. data/app/views/layouts/decidim/admin/_manage_processes.html.erb +36 -0
  146. data/app/views/layouts/decidim/admin/participatory_process.html.erb +12 -14
  147. data/app/views/layouts/decidim/admin/participatory_process_group.html.erb +23 -13
  148. data/app/views/layouts/decidim/admin/participatory_process_groups.html.erb +13 -0
  149. data/app/views/layouts/decidim/admin/participatory_process_type.html.erb +13 -11
  150. data/app/views/layouts/decidim/admin/participatory_processes.html.erb +14 -8
  151. data/app/views/layouts/decidim/participatory_process.html.erb +7 -14
  152. data/config/locales/ar.yml +1 -55
  153. data/config/locales/bg.yml +0 -72
  154. data/config/locales/ca.yml +50 -70
  155. data/config/locales/cs.yml +51 -71
  156. data/config/locales/de.yml +51 -71
  157. data/config/locales/el.yml +8 -64
  158. data/config/locales/en.yml +52 -72
  159. data/config/locales/es-MX.yml +49 -69
  160. data/config/locales/es-PY.yml +49 -69
  161. data/config/locales/es.yml +49 -69
  162. data/config/locales/eu.yml +89 -112
  163. data/config/locales/fi-plain.yml +50 -70
  164. data/config/locales/fi.yml +51 -71
  165. data/config/locales/fr-CA.yml +51 -71
  166. data/config/locales/fr.yml +52 -72
  167. data/config/locales/ga-IE.yml +0 -16
  168. data/config/locales/gl.yml +0 -67
  169. data/config/locales/hu.yml +6 -66
  170. data/config/locales/id-ID.yml +1 -55
  171. data/config/locales/is-IS.yml +0 -24
  172. data/config/locales/it.yml +0 -67
  173. data/config/locales/ja.yml +51 -71
  174. data/config/locales/lb.yml +1 -153
  175. data/config/locales/lt.yml +39 -65
  176. data/config/locales/lv.yml +1 -59
  177. data/config/locales/nl.yml +0 -67
  178. data/config/locales/no.yml +0 -92
  179. data/config/locales/pl.yml +0 -100
  180. data/config/locales/pt-BR.yml +1 -113
  181. data/config/locales/pt.yml +0 -67
  182. data/config/locales/ro-RO.yml +4 -64
  183. data/config/locales/ru.yml +0 -49
  184. data/config/locales/sk.yml +1 -56
  185. data/config/locales/sl.yml +0 -7
  186. data/config/locales/sr-CS.yml +0 -4
  187. data/config/locales/sv.yml +15 -66
  188. data/config/locales/tr-TR.yml +7 -68
  189. data/config/locales/uk.yml +0 -49
  190. data/config/locales/zh-CN.yml +2 -63
  191. data/config/locales/zh-TW.yml +3 -63
  192. data/db/migrate/20220315100140_change_steps_dates_to_datetime.rb +8 -0
  193. data/lib/decidim/api/participatory_process_step_type.rb +2 -2
  194. data/lib/decidim/participatory_processes/admin_engine.rb +20 -139
  195. data/lib/decidim/participatory_processes/content_blocks/registry_manager.rb +278 -0
  196. data/lib/decidim/participatory_processes/engine.rb +13 -103
  197. data/lib/decidim/participatory_processes/menu.rb +190 -0
  198. data/lib/decidim/participatory_processes/participatory_space.rb +7 -204
  199. data/lib/decidim/participatory_processes/query_extensions.rb +2 -2
  200. data/lib/decidim/participatory_processes/seeds.rb +164 -0
  201. data/lib/decidim/participatory_processes/test/factories.rb +58 -65
  202. data/lib/decidim/participatory_processes/version.rb +1 -1
  203. data/lib/tasks/decidim_participatory_processes.rake +8 -0
  204. metadata +65 -70
  205. data/app/cells/decidim/participatory_process_groups/content_blocks/highlighted_participatory_processes/filters.erb +0 -21
  206. data/app/cells/decidim/participatory_process_groups/content_blocks/highlighted_participatory_processes/filters_small_view.erb +0 -18
  207. data/app/cells/decidim/participatory_process_groups/content_blocks/highlighted_participatory_processes/participatory_space_filters.erb +0 -6
  208. data/app/cells/decidim/participatory_process_groups/content_blocks/highlighted_participatory_processes/show.erb +0 -8
  209. data/app/cells/decidim/participatory_process_groups/content_blocks/highlighted_participatory_processes/title_filter_order.erb +0 -8
  210. data/app/cells/decidim/participatory_process_groups/content_blocks/highlighted_participatory_processes_cell.rb +0 -60
  211. data/app/cells/decidim/participatory_process_groups/content_blocks/html/show.erb +0 -3
  212. data/app/cells/decidim/participatory_process_groups/content_blocks/html_cell.rb +0 -13
  213. data/app/cells/decidim/participatory_process_groups/content_blocks/metadata/show.erb +0 -28
  214. data/app/cells/decidim/participatory_process_groups/content_blocks/metadata_cell.rb +0 -15
  215. data/app/cells/decidim/participatory_process_groups/content_blocks/title/show.erb +0 -43
  216. data/app/cells/decidim/participatory_process_groups/content_blocks/title_cell.rb +0 -64
  217. data/app/cells/decidim/participatory_processes/content_blocks/highlighted_processes/_all_processes.erb +0 -9
  218. data/app/cells/decidim/participatory_processes/content_blocks/highlighted_processes/show.erb +0 -14
  219. data/app/cells/decidim/participatory_processes/content_blocks/highlighted_processes/single_process.erb +0 -48
  220. data/app/cells/decidim/participatory_processes/process_group_m/footer.erb +0 -8
  221. data/app/cells/decidim/participatory_processes/process_group_m_cell.rb +0 -60
  222. data/app/cells/decidim/participatory_processes/process_group_s/image.erb +0 -1
  223. data/app/cells/decidim/participatory_processes/process_group_s/show.erb +0 -8
  224. data/app/cells/decidim/participatory_processes/process_m/data.erb +0 -21
  225. data/app/cells/decidim/participatory_processes/process_m/footer.erb +0 -14
  226. data/app/cells/decidim/participatory_processes/process_m/tags.erb +0 -8
  227. data/app/cells/decidim/participatory_processes/process_m_cell.rb +0 -87
  228. data/app/cells/decidim/participatory_processes/process_s/image.erb +0 -1
  229. data/app/cells/decidim/participatory_processes/process_s/show.erb +0 -14
  230. data/app/commands/decidim/participatory_processes/admin/create_participatory_process_admin.rb +0 -58
  231. data/app/commands/decidim/participatory_processes/admin/destroy_participatory_process_admin.rb +0 -58
  232. data/app/commands/decidim/participatory_processes/admin/notify_role_assigned_to_participatory_process.rb +0 -22
  233. data/app/commands/decidim/participatory_processes/admin/publish_participatory_process.rb +0 -40
  234. data/app/commands/decidim/participatory_processes/admin/unpublish_participatory_process.rb +0 -40
  235. data/app/commands/decidim/participatory_processes/admin/update_participatory_process_admin.rb +0 -56
  236. data/app/controllers/decidim/participatory_processes/participatory_process_steps_controller.rb +0 -28
  237. data/app/controllers/decidim/participatory_processes/widgets_controller.rb +0 -37
  238. data/app/packs/src/decidim/participatory_processes/filters.js +0 -28
  239. data/app/views/decidim/participatory_process_steps/_participatory_process_step.html.erb +0 -16
  240. data/app/views/decidim/participatory_processes/participatory_process_steps/_timeline.html.erb +0 -7
  241. data/app/views/decidim/participatory_processes/participatory_process_steps/index.html.erb +0 -18
  242. data/app/views/decidim/participatory_processes/participatory_processes/_metrics.html.erb +0 -10
  243. data/app/views/decidim/participatory_processes/participatory_processes/_order_by_processes.html.erb +0 -1
  244. data/app/views/decidim/participatory_processes/participatory_processes/_participatory_process_group.html.erb +0 -4
  245. data/app/views/decidim/participatory_processes/participatory_processes/_promoted_process.html.erb +0 -39
  246. data/app/views/decidim/participatory_processes/participatory_processes/_promoted_process_group.html.erb +0 -31
  247. data/app/views/layouts/decidim/_process_header_steps.html.erb +0 -37
  248. data/app/views/layouts/decidim/_process_navigation.html.erb +0 -20
  249. data/config/locales/he-IL.yml +0 -1
  250. data/db/seeds/Exampledocument.pdf +0 -0
  251. data/db/seeds/city.jpeg +0 -0
  252. data/db/seeds/city2.jpeg +0 -0
  253. data/db/seeds/homepage_image.jpg +0 -0
  254. data/decidim-participatory_processes.gemspec +0 -31
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module ParticipatoryProcesses
5
+ module ContentBlocks
6
+ class StatsCell < Decidim::ContentBlocks::ParticipatorySpaceStatsCell
7
+ include ParticipatorySpaceContentBlocksHelper
8
+
9
+ private
10
+
11
+ def stats
12
+ @stats ||= resource.show_statistics && ParticipatoryProcessStatsPresenter.new(participatory_process: resource).collection
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -40,7 +40,7 @@ module Decidim
40
40
  def default_filter_params
41
41
  {
42
42
  with_date: default_date_filter,
43
- with_type: nil
43
+ with_any_type: nil
44
44
  }
45
45
  end
46
46
 
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module ParticipatoryProcesses
5
5
  # This cell renders the process card for an instance of a Process
6
- # the default size is the Medium Card (:m)
6
+ # the default size is the Grid Card (:g)
7
7
  class ProcessCell < Decidim::ViewModel
8
8
  def show
9
9
  cell card_size, model, options
@@ -16,7 +16,7 @@ module Decidim
16
16
  when :s
17
17
  "decidim/participatory_processes/process_s"
18
18
  else
19
- "decidim/participatory_processes/process_m"
19
+ "decidim/participatory_processes/process_g"
20
20
  end
21
21
  end
22
22
  end
@@ -0,0 +1,22 @@
1
+ <h4 class="menu-bar__secondary-dropdown__title"><%= title %></h4>
2
+ <div class="menu-bar__secondary-dropdown__metadata">
3
+ <% if display_steps? %>
4
+ <span>
5
+ <%= icon "direction-line", class: "text-gray fill-current" %>
6
+
7
+ <span class="font-semibold"><%= t("layouts.decidim.participatory_processes.participatory_process.active_step") %></span>
8
+ <%= link_to(
9
+ step_title,
10
+ decidim_participatory_processes.participatory_process_path(process, display_steps: true),
11
+ class: "text-secondary underline"
12
+ ) %>
13
+ </span>
14
+ <% end %>
15
+
16
+ <% if hashtag.present? %>
17
+ <span>
18
+ <%= icon "twitter-x-line", class: "text-gray fill-current" %>
19
+ <%= link_to "##{hashtag}", twitter_hashtag_url(hashtag), target: "_blank", class: "text-secondary underline" %>
20
+ </span>
21
+ <% end %>
22
+ </div>
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module ParticipatoryProcesses
5
+ class ProcessDropdownMetadataCell < Decidim::ParticipatorySpaceDropdownMetadataCell
6
+ include ParticipatoryProcessHelper
7
+ include Decidim::ComponentPathHelper
8
+ include ActiveLinkTo
9
+
10
+ alias process model
11
+
12
+ def decidim_participatory_processes
13
+ Decidim::ParticipatoryProcesses::Engine.routes.url_helpers
14
+ end
15
+
16
+ private
17
+
18
+ def cache_hash
19
+ hash = []
20
+ hash << "decidim/process_dropdown_metadata"
21
+ hash << id
22
+ hash << current_user.try(:id).to_s
23
+ hash << I18n.locale.to_s
24
+
25
+ hash.join(Decidim.cache_key_separator)
26
+ end
27
+
28
+ def step_title
29
+ translated_attribute process.active_step&.title
30
+ end
31
+
32
+ def display_steps?
33
+ process.steps.present?
34
+ end
35
+
36
+ def nav_items_method = :process_nav_items
37
+ end
38
+ end
39
+ end
@@ -1,17 +1,16 @@
1
1
  <div class="row column">
2
- <div class="flex--sbe">
3
- <h3 class="section-heading collapse">
2
+ <div>
3
+ <h3 class="collapse">
4
4
  <%= title %>
5
5
  <%= render :filter_tabs %>
6
6
  </h3>
7
7
  <%= render :type_filter if participatory_process_types_for_select.present? %>
8
8
  </div>
9
- <hr class="reset mt-s mb-s">
9
+ <hr class="mt-s mb-s">
10
10
  </div>
11
11
  <% if process_count_by_filter["active"] == 0 && process_count_by_filter["upcoming"] == 0 %>
12
12
  <div class="row column">
13
- <div class="callout warning mb-sm">
14
- <p><%= t("decidim.participatory_processes.participatory_processes.filters.explanations.no_active_nor_upcoming_callout") %></p>
13
+ <%= cell("decidim/announcement", t("decidim.participatory_processes.participatory_processes.filters.explanations.no_active_nor_upcoming_callout"), callout_class: "warning") %>
15
14
  </div>
16
15
  </div>
17
16
  <% end %>
@@ -1,6 +1,6 @@
1
1
  <div id="process-type-filter" class="inline-filters">
2
2
  <div id="inline-filter-sort" class="dropdown-pane" data-position="bottom" data-alignment="right" data-dropdown data-auto-focus="true">
3
- <ul class="list-reset">
3
+ <ul>
4
4
  <% participatory_process_types_for_select.each do |title, id| %>
5
5
  <li>
6
6
  <%= link_to filter_link(current_filter, id), remote: true do %>
@@ -17,7 +17,7 @@ module Decidim
17
17
  end
18
18
 
19
19
  def current_type_filter_name
20
- participatory_process_types_for_select.find { |_, id| id == get_filter(:with_type) }&.first ||
20
+ participatory_process_types_for_select.find { |_, id| id == get_filter(:with_any_type) }&.first ||
21
21
  I18n.t("all_types", scope: "decidim.participatory_processes.participatory_processes.filters")
22
22
  end
23
23
 
@@ -35,8 +35,8 @@ module Decidim
35
35
  filter: {
36
36
  with_date: date_filter,
37
37
  with_any_scope: get_filter(:with_any_scope),
38
- with_area: get_filter(:with_area),
39
- with_type: type_filter || get_filter(:with_type)
38
+ with_any_area: get_filter(:with_any_area),
39
+ with_any_type: type_filter || get_filter(:with_any_type)
40
40
  }
41
41
  }
42
42
  end
@@ -46,10 +46,10 @@ module Decidim
46
46
  {
47
47
  with_date: date_filter,
48
48
  with_any_scope: get_filter(:with_any_scope),
49
- with_area: get_filter(:with_area),
50
- with_type: filter_with_type ? get_filter(:with_type) : nil
49
+ with_any_area: get_filter(:with_any_area),
50
+ with_any_type: filter_with_type ? get_filter(:with_any_type) : nil
51
51
  },
52
- current_user: current_user
52
+ current_user:
53
53
  ).result
54
54
 
55
55
  query.published.visible_for(current_user)
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module ParticipatoryProcesses
5
+ # This cell renders the Grid (:g) process card
6
+ # for a given instance of a ParticipatoryProcess
7
+ class ProcessGCell < Decidim::CardGCell
8
+ private
9
+
10
+ def resource_path
11
+ Decidim::ParticipatoryProcesses::Engine.routes.url_helpers.participatory_process_path(model)
12
+ end
13
+
14
+ def resource_image_path
15
+ model.attached_uploader(:hero_image).path
16
+ end
17
+
18
+ def start_date
19
+ model.start_date
20
+ end
21
+
22
+ def end_date
23
+ model.end_date
24
+ end
25
+
26
+ def metadata_cell
27
+ "decidim/participatory_processes/process_metadata_g"
28
+ end
29
+ end
30
+ end
31
+ end
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  module ParticipatoryProcesses
5
5
  # This cell renders the process card for an instance of a ProcessGroup
6
- # the default size is the Medium Card (:m)
6
+ # the default size is the Grid Card (:g)
7
7
  class ProcessGroupCell < Decidim::ViewModel
8
8
  def show
9
9
  cell card_size, model, options
@@ -16,7 +16,7 @@ module Decidim
16
16
  when :s
17
17
  "decidim/participatory_processes/process_group_s"
18
18
  else
19
- "decidim/participatory_processes/process_group_m"
19
+ "decidim/participatory_processes/process_group_g"
20
20
  end
21
21
  end
22
22
  end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module ParticipatoryProcesses
5
+ # This cell renders the Grid (:g) process card
6
+ # for a given instance of a ParticipatoryProcess
7
+ class ProcessGroupGCell < Decidim::CardGCell
8
+ private
9
+
10
+ def resource_path
11
+ Decidim::ParticipatoryProcesses::Engine.routes.url_helpers.participatory_process_group_path(model)
12
+ end
13
+
14
+ def resource_image_path
15
+ model.attached_uploader(:hero_image).path
16
+ end
17
+
18
+ def metadata_cell
19
+ "decidim/participatory_processes/process_group_metadata"
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "cell/partial"
4
+
5
+ module Decidim
6
+ module ParticipatoryProcesses
7
+ class ProcessGroupMetadataCell < Decidim::CardMetadataCell
8
+ delegate :active_step, :meta_scope, to: :model
9
+
10
+ def initialize(*)
11
+ super
12
+
13
+ @items.prepend(*items)
14
+ end
15
+
16
+ private
17
+
18
+ def items
19
+ [processes_count_item, meta_scope_item].compact
20
+ end
21
+
22
+ def processes_count_item
23
+ {
24
+ icon: "grid-line",
25
+ text: t(
26
+ "decidim.participatory_process_groups.content_blocks.title.participatory_processes",
27
+ count:
28
+ )
29
+ }
30
+ end
31
+
32
+ def meta_scope_item
33
+ return if (scope_text = translated_attribute(meta_scope)).blank?
34
+
35
+ {
36
+ icon: "globe-line",
37
+ text: scope_text
38
+ }
39
+ end
40
+
41
+ def count
42
+ cell("decidim/participatory_process_groups/content_blocks/related_processes", nil, resource: model).total_count
43
+ end
44
+ end
45
+ end
46
+ end
@@ -2,21 +2,13 @@
2
2
 
3
3
  module Decidim
4
4
  module ParticipatoryProcesses
5
- # This cell renders the Small (:s) process group card
6
- # for an given instance of a ParticipatoryProcessGroup
7
- class ProcessGroupSCell < Decidim::CardMCell
5
+ # This cell renders the Search (:s) process group card
6
+ # for a given instance of a ParticipatoryProcessGroup
7
+ class ProcessGroupSCell < Decidim::CardSCell
8
8
  private
9
9
 
10
- def has_image?
11
- model.hero_image.attached?
12
- end
13
-
14
- def resource_path
15
- Decidim::ParticipatoryProcesses::Engine.routes.url_helpers.participatory_process_group_path(model)
16
- end
17
-
18
- def resource_image_path
19
- model.attached_uploader(:hero_image).path
10
+ def metadata_cell
11
+ "decidim/participatory_processes/process_metadata"
20
12
  end
21
13
  end
22
14
  end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "cell/partial"
4
+
5
+ module Decidim
6
+ module ParticipatoryProcesses
7
+ class ProcessMetadataCell < Decidim::CardMetadataCell
8
+ delegate :active_step, to: :model
9
+
10
+ def initialize(*)
11
+ super
12
+
13
+ @items.prepend(*process_items)
14
+ end
15
+
16
+ private
17
+
18
+ def process_items
19
+ [progress_item, active_step_item].compact
20
+ end
21
+
22
+ def active_step_item
23
+ return if active_step.blank?
24
+
25
+ {
26
+ text: translated_attribute(active_step.title),
27
+ icon: "direction-line"
28
+ }
29
+ end
30
+
31
+ def start_date
32
+ return if model.try(:start_date).blank?
33
+
34
+ @start_date ||= model.start_date.to_time
35
+ end
36
+
37
+ def end_date
38
+ return if model.try(:end_date).blank?
39
+
40
+ @end_date ||= model.end_date.to_time
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "cell/partial"
4
+
5
+ module Decidim
6
+ module ParticipatoryProcesses
7
+ class ProcessMetadataGCell < Decidim::ParticipatoryProcesses::ProcessMetadataCell
8
+ private
9
+
10
+ def items
11
+ [progress_item, active_step_item].compact
12
+ end
13
+ end
14
+ end
15
+ end
@@ -2,33 +2,13 @@
2
2
 
3
3
  module Decidim
4
4
  module ParticipatoryProcesses
5
- # This cell renders the Small (:s) process card
6
- # for an given instance of a ParticipatoryProcess
7
- class ProcessSCell < Decidim::CardMCell
5
+ # This cell renders the Search (:s) process card
6
+ # for a given instance of a ParticipatoryProcess
7
+ class ProcessSCell < Decidim::CardSCell
8
8
  private
9
9
 
10
- def has_image?
11
- model.hero_image.attached?
12
- end
13
-
14
- def has_step?
15
- model.active_step.present?
16
- end
17
-
18
- def resource_path
19
- Decidim::ParticipatoryProcesses::Engine.routes.url_helpers.participatory_process_path(model)
20
- end
21
-
22
- def resource_image_path
23
- model.attached_uploader(:hero_image).path
24
- end
25
-
26
- def step_title
27
- translated_attribute model.active_step.title
28
- end
29
-
30
- def i18n_scope
31
- "decidim.participatory_processes.pages.home.highlighted_processes"
10
+ def metadata_cell
11
+ "decidim/participatory_processes/process_metadata"
32
12
  end
33
13
  end
34
14
  end
@@ -0,0 +1,48 @@
1
+ <%= decidim_modal id: "process-steps-modal", class: "participatory-space__metadata-modal", data: do %>
2
+ <div data-dialog-container>
3
+ <%= icon "flag-line" %>
4
+ <h3 id="dialog-title-process-steps-modal" data-dialog-title><%= t("participatory_process_steps.index.process_steps", scope: "decidim") %></h3>
5
+ <div>
6
+ <div class="participatory-space__metadata-modal__list-container" data-component="accordion" data-multiselectable="false" data-collapsible="false">
7
+ <ol class="participatory-space__metadata-modal__list">
8
+ <% steps.each_with_index do |step, i| %>
9
+ <% active = step == active_step %>
10
+ <li>
11
+ <%# NOTE: The following markup is duplicated to fulfill a11y requirements %>
12
+ <% if steps.length == 1 %>
13
+ <div id="trigger-process-steps-<%= i %>" class="participatory-space__metadata-modal__step<%= " is-active" if active %>" aria-expanded="true">
14
+ <span><%= step.position + 1 %></span>
15
+ <span>
16
+ <span class="participatory-space__metadata-modal__step-title">
17
+ <span class="participatory-space__metadata-modal__step-current"><%= t("active_step", scope: "layouts.decidim.participatory_processes.participatory_process") %></span>
18
+ <%= translated_attribute(step.title) %>
19
+ </span>
20
+ <span class="participatory-space__metadata-modal__step-dates"><%= step_dates(step) %></span>
21
+ </span>
22
+ </div>
23
+ <% else %>
24
+ <button id="trigger-process-steps-<%= i %>" class="participatory-space__metadata-modal__step<%= " is-active" if active %>" data-controls="panel-process-steps-<%= i %>" data-open="<%= "true" if active %>">
25
+ <span><%= step.position + 1 %></span>
26
+ <span>
27
+ <span class="participatory-space__metadata-modal__step-title">
28
+ <span class="participatory-space__metadata-modal__step-current"><%= t("active_step", scope: "layouts.decidim.participatory_processes.participatory_process") %></span>
29
+ <%= translated_attribute(step.title) %>
30
+ </span>
31
+ <span class="participatory-space__metadata-modal__step-dates"><%= step_dates(step) %></span>
32
+ </span>
33
+ </button>
34
+ <% end %>
35
+ </li>
36
+ <% end %>
37
+ </ol>
38
+ <div>
39
+ <% steps.each_with_index do |step, i| %>
40
+ <div id="panel-process-steps-<%= i %>" class="editor-content">
41
+ <%= decidim_sanitize_editor_admin(translated_attribute(step.description)) %>
42
+ </div>
43
+ <% end %>
44
+ </div>
45
+ </div>
46
+ </div>
47
+ </div>
48
+ <% end %>
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module ParticipatoryProcesses
5
+ class ProcessStepCell < Decidim::ViewModel
6
+ include ParticipatoryProcessHelper
7
+ include Decidim::ModalHelper
8
+
9
+ delegate :steps, :active_step, to: :model
10
+
11
+ def show
12
+ return if steps.blank?
13
+
14
+ render
15
+ end
16
+
17
+ private
18
+
19
+ def display_steps?
20
+ [true, "true"].include? options[:display_steps]
21
+ end
22
+
23
+ def data
24
+ return unless display_steps?
25
+
26
+ { is_open: true }
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,16 @@
1
+ <div class="content-block__title">
2
+ <h2 class="h2 decorator"><%= title %></h2>
3
+ <div class="label text-lg"><%= total_count %></div>
4
+ <% if show_all_path.present? %>
5
+ <%= link_to show_all_path, class: "button button__sm button__text-secondary" do %>
6
+ <span><%= t("decidim.participatory_processes.pages.home.highlighted_processes.see_all_spaces") %></span>
7
+ <%= icon "arrow-right-line" %>
8
+ <% end %>
9
+ <% end %>
10
+ </div>
11
+
12
+ <div class="participatory-space__block-grid">
13
+ <% processes.each do |process| %>
14
+ <%= card_for(process) %>
15
+ <% end %>
16
+ </div>
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module ParticipatoryProcesses
5
+ # This cell renders a list of processes
6
+ class ProcessesCell < Decidim::ViewModel
7
+ include Decidim::CardHelper
8
+
9
+ alias processes model
10
+
11
+ def total_count
12
+ @total_count ||= options[:total_count] || processes.size
13
+ end
14
+
15
+ def show_all_path
16
+ @show_all_path ||= options[:show_all_path]
17
+ end
18
+
19
+ def title
20
+ options[:title] || t("related_processes", scope: "decidim.participatory_processes.show")
21
+ end
22
+ end
23
+ end
24
+ end
@@ -18,7 +18,7 @@ module Decidim
18
18
  # Executes the command. Broadcasts these events:
19
19
  #
20
20
  # - :ok when everything is valid.
21
- # - :invalid if the data wasn't valid and we couldn't proceed.
21
+ # - :invalid if the data was not valid and we could not proceed.
22
22
  #
23
23
  # Returns nothing.
24
24
  def call
@@ -19,7 +19,7 @@ module Decidim
19
19
  # Executes the command. Broadcasts these events:
20
20
  #
21
21
  # - :ok when everything is valid.
22
- # - :invalid if the form wasn't valid and we couldn't proceed.
22
+ # - :invalid if the form was not valid and we could not proceed.
23
23
  #
24
24
  # Returns nothing.
25
25
  def call
@@ -122,7 +122,7 @@ module Decidim
122
122
  step_settings: copied_step_settings,
123
123
  weight: component.weight
124
124
  )
125
- component.manifest.run_hooks(:copy, new_component: new_component, old_component: component)
125
+ component.manifest.run_hooks(:copy, new_component:, old_component: component)
126
126
  end
127
127
  end
128
128
 
@@ -16,7 +16,7 @@ module Decidim
16
16
  # Executes the command. Broadcasts these events:
17
17
  #
18
18
  # - :ok when everything is valid.
19
- # - :invalid if the form wasn't valid and we couldn't proceed.
19
+ # - :invalid if the form was not valid and we could not proceed.
20
20
  #
21
21
  # Returns nothing.
22
22
  def call
@@ -27,6 +27,8 @@ module Decidim
27
27
  if process.persisted?
28
28
  add_admins_as_followers(process)
29
29
  link_related_processes
30
+ Decidim::ContentBlocksCreator.new(process).create_default!
31
+
30
32
  broadcast(:ok, process)
31
33
  else
32
34
  form.errors.add(:hero_image, process.errors[:hero_image]) if process.errors.include? :hero_image
@@ -16,7 +16,7 @@ module Decidim
16
16
  # Executes the command. Broadcasts these events:
17
17
  #
18
18
  # - :ok when everything is valid.
19
- # - :invalid if the form wasn't valid and we couldn't proceed.
19
+ # - :invalid if the form was not valid and we could not proceed.
20
20
  #
21
21
  # Returns nothing.
22
22
  def call
@@ -25,6 +25,8 @@ module Decidim
25
25
  group = create_participatory_process_group
26
26
 
27
27
  if group.persisted?
28
+ Decidim::ContentBlocksCreator.new(group).create_default!
29
+
28
30
  broadcast(:ok, group)
29
31
  else
30
32
  form.errors.add(:hero_image, group.errors[:hero_image]) if group.errors.include? :hero_image
@@ -51,7 +53,7 @@ module Decidim
51
53
  hashtag: form.hashtag,
52
54
  group_url: form.group_url,
53
55
  hero_image: form.hero_image, # Keep after organization
54
- participatory_processes: participatory_processes,
56
+ participatory_processes:,
55
57
  developer_group: form.developer_group,
56
58
  local_area: form.local_area,
57
59
  meta_scope: form.meta_scope,
@@ -19,7 +19,7 @@ module Decidim
19
19
  # Executes the command. Broadcasts these events:
20
20
  #
21
21
  # - :ok when everything is valid.
22
- # - :invalid if the form wasn't valid and we couldn't proceed.
22
+ # - :invalid if the form was not valid and we could not proceed.
23
23
  #
24
24
  # Returns nothing.
25
25
  def call
@@ -16,7 +16,7 @@ module Decidim
16
16
  # Executes the command. Broadcasts these events:
17
17
  #
18
18
  # - :ok when everything is valid.
19
- # - :invalid if the form wasn't valid and we couldn't proceed.
19
+ # - :invalid if the form was not valid and we could not proceed.
20
20
  #
21
21
  # Returns nothing.
22
22
  def call
@@ -17,7 +17,7 @@ module Decidim
17
17
  # Executes the command. Broadcasts these events:
18
18
  #
19
19
  # - :ok when the record could be deleted.
20
- # - :invalid when the record couldn't be deleted.
20
+ # - :invalid when the record could not be deleted.
21
21
  #
22
22
  # Returns nothing.
23
23
  def call
@@ -18,7 +18,7 @@ module Decidim
18
18
  # Executes the command. Broadcasts these events:
19
19
  #
20
20
  # - :ok when everything is valid.
21
- # - :invalid if the data wasn't valid and we couldn't proceed.
21
+ # - :invalid if the data was not valid and we could not proceed.
22
22
  #
23
23
  # Returns nothing.
24
24
  def call