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.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/cells/decidim/participatory_process_groups/content_block_cell.rb +5 -1
- data/app/cells/decidim/participatory_process_groups/content_blocks/extra_data/recent_users.erb +1 -0
- data/app/cells/decidim/participatory_process_groups/content_blocks/extra_data_cell.rb +71 -0
- data/app/cells/decidim/participatory_process_groups/content_blocks/main_data/content.erb +30 -0
- data/app/cells/decidim/participatory_process_groups/content_blocks/main_data_cell.rb +77 -0
- data/app/cells/decidim/participatory_process_groups/content_blocks/related_processes_cell.rb +47 -0
- data/app/cells/decidim/participatory_process_groups/content_blocks/statistics_cell.rb +2 -2
- data/app/cells/decidim/participatory_process_groups/process_filters_cell.rb +4 -4
- data/app/cells/decidim/participatory_processes/content_block_cell.rb +21 -0
- data/app/cells/decidim/participatory_processes/content_blocks/extra_data/active_step.erb +1 -0
- data/app/cells/decidim/participatory_processes/content_blocks/extra_data_cell.rb +60 -0
- data/app/cells/decidim/participatory_processes/content_blocks/hero_cell.rb +29 -0
- data/app/cells/decidim/participatory_processes/content_blocks/highlighted_processes_cell.rb +14 -27
- data/app/cells/decidim/participatory_processes/content_blocks/highlighted_processes_settings_form/show.erb +1 -1
- data/app/cells/decidim/participatory_processes/content_blocks/main_data_cell.rb +34 -0
- data/app/cells/decidim/participatory_processes/content_blocks/metadata_cell.rb +23 -0
- data/app/cells/decidim/participatory_processes/content_blocks/metrics_cell.rb +25 -0
- data/app/cells/decidim/participatory_processes/content_blocks/processes_settings_form/show.erb +3 -0
- data/app/cells/decidim/participatory_processes/content_blocks/processes_settings_form_cell.rb +28 -0
- data/app/cells/decidim/participatory_processes/content_blocks/related_processes/content.erb +1 -0
- data/app/cells/decidim/participatory_processes/content_blocks/related_processes_cell.rb +53 -0
- data/app/cells/decidim/participatory_processes/content_blocks/stats_cell.rb +17 -0
- data/app/cells/decidim/participatory_processes/filtered_participatory_processes_cell.rb +1 -1
- data/app/cells/decidim/participatory_processes/process_cell.rb +2 -2
- data/app/cells/decidim/participatory_processes/process_dropdown_metadata/metadata.erb +22 -0
- data/app/cells/decidim/participatory_processes/process_dropdown_metadata_cell.rb +39 -0
- data/app/cells/decidim/participatory_processes/process_filters/show.erb +4 -5
- data/app/cells/decidim/participatory_processes/process_filters/type_filter.erb +1 -1
- data/app/cells/decidim/participatory_processes/process_filters_cell.rb +6 -6
- data/app/cells/decidim/participatory_processes/process_g_cell.rb +31 -0
- data/app/cells/decidim/participatory_processes/process_group_cell.rb +2 -2
- data/app/cells/decidim/participatory_processes/process_group_g_cell.rb +23 -0
- data/app/cells/decidim/participatory_processes/process_group_metadata_cell.rb +46 -0
- data/app/cells/decidim/participatory_processes/process_group_s_cell.rb +5 -13
- data/app/cells/decidim/participatory_processes/process_metadata_cell.rb +44 -0
- data/app/cells/decidim/participatory_processes/process_metadata_g_cell.rb +15 -0
- data/app/cells/decidim/participatory_processes/process_s_cell.rb +5 -25
- data/app/cells/decidim/participatory_processes/process_step/show.erb +48 -0
- data/app/cells/decidim/participatory_processes/process_step_cell.rb +30 -0
- data/app/cells/decidim/participatory_processes/processes/show.erb +16 -0
- data/app/cells/decidim/participatory_processes/processes_cell.rb +24 -0
- data/app/commands/decidim/participatory_processes/admin/activate_participatory_process_step.rb +1 -1
- data/app/commands/decidim/participatory_processes/admin/copy_participatory_process.rb +2 -2
- data/app/commands/decidim/participatory_processes/admin/create_participatory_process.rb +3 -1
- data/app/commands/decidim/participatory_processes/admin/create_participatory_process_group.rb +4 -2
- data/app/commands/decidim/participatory_processes/admin/create_participatory_process_step.rb +1 -1
- data/app/commands/decidim/participatory_processes/admin/create_participatory_process_type.rb +1 -1
- data/app/commands/decidim/participatory_processes/admin/destroy_participatory_process_group.rb +1 -1
- data/app/commands/decidim/participatory_processes/admin/destroy_participatory_process_step.rb +1 -1
- data/app/commands/decidim/participatory_processes/admin/destroy_participatory_process_type.rb +1 -1
- data/app/commands/decidim/participatory_processes/admin/import_participatory_process.rb +1 -1
- data/app/commands/decidim/participatory_processes/admin/reorder_participatory_process_steps.rb +1 -1
- data/app/commands/decidim/participatory_processes/admin/update_participatory_process.rb +1 -1
- data/app/commands/decidim/participatory_processes/admin/update_participatory_process_group.rb +2 -2
- data/app/commands/decidim/participatory_processes/admin/update_participatory_process_step.rb +1 -1
- data/app/commands/decidim/participatory_processes/admin/update_participatory_process_type.rb +1 -1
- data/app/constraints/decidim/participatory_processes/current_participatory_process.rb +1 -1
- data/app/controllers/decidim/participatory_processes/admin/application_controller.rb +29 -0
- data/app/controllers/decidim/participatory_processes/admin/categories_controller.rb +2 -0
- data/app/controllers/decidim/participatory_processes/admin/concerns/participatory_process_admin.rb +3 -1
- data/app/controllers/decidim/participatory_processes/admin/moderations/reports_controller.rb +1 -1
- data/app/controllers/decidim/participatory_processes/admin/moderations_controller.rb +1 -1
- data/app/controllers/decidim/participatory_processes/admin/participatory_process_attachment_collections_controller.rb +5 -0
- data/app/controllers/decidim/participatory_processes/admin/participatory_process_attachments_controller.rb +5 -0
- data/app/controllers/decidim/participatory_processes/admin/participatory_process_group_landing_page_content_blocks_controller.rb +1 -5
- data/app/controllers/decidim/participatory_processes/admin/participatory_process_group_landing_page_controller.rb +24 -7
- data/app/controllers/decidim/participatory_processes/admin/participatory_process_groups_controller.rb +16 -0
- data/app/controllers/decidim/participatory_processes/admin/participatory_process_imports_controller.rb +14 -0
- data/app/controllers/decidim/participatory_processes/admin/participatory_process_landing_page_content_blocks_controller.rb +37 -0
- data/app/controllers/decidim/participatory_processes/admin/participatory_process_landing_page_controller.rb +37 -0
- data/app/controllers/decidim/participatory_processes/admin/participatory_process_publications_controller.rb +9 -29
- data/app/controllers/decidim/participatory_processes/admin/participatory_process_step_activations_controller.rb +1 -1
- data/app/controllers/decidim/participatory_processes/admin/participatory_process_steps_controller.rb +16 -4
- data/app/controllers/decidim/participatory_processes/admin/participatory_process_types_controller.rb +19 -0
- data/app/controllers/decidim/participatory_processes/admin/participatory_process_user_roles_controller.rb +8 -91
- data/app/controllers/decidim/participatory_processes/admin/participatory_processes_controller.rb +3 -0
- data/app/controllers/decidim/participatory_processes/participatory_process_groups_controller.rb +14 -1
- data/app/controllers/decidim/participatory_processes/participatory_processes_controller.rb +19 -4
- data/app/events/decidim/participatory_process_role_assigned_event.rb +6 -6
- data/app/events/decidim/participatory_process_step_activated_event.rb +5 -4
- data/app/events/decidim/participatory_process_step_changed_event.rb +5 -4
- data/app/forms/decidim/participatory_processes/admin/participatory_process_copy_form.rb +1 -1
- data/app/forms/decidim/participatory_processes/admin/participatory_process_form.rb +1 -1
- data/app/forms/decidim/participatory_processes/admin/participatory_process_import_form.rb +1 -1
- data/app/forms/decidim/participatory_processes/admin/participatory_process_step_form.rb +2 -2
- data/app/forms/decidim/participatory_processes/admin/participatory_process_user_role_form.rb +2 -18
- data/app/helpers/decidim/participatory_processes/admin/participatory_process_helper.rb +1 -0
- data/app/helpers/decidim/participatory_processes/application_helper.rb +5 -0
- data/app/helpers/decidim/participatory_processes/participatory_process_helper.rb +37 -9
- data/app/helpers/decidim/participatory_processes/participatory_space_content_blocks_helper.rb +17 -0
- data/app/jobs/decidim/participatory_processes/change_active_step_job.rb +35 -0
- data/app/models/decidim/participatory_process.rb +5 -5
- data/app/models/decidim/participatory_process_group.rb +4 -0
- data/app/models/decidim/participatory_process_user_role.rb +5 -34
- data/app/packs/entrypoints/decidim_participatory_processes.js +0 -2
- data/app/packs/src/decidim/participatory_processes/admin/participatory_processes.js +2 -2
- data/app/permissions/decidim/participatory_processes/permissions.rb +11 -15
- data/app/presenters/decidim/participatory_processes/admin_log/participatory_process_group_presenter.rb +2 -2
- data/app/presenters/decidim/participatory_processes/admin_log/participatory_process_presenter.rb +2 -2
- data/app/presenters/decidim/participatory_processes/admin_log/participatory_process_type_presenter.rb +2 -2
- data/app/presenters/decidim/participatory_processes/admin_log/participatory_process_user_role_presenter.rb +2 -2
- data/app/presenters/decidim/participatory_processes/admin_log/step_presenter.rb +2 -2
- data/app/presenters/decidim/participatory_processes/participatory_process_group_stats_presenter.rb +4 -40
- data/app/presenters/decidim/participatory_processes/participatory_process_metric_charts_presenter.rb +0 -68
- data/app/presenters/decidim/participatory_processes/participatory_process_presenter.rb +6 -0
- data/app/presenters/decidim/participatory_processes/participatory_process_stats_presenter.rb +3 -42
- data/app/queries/decidim/participatory_processes/admin/admin_users.rb +1 -1
- data/app/queries/decidim/participatory_processes/admin/moderators.rb +1 -1
- data/app/serializers/decidim/participatory_processes/participatory_process_importer.rb +4 -4
- data/app/views/decidim/participatory_processes/admin/participatory_process_copies/_form.html.erb +24 -29
- data/app/views/decidim/participatory_processes/admin/participatory_process_copies/new.html.erb +16 -5
- data/app/views/decidim/participatory_processes/admin/participatory_process_groups/_form.html.erb +72 -50
- data/app/views/decidim/participatory_processes/admin/participatory_process_groups/edit.html.erb +15 -9
- data/app/views/decidim/participatory_processes/admin/participatory_process_groups/index.html.erb +49 -54
- data/app/views/decidim/participatory_processes/admin/participatory_process_groups/new.html.erb +28 -5
- data/app/views/decidim/participatory_processes/admin/participatory_process_imports/_form.html.erb +33 -39
- data/app/views/decidim/participatory_processes/admin/participatory_process_imports/new.html.erb +18 -5
- data/app/views/decidim/participatory_processes/admin/participatory_process_steps/_form.html.erb +18 -25
- data/app/views/decidim/participatory_processes/admin/participatory_process_steps/edit.html.erb +16 -5
- data/app/views/decidim/participatory_processes/admin/participatory_process_steps/index.html.erb +54 -54
- data/app/views/decidim/participatory_processes/admin/participatory_process_steps/new.html.erb +18 -5
- data/app/views/decidim/participatory_processes/admin/participatory_process_steps/show.html.erb +2 -2
- data/app/views/decidim/participatory_processes/admin/participatory_process_types/_form.html.erb +6 -8
- data/app/views/decidim/participatory_processes/admin/participatory_process_types/edit.html.erb +14 -6
- data/app/views/decidim/participatory_processes/admin/participatory_process_types/index.html.erb +47 -50
- data/app/views/decidim/participatory_processes/admin/participatory_process_types/new.html.erb +14 -6
- data/app/views/decidim/participatory_processes/admin/participatory_process_user_roles/_form.html.erb +14 -18
- data/app/views/decidim/participatory_processes/admin/participatory_process_user_roles/edit.html.erb +17 -6
- data/app/views/decidim/participatory_processes/admin/participatory_process_user_roles/index.html.erb +59 -60
- data/app/views/decidim/participatory_processes/admin/participatory_process_user_roles/new.html.erb +16 -5
- data/app/views/decidim/participatory_processes/admin/participatory_processes/_form.html.erb +193 -146
- data/app/views/decidim/participatory_processes/admin/participatory_processes/edit.html.erb +25 -11
- data/app/views/decidim/participatory_processes/admin/participatory_processes/index.html.erb +111 -128
- data/app/views/decidim/participatory_processes/admin/participatory_processes/new.html.erb +16 -9
- data/app/views/decidim/participatory_processes/participatory_process_groups/show.html.erb +6 -10
- data/app/views/decidim/participatory_processes/participatory_processes/_collection.html.erb +8 -0
- data/app/views/decidim/participatory_processes/participatory_processes/all_metrics.html.erb +21 -8
- data/app/views/decidim/participatory_processes/participatory_processes/index.html.erb +19 -17
- data/app/views/decidim/participatory_processes/participatory_processes/index.js.erb +1 -8
- data/app/views/decidim/participatory_processes/participatory_processes/show.html.erb +14 -128
- data/app/views/layouts/decidim/_process_header.html.erb +15 -26
- data/app/views/layouts/decidim/_process_nav_item.html.erb +6 -0
- data/app/views/layouts/decidim/admin/_manage_processes.html.erb +36 -0
- data/app/views/layouts/decidim/admin/participatory_process.html.erb +12 -14
- data/app/views/layouts/decidim/admin/participatory_process_group.html.erb +23 -13
- data/app/views/layouts/decidim/admin/participatory_process_groups.html.erb +13 -0
- data/app/views/layouts/decidim/admin/participatory_process_type.html.erb +13 -11
- data/app/views/layouts/decidim/admin/participatory_processes.html.erb +14 -8
- data/app/views/layouts/decidim/participatory_process.html.erb +7 -14
- data/config/locales/ar.yml +1 -55
- data/config/locales/bg.yml +0 -72
- data/config/locales/ca.yml +50 -70
- data/config/locales/cs.yml +51 -71
- data/config/locales/de.yml +51 -71
- data/config/locales/el.yml +8 -64
- data/config/locales/en.yml +52 -72
- data/config/locales/es-MX.yml +49 -69
- data/config/locales/es-PY.yml +49 -69
- data/config/locales/es.yml +49 -69
- data/config/locales/eu.yml +89 -112
- data/config/locales/fi-plain.yml +50 -70
- data/config/locales/fi.yml +51 -71
- data/config/locales/fr-CA.yml +51 -71
- data/config/locales/fr.yml +52 -72
- data/config/locales/ga-IE.yml +0 -16
- data/config/locales/gl.yml +0 -67
- data/config/locales/hu.yml +6 -66
- data/config/locales/id-ID.yml +1 -55
- data/config/locales/is-IS.yml +0 -24
- data/config/locales/it.yml +0 -67
- data/config/locales/ja.yml +51 -71
- data/config/locales/lb.yml +1 -153
- data/config/locales/lt.yml +39 -65
- data/config/locales/lv.yml +1 -59
- data/config/locales/nl.yml +0 -67
- data/config/locales/no.yml +0 -92
- data/config/locales/pl.yml +0 -100
- data/config/locales/pt-BR.yml +1 -113
- data/config/locales/pt.yml +0 -67
- data/config/locales/ro-RO.yml +4 -64
- data/config/locales/ru.yml +0 -49
- data/config/locales/sk.yml +1 -56
- data/config/locales/sl.yml +0 -7
- data/config/locales/sr-CS.yml +0 -4
- data/config/locales/sv.yml +15 -66
- data/config/locales/tr-TR.yml +7 -68
- data/config/locales/uk.yml +0 -49
- data/config/locales/zh-CN.yml +2 -63
- data/config/locales/zh-TW.yml +3 -63
- data/db/migrate/20220315100140_change_steps_dates_to_datetime.rb +8 -0
- data/lib/decidim/api/participatory_process_step_type.rb +2 -2
- data/lib/decidim/participatory_processes/admin_engine.rb +20 -139
- data/lib/decidim/participatory_processes/content_blocks/registry_manager.rb +278 -0
- data/lib/decidim/participatory_processes/engine.rb +13 -103
- data/lib/decidim/participatory_processes/menu.rb +190 -0
- data/lib/decidim/participatory_processes/participatory_space.rb +7 -204
- data/lib/decidim/participatory_processes/query_extensions.rb +2 -2
- data/lib/decidim/participatory_processes/seeds.rb +164 -0
- data/lib/decidim/participatory_processes/test/factories.rb +58 -65
- data/lib/decidim/participatory_processes/version.rb +1 -1
- data/lib/tasks/decidim_participatory_processes.rake +8 -0
- metadata +65 -70
- data/app/cells/decidim/participatory_process_groups/content_blocks/highlighted_participatory_processes/filters.erb +0 -21
- data/app/cells/decidim/participatory_process_groups/content_blocks/highlighted_participatory_processes/filters_small_view.erb +0 -18
- data/app/cells/decidim/participatory_process_groups/content_blocks/highlighted_participatory_processes/participatory_space_filters.erb +0 -6
- data/app/cells/decidim/participatory_process_groups/content_blocks/highlighted_participatory_processes/show.erb +0 -8
- data/app/cells/decidim/participatory_process_groups/content_blocks/highlighted_participatory_processes/title_filter_order.erb +0 -8
- data/app/cells/decidim/participatory_process_groups/content_blocks/highlighted_participatory_processes_cell.rb +0 -60
- data/app/cells/decidim/participatory_process_groups/content_blocks/html/show.erb +0 -3
- data/app/cells/decidim/participatory_process_groups/content_blocks/html_cell.rb +0 -13
- data/app/cells/decidim/participatory_process_groups/content_blocks/metadata/show.erb +0 -28
- data/app/cells/decidim/participatory_process_groups/content_blocks/metadata_cell.rb +0 -15
- data/app/cells/decidim/participatory_process_groups/content_blocks/title/show.erb +0 -43
- data/app/cells/decidim/participatory_process_groups/content_blocks/title_cell.rb +0 -64
- data/app/cells/decidim/participatory_processes/content_blocks/highlighted_processes/_all_processes.erb +0 -9
- data/app/cells/decidim/participatory_processes/content_blocks/highlighted_processes/show.erb +0 -14
- data/app/cells/decidim/participatory_processes/content_blocks/highlighted_processes/single_process.erb +0 -48
- data/app/cells/decidim/participatory_processes/process_group_m/footer.erb +0 -8
- data/app/cells/decidim/participatory_processes/process_group_m_cell.rb +0 -60
- data/app/cells/decidim/participatory_processes/process_group_s/image.erb +0 -1
- data/app/cells/decidim/participatory_processes/process_group_s/show.erb +0 -8
- data/app/cells/decidim/participatory_processes/process_m/data.erb +0 -21
- data/app/cells/decidim/participatory_processes/process_m/footer.erb +0 -14
- data/app/cells/decidim/participatory_processes/process_m/tags.erb +0 -8
- data/app/cells/decidim/participatory_processes/process_m_cell.rb +0 -87
- data/app/cells/decidim/participatory_processes/process_s/image.erb +0 -1
- data/app/cells/decidim/participatory_processes/process_s/show.erb +0 -14
- data/app/commands/decidim/participatory_processes/admin/create_participatory_process_admin.rb +0 -58
- data/app/commands/decidim/participatory_processes/admin/destroy_participatory_process_admin.rb +0 -58
- data/app/commands/decidim/participatory_processes/admin/notify_role_assigned_to_participatory_process.rb +0 -22
- data/app/commands/decidim/participatory_processes/admin/publish_participatory_process.rb +0 -40
- data/app/commands/decidim/participatory_processes/admin/unpublish_participatory_process.rb +0 -40
- data/app/commands/decidim/participatory_processes/admin/update_participatory_process_admin.rb +0 -56
- data/app/controllers/decidim/participatory_processes/participatory_process_steps_controller.rb +0 -28
- data/app/controllers/decidim/participatory_processes/widgets_controller.rb +0 -37
- data/app/packs/src/decidim/participatory_processes/filters.js +0 -28
- data/app/views/decidim/participatory_process_steps/_participatory_process_step.html.erb +0 -16
- data/app/views/decidim/participatory_processes/participatory_process_steps/_timeline.html.erb +0 -7
- data/app/views/decidim/participatory_processes/participatory_process_steps/index.html.erb +0 -18
- data/app/views/decidim/participatory_processes/participatory_processes/_metrics.html.erb +0 -10
- data/app/views/decidim/participatory_processes/participatory_processes/_order_by_processes.html.erb +0 -1
- data/app/views/decidim/participatory_processes/participatory_processes/_participatory_process_group.html.erb +0 -4
- data/app/views/decidim/participatory_processes/participatory_processes/_promoted_process.html.erb +0 -39
- data/app/views/decidim/participatory_processes/participatory_processes/_promoted_process_group.html.erb +0 -31
- data/app/views/layouts/decidim/_process_header_steps.html.erb +0 -37
- data/app/views/layouts/decidim/_process_navigation.html.erb +0 -20
- data/config/locales/he-IL.yml +0 -1
- data/db/seeds/Exampledocument.pdf +0 -0
- data/db/seeds/city.jpeg +0 -0
- data/db/seeds/city2.jpeg +0 -0
- data/db/seeds/homepage_image.jpg +0 -0
- data/decidim-participatory_processes.gemspec +0 -31
data/app/commands/decidim/participatory_processes/admin/destroy_participatory_process_type.rb
CHANGED
@@ -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
|
22
|
+
# - :invalid if the form was not valid and we could not proceed.
|
23
23
|
#
|
24
24
|
# Returns nothing.
|
25
25
|
def call
|
@@ -17,7 +17,7 @@ module Decidim
|
|
17
17
|
# Executes the command. Broadcasts these events:
|
18
18
|
#
|
19
19
|
# - :ok when everything is valid.
|
20
|
-
# - :invalid if the form
|
20
|
+
# - :invalid if the form was not valid and we could not proceed.
|
21
21
|
#
|
22
22
|
# Returns nothing.
|
23
23
|
def call
|
data/app/commands/decidim/participatory_processes/admin/reorder_participatory_process_steps.rb
CHANGED
@@ -17,7 +17,7 @@ module Decidim
|
|
17
17
|
# Executes the command. Broadcasts these events:
|
18
18
|
#
|
19
19
|
# - :ok when everything is valid.
|
20
|
-
# - :invalid if the data
|
20
|
+
# - :invalid if the data was not valid and we could not proceed.
|
21
21
|
#
|
22
22
|
# Returns nothing.
|
23
23
|
def call
|
@@ -20,7 +20,7 @@ module Decidim
|
|
20
20
|
# Executes the command. Broadcasts these events:
|
21
21
|
#
|
22
22
|
# - :ok when everything is valid.
|
23
|
-
# - :invalid if the form
|
23
|
+
# - :invalid if the form was not valid and we could not proceed.
|
24
24
|
#
|
25
25
|
# Returns nothing.
|
26
26
|
def call
|
data/app/commands/decidim/participatory_processes/admin/update_participatory_process_group.rb
CHANGED
@@ -20,7 +20,7 @@ module Decidim
|
|
20
20
|
# Executes the command. Broadcasts these events:
|
21
21
|
#
|
22
22
|
# - :ok when everything is valid.
|
23
|
-
# - :invalid if the form
|
23
|
+
# - :invalid if the form was not valid and we could not proceed.
|
24
24
|
#
|
25
25
|
# Returns nothing.
|
26
26
|
def call
|
@@ -57,7 +57,7 @@ module Decidim
|
|
57
57
|
description: form.description,
|
58
58
|
hashtag: form.hashtag,
|
59
59
|
group_url: form.group_url,
|
60
|
-
participatory_processes
|
60
|
+
participatory_processes:,
|
61
61
|
developer_group: form.developer_group,
|
62
62
|
local_area: form.local_area,
|
63
63
|
meta_scope: form.meta_scope,
|
data/app/commands/decidim/participatory_processes/admin/update_participatory_process_step.rb
CHANGED
@@ -20,7 +20,7 @@ module Decidim
|
|
20
20
|
# Executes the command. Broadcasts these events:
|
21
21
|
#
|
22
22
|
# - :ok when everything is valid.
|
23
|
-
# - :invalid if the form
|
23
|
+
# - :invalid if the form was not valid and we could not proceed.
|
24
24
|
#
|
25
25
|
# Returns nothing.
|
26
26
|
def call
|
data/app/commands/decidim/participatory_processes/admin/update_participatory_process_type.rb
CHANGED
@@ -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
|
22
|
+
# - :invalid if the form was not valid and we could not proceed.
|
23
23
|
#
|
24
24
|
# Returns nothing.
|
25
25
|
def call
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module Decidim
|
4
4
|
module ParticipatoryProcesses
|
5
|
-
# This class infers the current participatory process we
|
5
|
+
# This class infers the current participatory process we are scoped to by
|
6
6
|
# looking at the request parameters and the organization in the request
|
7
7
|
# environment, and injects it into the environment.
|
8
8
|
class CurrentParticipatoryProcess
|
@@ -11,6 +11,8 @@ module Decidim
|
|
11
11
|
|
12
12
|
private
|
13
13
|
|
14
|
+
helper_method :tabs
|
15
|
+
|
14
16
|
def permissions_context
|
15
17
|
super.merge(
|
16
18
|
current_participatory_space: try(:current_participatory_space)
|
@@ -20,6 +22,33 @@ module Decidim
|
|
20
22
|
def permission_class_chain
|
21
23
|
::Decidim.permissions_registry.chain_for(::Decidim::ParticipatoryProcesses::Admin::ApplicationController)
|
22
24
|
end
|
25
|
+
|
26
|
+
def tabs
|
27
|
+
@tabs ||= items.map { |item| item.slice(:id, :text, :icon) }
|
28
|
+
end
|
29
|
+
|
30
|
+
def panels
|
31
|
+
@panels ||= items.map { |item| item.slice(:id, :method, :args) }
|
32
|
+
end
|
33
|
+
|
34
|
+
def items
|
35
|
+
@items ||= [
|
36
|
+
{
|
37
|
+
id: "images",
|
38
|
+
text: t("decidim.application.photos.photos"),
|
39
|
+
icon: "upload-line",
|
40
|
+
method: :cell,
|
41
|
+
args: ["decidim/images_panel", @current_initiative]
|
42
|
+
},
|
43
|
+
{
|
44
|
+
id: "documents",
|
45
|
+
text: t("decidim.application.documents.documents"),
|
46
|
+
icon: "upload-line",
|
47
|
+
method: :cell,
|
48
|
+
args: ["decidim/documents_panel", @current_initiative]
|
49
|
+
}
|
50
|
+
].select { |item| item[:enabled] }
|
51
|
+
end
|
23
52
|
end
|
24
53
|
end
|
25
54
|
end
|
data/app/controllers/decidim/participatory_processes/admin/concerns/participatory_process_admin.rb
CHANGED
@@ -20,6 +20,8 @@ module Decidim
|
|
20
20
|
included do
|
21
21
|
include Decidim::Admin::ParticipatorySpaceAdminContext
|
22
22
|
helper_method :current_participatory_process
|
23
|
+
add_breadcrumb_item_from_menu :admin_participatory_process_menu
|
24
|
+
|
23
25
|
participatory_space_admin_layout
|
24
26
|
|
25
27
|
def organization_processes
|
@@ -32,7 +34,7 @@ module Decidim
|
|
32
34
|
end
|
33
35
|
|
34
36
|
def permissions_context
|
35
|
-
super.merge(current_participatory_space:
|
37
|
+
super.merge(current_participatory_space:)
|
36
38
|
end
|
37
39
|
|
38
40
|
alias_method :current_participatory_process, :current_participatory_space
|
@@ -9,6 +9,7 @@ module Decidim
|
|
9
9
|
class ParticipatoryProcessAttachmentCollectionsController < Decidim::Admin::ApplicationController
|
10
10
|
include Decidim::Admin::Concerns::HasAttachmentCollections
|
11
11
|
include Concerns::ParticipatoryProcessAdmin
|
12
|
+
include Decidim::Admin::Concerns::HasTabbedMenu
|
12
13
|
|
13
14
|
def after_destroy_path
|
14
15
|
participatory_process_attachment_collections_path(current_participatory_process)
|
@@ -17,6 +18,10 @@ module Decidim
|
|
17
18
|
def collection_for
|
18
19
|
current_participatory_process
|
19
20
|
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def tab_menu_name = :participatory_process_admin_attachments_menu
|
20
25
|
end
|
21
26
|
end
|
22
27
|
end
|
@@ -9,6 +9,7 @@ module Decidim
|
|
9
9
|
class ParticipatoryProcessAttachmentsController < Decidim::Admin::ApplicationController
|
10
10
|
include Concerns::ParticipatoryProcessAdmin
|
11
11
|
include Decidim::Admin::Concerns::HasAttachments
|
12
|
+
include Decidim::Admin::Concerns::HasTabbedMenu
|
12
13
|
|
13
14
|
def after_destroy_path
|
14
15
|
participatory_process_attachments_path(current_participatory_process)
|
@@ -17,6 +18,10 @@ module Decidim
|
|
17
18
|
def attached_to
|
18
19
|
current_participatory_process
|
19
20
|
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def tab_menu_name = :participatory_process_admin_attachments_menu
|
20
25
|
end
|
21
26
|
end
|
22
27
|
end
|
@@ -5,7 +5,7 @@ module Decidim
|
|
5
5
|
module Admin
|
6
6
|
# Controller that allows to manage the content from the participatory process landing page content blocks
|
7
7
|
class ParticipatoryProcessGroupLandingPageContentBlocksController < Decidim::ParticipatoryProcesses::Admin::ApplicationController
|
8
|
-
include Decidim::Admin::LandingPageContentBlocks
|
8
|
+
include Decidim::Admin::ContentBlocks::LandingPageContentBlocks
|
9
9
|
|
10
10
|
layout "decidim/admin/participatory_process_group"
|
11
11
|
|
@@ -33,10 +33,6 @@ module Decidim
|
|
33
33
|
participatory_process_group_landing_page_content_block_path(scoped_resource, params[:id])
|
34
34
|
end
|
35
35
|
|
36
|
-
def submit_button_text
|
37
|
-
t("participatory_process_group_landing_page_content_blocks.edit.update", scope: "decidim.admin")
|
38
|
-
end
|
39
|
-
|
40
36
|
alias participatory_process_group scoped_resource
|
41
37
|
|
42
38
|
def collection
|
@@ -6,7 +6,11 @@ module Decidim
|
|
6
6
|
# Controller that allows managing the participatory process group landing
|
7
7
|
# page
|
8
8
|
class ParticipatoryProcessGroupLandingPageController < Decidim::ParticipatoryProcesses::Admin::ApplicationController
|
9
|
-
include Decidim::Admin::LandingPage
|
9
|
+
include Decidim::Admin::ContentBlocks::LandingPage
|
10
|
+
include Decidim::TranslatableAttributes
|
11
|
+
|
12
|
+
before_action :set_context_breadcrumb
|
13
|
+
add_breadcrumb_item_from_menu :admin_participatory_process_group_menu
|
10
14
|
|
11
15
|
layout "decidim/admin/participatory_process_group"
|
12
16
|
|
@@ -28,12 +32,9 @@ module Decidim
|
|
28
32
|
participatory_process_group_landing_page_path(scoped_resource)
|
29
33
|
end
|
30
34
|
|
31
|
-
def
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
def inactive_content_blocks_title
|
36
|
-
t("participatory_process_group_landing_page.edit.inactive_content_blocks", scope: "decidim.admin")
|
35
|
+
def resource_create_url(manifest_name)
|
36
|
+
participatory_process_group_landing_page_content_blocks_path(participatory_process_group_id: params[:participatory_process_group_id],
|
37
|
+
manifest_name:)
|
37
38
|
end
|
38
39
|
|
39
40
|
def resource_content_block_cell
|
@@ -47,6 +48,22 @@ module Decidim
|
|
47
48
|
def collection
|
48
49
|
@collection ||= OrganizationParticipatoryProcessGroups.new(current_user.organization).query
|
49
50
|
end
|
51
|
+
|
52
|
+
def set_context_breadcrumb
|
53
|
+
@context_breadcrumb_items ||= [
|
54
|
+
{
|
55
|
+
label: I18n.t("menu.participatory_process_groups", scope: "decidim.admin"),
|
56
|
+
url: decidim_admin_participatory_processes.participatory_process_groups_path,
|
57
|
+
active: false
|
58
|
+
},
|
59
|
+
{
|
60
|
+
label: translated_attribute(scoped_resource.title),
|
61
|
+
url: edit_participatory_process_group_path(scoped_resource),
|
62
|
+
active: false,
|
63
|
+
resource: scoped_resource
|
64
|
+
}
|
65
|
+
]
|
66
|
+
end
|
50
67
|
end
|
51
68
|
end
|
52
69
|
end
|
@@ -6,8 +6,13 @@ module Decidim
|
|
6
6
|
# Controller that allows managing participatory process groups.
|
7
7
|
#
|
8
8
|
class ParticipatoryProcessGroupsController < Decidim::ParticipatoryProcesses::Admin::ApplicationController
|
9
|
+
include Decidim::TranslatableAttributes
|
10
|
+
|
9
11
|
helper ProcessesForSelectHelper
|
10
12
|
|
13
|
+
before_action :set_controller_breadcrumb
|
14
|
+
add_breadcrumb_item_from_menu :admin_participatory_processes_menu
|
15
|
+
|
11
16
|
helper_method :collection, :participatory_process_group
|
12
17
|
|
13
18
|
def index
|
@@ -80,6 +85,17 @@ module Decidim
|
|
80
85
|
|
81
86
|
private
|
82
87
|
|
88
|
+
def set_controller_breadcrumb
|
89
|
+
return unless collection.exists?(params[:id])
|
90
|
+
|
91
|
+
controller_breadcrumb_items.append(
|
92
|
+
label: translated_attribute(participatory_process_group.title),
|
93
|
+
url: edit_participatory_process_group_path(participatory_process_group),
|
94
|
+
active: true,
|
95
|
+
resource: participatory_process_group
|
96
|
+
)
|
97
|
+
end
|
98
|
+
|
83
99
|
def participatory_process_group
|
84
100
|
@participatory_process_group ||= collection.find(params[:id])
|
85
101
|
end
|
@@ -4,6 +4,10 @@ module Decidim
|
|
4
4
|
module ParticipatoryProcesses
|
5
5
|
module Admin
|
6
6
|
class ParticipatoryProcessImportsController < Decidim::ParticipatoryProcesses::Admin::ApplicationController
|
7
|
+
before_action :set_controller_breadcrumb
|
8
|
+
|
9
|
+
layout "decidim/admin/participatory_processes"
|
10
|
+
|
7
11
|
def new
|
8
12
|
enforce_permission_to :import, :process
|
9
13
|
@form = form(ParticipatoryProcessImportForm).instance
|
@@ -25,6 +29,16 @@ module Decidim
|
|
25
29
|
end
|
26
30
|
end
|
27
31
|
end
|
32
|
+
|
33
|
+
private
|
34
|
+
|
35
|
+
def set_controller_breadcrumb
|
36
|
+
controller_breadcrumb_items << {
|
37
|
+
label: t("import", scope: "decidim.admin.actions"),
|
38
|
+
url: new_import_path,
|
39
|
+
active: true
|
40
|
+
}
|
41
|
+
end
|
28
42
|
end
|
29
43
|
end
|
30
44
|
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module ParticipatoryProcesses
|
5
|
+
module Admin
|
6
|
+
# Controller that allows to manage the content from the participatory process landing page content blocks
|
7
|
+
class ParticipatoryProcessLandingPageContentBlocksController < Decidim::ParticipatoryProcesses::Admin::ApplicationController
|
8
|
+
include Decidim::Admin::ContentBlocks::LandingPageContentBlocks
|
9
|
+
include Concerns::ParticipatoryProcessAdmin
|
10
|
+
|
11
|
+
layout "decidim/admin/participatory_process"
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def content_block_scope
|
16
|
+
:participatory_process_homepage
|
17
|
+
end
|
18
|
+
|
19
|
+
alias scoped_resource current_participatory_space
|
20
|
+
|
21
|
+
def enforce_permission_to_update_resource
|
22
|
+
enforce_permission_to :update, :process, process: scoped_resource
|
23
|
+
end
|
24
|
+
|
25
|
+
def edit_resource_landing_page_path
|
26
|
+
edit_participatory_process_landing_page_path(scoped_resource)
|
27
|
+
end
|
28
|
+
|
29
|
+
def resource_landing_page_content_block_path
|
30
|
+
participatory_process_landing_page_content_block_path(scoped_resource, params[:id])
|
31
|
+
end
|
32
|
+
|
33
|
+
def content_block_destroy_error_text = t("destroy.error", scope: i18n_scope)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module ParticipatoryProcesses
|
5
|
+
module Admin
|
6
|
+
# Controller that allows managing the participatory process landing page
|
7
|
+
class ParticipatoryProcessLandingPageController < Decidim::ParticipatoryProcesses::Admin::ApplicationController
|
8
|
+
include Decidim::Admin::ContentBlocks::LandingPage
|
9
|
+
include Concerns::ParticipatoryProcessAdmin
|
10
|
+
|
11
|
+
layout "decidim/admin/participatory_process"
|
12
|
+
|
13
|
+
def content_block_scope
|
14
|
+
current_participatory_space_manifest.content_blocks_scope_name
|
15
|
+
end
|
16
|
+
|
17
|
+
alias scoped_resource current_participatory_space
|
18
|
+
|
19
|
+
def enforce_permission_to_update_resource
|
20
|
+
enforce_permission_to :update, :process, process: scoped_resource
|
21
|
+
end
|
22
|
+
|
23
|
+
def resource_sort_url
|
24
|
+
participatory_process_landing_page_path(scoped_resource)
|
25
|
+
end
|
26
|
+
|
27
|
+
def resource_create_url(manifest_name)
|
28
|
+
participatory_process_landing_page_content_blocks_path(slug: params[:slug], manifest_name:)
|
29
|
+
end
|
30
|
+
|
31
|
+
def resource_content_block_cell
|
32
|
+
"decidim/participatory_processes/content_block"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -5,40 +5,20 @@ module Decidim
|
|
5
5
|
module Admin
|
6
6
|
# Controller that allows managing participatory process publications.
|
7
7
|
#
|
8
|
-
|
8
|
+
# i18n-tasks-use t('decidim.admin.participatory_process_publications.create.error')
|
9
|
+
# i18n-tasks-use t('decidim.admin.participatory_process_publications.create.success')
|
10
|
+
# i18n-tasks-use t('decidim.admin.participatory_process_publications.destroy.error')
|
11
|
+
# i18n-tasks-use t('decidim.admin.participatory_process_publications.destroy.success')
|
12
|
+
class ParticipatoryProcessPublicationsController < Decidim::Admin::SpacePublicationsController
|
9
13
|
include Concerns::ParticipatoryProcessAdmin
|
10
14
|
|
11
|
-
|
12
|
-
enforce_permission_to :publish, :process, process: current_participatory_process
|
15
|
+
private
|
13
16
|
|
14
|
-
|
15
|
-
on(:ok) do
|
16
|
-
flash[:notice] = I18n.t("participatory_process_publications.create.success", scope: "decidim.admin")
|
17
|
-
end
|
17
|
+
def enforce_permission_to_publish = enforce_permission_to(:publish, :process, process: current_participatory_process)
|
18
18
|
|
19
|
-
|
20
|
-
flash.now[:alert] = I18n.t("participatory_process_publications.create.error", scope: "decidim.admin")
|
21
|
-
end
|
19
|
+
def i18n_scope = "decidim.admin.participatory_process_publications"
|
22
20
|
|
23
|
-
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
def destroy
|
28
|
-
enforce_permission_to :publish, :process, process: current_participatory_process
|
29
|
-
|
30
|
-
UnpublishParticipatoryProcess.call(current_participatory_process, current_user) do
|
31
|
-
on(:ok) do
|
32
|
-
flash[:notice] = I18n.t("participatory_process_publications.destroy.success", scope: "decidim.admin")
|
33
|
-
end
|
34
|
-
|
35
|
-
on(:invalid) do
|
36
|
-
flash.now[:alert] = I18n.t("participatory_process_publications.destroy.error", scope: "decidim.admin")
|
37
|
-
end
|
38
|
-
|
39
|
-
redirect_back(fallback_location: participatory_processes_path)
|
40
|
-
end
|
41
|
-
end
|
21
|
+
def fallback_location = participatory_processes_path
|
42
22
|
end
|
43
23
|
end
|
44
24
|
end
|
@@ -9,7 +9,7 @@ module Decidim
|
|
9
9
|
include Concerns::ParticipatoryProcessAdmin
|
10
10
|
|
11
11
|
def create
|
12
|
-
enforce_permission_to
|
12
|
+
enforce_permission_to(:activate, :process_step, process_step:)
|
13
13
|
|
14
14
|
ActivateParticipatoryProcessStep.call(process_step, current_user) do
|
15
15
|
on(:ok) do
|
data/app/controllers/decidim/participatory_processes/admin/participatory_process_steps_controller.rb
CHANGED
@@ -8,6 +8,9 @@ module Decidim
|
|
8
8
|
class ParticipatoryProcessStepsController < Decidim::Admin::ApplicationController
|
9
9
|
include Concerns::ParticipatoryProcessAdmin
|
10
10
|
|
11
|
+
before_action :find_participatory_process_step, except: [:index, :new, :create]
|
12
|
+
before_action :set_controller_breadcrumb
|
13
|
+
|
11
14
|
def index
|
12
15
|
enforce_permission_to :read, :process_step
|
13
16
|
end
|
@@ -35,13 +38,11 @@ module Decidim
|
|
35
38
|
end
|
36
39
|
|
37
40
|
def edit
|
38
|
-
@participatory_process_step = collection.find(params[:id])
|
39
41
|
enforce_permission_to :update, :process_step, process_step: @participatory_process_step
|
40
42
|
@form = form(ParticipatoryProcessStepForm).from_model(@participatory_process_step)
|
41
43
|
end
|
42
44
|
|
43
45
|
def update
|
44
|
-
@participatory_process_step = collection.find(params[:id])
|
45
46
|
enforce_permission_to :update, :process_step, process_step: @participatory_process_step
|
46
47
|
@form = form(ParticipatoryProcessStepForm).from_params(params)
|
47
48
|
|
@@ -59,12 +60,10 @@ module Decidim
|
|
59
60
|
end
|
60
61
|
|
61
62
|
def show
|
62
|
-
@participatory_process_step = collection.find(params[:id])
|
63
63
|
enforce_permission_to :read, :process_step, process_step: @participatory_process_step
|
64
64
|
end
|
65
65
|
|
66
66
|
def destroy
|
67
|
-
@participatory_process_step = collection.find(params[:id])
|
68
67
|
enforce_permission_to :destroy, :process_step, process_step: @participatory_process_step
|
69
68
|
|
70
69
|
DestroyParticipatoryProcessStep.call(@participatory_process_step, current_user) do
|
@@ -85,6 +84,19 @@ module Decidim
|
|
85
84
|
def collection
|
86
85
|
@collection ||= current_participatory_process.steps
|
87
86
|
end
|
87
|
+
|
88
|
+
def find_participatory_process_step
|
89
|
+
@participatory_process_step = collection.find(params[:id])
|
90
|
+
end
|
91
|
+
|
92
|
+
def set_controller_breadcrumb
|
93
|
+
return if @participatory_process_step.blank?
|
94
|
+
|
95
|
+
controller_breadcrumb_items << {
|
96
|
+
label: translated_attribute(@participatory_process_step.title),
|
97
|
+
active: true
|
98
|
+
}
|
99
|
+
end
|
88
100
|
end
|
89
101
|
end
|
90
102
|
end
|
data/app/controllers/decidim/participatory_processes/admin/participatory_process_types_controller.rb
CHANGED
@@ -6,6 +6,9 @@ module Decidim
|
|
6
6
|
# Controller used to manage participatory process types for the current
|
7
7
|
# organization
|
8
8
|
class ParticipatoryProcessTypesController < Decidim::ParticipatoryProcesses::Admin::ApplicationController
|
9
|
+
include Decidim::TranslatableAttributes
|
10
|
+
before_action :set_controller_breadcrumb
|
11
|
+
|
9
12
|
helper_method :collection, :current_participatory_process_type
|
10
13
|
layout "decidim/admin/participatory_process_type"
|
11
14
|
|
@@ -81,6 +84,22 @@ module Decidim
|
|
81
84
|
|
82
85
|
private
|
83
86
|
|
87
|
+
def set_controller_breadcrumb
|
88
|
+
controller_breadcrumb_items << {
|
89
|
+
label: t("participatory_process_types", scope: "decidim.admin.menu"),
|
90
|
+
url: participatory_process_types_path,
|
91
|
+
active: false
|
92
|
+
}
|
93
|
+
|
94
|
+
return if params[:id].blank?
|
95
|
+
|
96
|
+
controller_breadcrumb_items << {
|
97
|
+
label: translated_attribute(current_participatory_process_type.title),
|
98
|
+
url: edit_participatory_process_type_path(current_participatory_process_type),
|
99
|
+
active: true
|
100
|
+
}
|
101
|
+
end
|
102
|
+
|
84
103
|
def participatory_process_type_form
|
85
104
|
form(Decidim::ParticipatoryProcesses::Admin::ParticipatoryProcessTypeForm)
|
86
105
|
end
|