decidim-participatory_processes 0.27.7 → 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 -518
- 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 -124
- 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 -66
- data/lib/decidim/participatory_processes/version.rb +1 -1
- data/lib/tasks/decidim_participatory_processes.rake +8 -0
- metadata +62 -67
- 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
@@ -0,0 +1,278 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module ParticipatoryProcesses
|
5
|
+
module ContentBlocks
|
6
|
+
class RegistryManager
|
7
|
+
def self.register!
|
8
|
+
Decidim.content_blocks.register(:homepage, :highlighted_processes) do |content_block|
|
9
|
+
content_block.cell = "decidim/participatory_processes/content_blocks/highlighted_processes"
|
10
|
+
content_block.public_name_key = "decidim.participatory_processes.content_blocks.highlighted_processes.name"
|
11
|
+
content_block.settings_form_cell = "decidim/participatory_processes/content_blocks/highlighted_processes_settings_form"
|
12
|
+
|
13
|
+
content_block.settings do |settings|
|
14
|
+
settings.attribute :max_results, type: :integer, default: 6
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
Decidim.content_blocks.register(:participatory_process_group_homepage, :title) do |content_block|
|
19
|
+
content_block.cell = "decidim/participatory_process_groups/content_blocks/main_data"
|
20
|
+
content_block.public_name_key = "decidim.participatory_process_groups.content_blocks.main_data.name"
|
21
|
+
content_block.default!
|
22
|
+
end
|
23
|
+
|
24
|
+
Decidim.content_blocks.register(:participatory_process_group_homepage, :extra_data) do |content_block|
|
25
|
+
content_block.cell = "decidim/participatory_process_groups/content_blocks/extra_data"
|
26
|
+
content_block.public_name_key = "decidim.participatory_process_groups.content_blocks.extra_data.name"
|
27
|
+
content_block.default!
|
28
|
+
end
|
29
|
+
|
30
|
+
Decidim.content_blocks.register(:participatory_process_group_homepage, :cta) do |content_block|
|
31
|
+
content_block.cell = "decidim/content_blocks/cta"
|
32
|
+
content_block.settings_form_cell = "decidim/content_blocks/cta_settings_form"
|
33
|
+
content_block.public_name_key = "decidim.content_blocks.cta.name"
|
34
|
+
|
35
|
+
content_block.images = [
|
36
|
+
{
|
37
|
+
name: :background_image,
|
38
|
+
uploader: "Decidim::HomepageImageUploader"
|
39
|
+
}
|
40
|
+
]
|
41
|
+
|
42
|
+
content_block.settings do |settings|
|
43
|
+
settings.attribute :button_text, type: :text, translated: true
|
44
|
+
settings.attribute :button_url, type: :string, required: true
|
45
|
+
settings.attribute :description, type: :string, translated: true, editor: true
|
46
|
+
end
|
47
|
+
|
48
|
+
content_block.default!
|
49
|
+
end
|
50
|
+
|
51
|
+
(1..3).each do |index|
|
52
|
+
Decidim.content_blocks.register(:participatory_process_group_homepage, :"html_#{index}") do |content_block|
|
53
|
+
content_block.cell = "decidim/content_blocks/html"
|
54
|
+
content_block.public_name_key = "decidim.participatory_process_groups.content_blocks.html_#{index}.name"
|
55
|
+
content_block.settings_form_cell = "decidim/content_blocks/html_settings_form"
|
56
|
+
|
57
|
+
content_block.settings do |settings|
|
58
|
+
settings.attribute :html_content, type: :text, translated: true
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
Decidim.content_blocks.register(:participatory_process_homepage, :html) do |content_block|
|
64
|
+
content_block.cell = "decidim/content_blocks/html"
|
65
|
+
content_block.public_name_key = "decidim.content_blocks.html.name"
|
66
|
+
content_block.settings_form_cell = "decidim/content_blocks/html_settings_form"
|
67
|
+
|
68
|
+
content_block.settings do |settings|
|
69
|
+
settings.attribute :html_content, type: :text, translated: true
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
Decidim.content_blocks.register(:participatory_process_homepage, :process_hero) do |content_block|
|
74
|
+
content_block.cell = "decidim/participatory_processes/content_blocks/hero"
|
75
|
+
content_block.public_name_key = "decidim.participatory_processes.content_blocks.hero.name"
|
76
|
+
end
|
77
|
+
|
78
|
+
Decidim.content_blocks.register(:participatory_process_homepage, :announcement) do |content_block|
|
79
|
+
content_block.cell = "decidim/content_blocks/participatory_space_announcement"
|
80
|
+
content_block.public_name_key = "decidim.content_blocks.announcement.name"
|
81
|
+
end
|
82
|
+
|
83
|
+
Decidim.content_blocks.register(:participatory_process_homepage, :main_data) do |content_block|
|
84
|
+
content_block.cell = "decidim/participatory_processes/content_blocks/main_data"
|
85
|
+
content_block.public_name_key = "decidim.content_blocks.main_data.name"
|
86
|
+
content_block.default!
|
87
|
+
end
|
88
|
+
|
89
|
+
Decidim.content_blocks.register(:participatory_process_homepage, :extra_data) do |content_block|
|
90
|
+
content_block.cell = "decidim/participatory_processes/content_blocks/extra_data"
|
91
|
+
content_block.public_name_key = "decidim.participatory_processes.content_blocks.extra_data.name"
|
92
|
+
end
|
93
|
+
|
94
|
+
Decidim.content_blocks.register(:participatory_process_homepage, :metadata) do |content_block|
|
95
|
+
content_block.cell = "decidim/participatory_processes/content_blocks/metadata"
|
96
|
+
content_block.public_name_key = "decidim.content_blocks.metadata.name"
|
97
|
+
content_block.default!
|
98
|
+
end
|
99
|
+
|
100
|
+
Decidim.content_blocks.register(:participatory_process_homepage, :last_activity) do |content_block|
|
101
|
+
content_block.cell = "decidim/content_blocks/participatory_space_last_activity"
|
102
|
+
content_block.public_name_key = "decidim.content_blocks.last_activity.name"
|
103
|
+
content_block.settings_form_cell = "decidim/content_blocks/last_activity_settings_form"
|
104
|
+
content_block.settings do |settings|
|
105
|
+
settings.attribute :max_last_activity_users, type: :integer, default: Decidim::ContentBlocks::ParticipatorySpaceLastActivityCell::DEFAULT_MAX_LAST_ACTIVITY_USERS
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
Decidim.content_blocks.register(:participatory_process_homepage, :stats) do |content_block|
|
110
|
+
content_block.cell = "decidim/participatory_processes/content_blocks/stats"
|
111
|
+
content_block.public_name_key = "decidim.content_blocks.participatory_space_stats.name"
|
112
|
+
end
|
113
|
+
|
114
|
+
Decidim.content_blocks.register(:participatory_process_homepage, :metrics) do |content_block|
|
115
|
+
content_block.cell = "decidim/participatory_processes/content_blocks/metrics"
|
116
|
+
content_block.public_name_key = "decidim.content_blocks.participatory_space_metrics.name"
|
117
|
+
end
|
118
|
+
|
119
|
+
Decidim.content_blocks.register(:participatory_process_homepage, :related_processes) do |content_block|
|
120
|
+
content_block.cell = "decidim/participatory_processes/content_blocks/related_processes"
|
121
|
+
content_block.settings_form_cell = "decidim/participatory_processes/content_blocks/highlighted_processes_settings_form"
|
122
|
+
content_block.public_name_key = "decidim.participatory_processes.content_blocks.related_processes.name"
|
123
|
+
|
124
|
+
content_block.settings do |settings|
|
125
|
+
settings.attribute :max_results, type: :integer, default: 6
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
Decidim.content_blocks.register(:participatory_process_homepage, :related_documents) do |content_block|
|
130
|
+
content_block.cell = "decidim/content_blocks/participatory_space_documents"
|
131
|
+
content_block.public_name_key = "decidim.application.documents.related_documents"
|
132
|
+
end
|
133
|
+
|
134
|
+
Decidim.content_blocks.register(:participatory_process_homepage, :related_images) do |content_block|
|
135
|
+
content_block.cell = "decidim/content_blocks/participatory_space_images"
|
136
|
+
content_block.public_name_key = "decidim.application.photos.related_photos"
|
137
|
+
end
|
138
|
+
|
139
|
+
Decidim.content_blocks.register(:participatory_process_group_homepage, :stats) do |content_block|
|
140
|
+
content_block.cell = "decidim/participatory_process_groups/content_blocks/statistics"
|
141
|
+
content_block.public_name_key = "decidim.participatory_process_groups.content_blocks.stats.name"
|
142
|
+
content_block.default!
|
143
|
+
end
|
144
|
+
|
145
|
+
Decidim.content_blocks.register(:participatory_process_group_homepage, :participatory_processes) do |content_block|
|
146
|
+
content_block.cell = "decidim/participatory_process_groups/content_blocks/related_processes"
|
147
|
+
content_block.settings_form_cell = "decidim/participatory_processes/content_blocks/processes_settings_form"
|
148
|
+
content_block.public_name_key = "decidim.participatory_process_groups.content_blocks.participatory_processes.name"
|
149
|
+
|
150
|
+
content_block.settings do |settings|
|
151
|
+
settings.attribute :default_filter, type: :enum, default: "active", choices: %w(active all)
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
155
|
+
register_highlighted_meetings
|
156
|
+
register_highlighted_posts
|
157
|
+
register_highlighted_proposals
|
158
|
+
register_highlighted_results
|
159
|
+
register_related_assemblies
|
160
|
+
end
|
161
|
+
|
162
|
+
def self.register_highlighted_meetings
|
163
|
+
return unless Decidim.module_installed?(:meetings)
|
164
|
+
|
165
|
+
Decidim.content_blocks.register(:participatory_process_homepage, :highlighted_meetings) do |content_block|
|
166
|
+
content_block.cell = "decidim/meetings/content_blocks/highlighted_meetings"
|
167
|
+
content_block.settings_form_cell = "decidim/content_blocks/highlighted_elements_for_component_settings_form"
|
168
|
+
content_block.public_name_key = "decidim.meetings.content_blocks.upcoming_meetings.name"
|
169
|
+
content_block.component_manifest_name = "meetings"
|
170
|
+
|
171
|
+
content_block.settings do |settings|
|
172
|
+
settings.attribute :component_id, type: :select, default: nil
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
176
|
+
Decidim.content_blocks.register(:participatory_process_group_homepage, :highlighted_meetings) do |content_block|
|
177
|
+
content_block.cell = "decidim/meetings/content_blocks/highlighted_meetings"
|
178
|
+
content_block.settings_form_cell = "decidim/content_blocks/highlighted_elements_settings_form"
|
179
|
+
content_block.public_name_key = "decidim.meetings.content_blocks.upcoming_meetings.name"
|
180
|
+
content_block.component_manifest_name = "meetings"
|
181
|
+
content_block.default!
|
182
|
+
|
183
|
+
content_block.settings do |settings|
|
184
|
+
settings.attribute :order, type: :enum, default: "random", choices: %w(random recent)
|
185
|
+
settings.attribute :show_space, type: :boolean, default: true
|
186
|
+
end
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
def self.register_highlighted_posts
|
191
|
+
return unless Decidim.module_installed?(:blogs)
|
192
|
+
|
193
|
+
Decidim.content_blocks.register(:participatory_process_homepage, :highlighted_posts) do |content_block|
|
194
|
+
content_block.cell = "decidim/blogs/content_blocks/highlighted_posts"
|
195
|
+
content_block.settings_form_cell = "decidim/content_blocks/highlighted_elements_for_component_settings_form"
|
196
|
+
content_block.public_name_key = "decidim.blogs.content_blocks.highlighted_posts.name"
|
197
|
+
content_block.component_manifest_name = "blogs"
|
198
|
+
|
199
|
+
content_block.settings do |settings|
|
200
|
+
settings.attribute :component_id, type: :select, default: nil
|
201
|
+
end
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
205
|
+
def self.register_highlighted_proposals
|
206
|
+
return unless Decidim.module_installed?(:proposals)
|
207
|
+
|
208
|
+
Decidim.content_blocks.register(:participatory_process_homepage, :highlighted_proposals) do |content_block|
|
209
|
+
content_block.cell = "decidim/proposals/content_blocks/highlighted_proposals"
|
210
|
+
content_block.settings_form_cell = "decidim/content_blocks/highlighted_elements_for_component_settings_form"
|
211
|
+
content_block.public_name_key = "decidim.proposals.content_blocks.highlighted_proposals.name"
|
212
|
+
content_block.component_manifest_name = "proposals"
|
213
|
+
|
214
|
+
content_block.settings do |settings|
|
215
|
+
settings.attribute :order, type: :enum, default: "recent", choices: %w(random recent)
|
216
|
+
settings.attribute :component_id, type: :select, default: nil
|
217
|
+
end
|
218
|
+
end
|
219
|
+
|
220
|
+
Decidim.content_blocks.register(:participatory_process_group_homepage, :highlighted_proposals) do |content_block|
|
221
|
+
content_block.cell = "decidim/proposals/content_blocks/highlighted_proposals"
|
222
|
+
content_block.settings_form_cell = "decidim/content_blocks/highlighted_elements_settings_form"
|
223
|
+
content_block.public_name_key = "decidim.proposals.content_blocks.highlighted_proposals.name"
|
224
|
+
content_block.component_manifest_name = "proposals"
|
225
|
+
|
226
|
+
content_block.settings do |settings|
|
227
|
+
settings.attribute :order, type: :enum, default: "random", choices: %w(random recent)
|
228
|
+
settings.attribute :show_space, type: :boolean, default: true
|
229
|
+
end
|
230
|
+
end
|
231
|
+
end
|
232
|
+
|
233
|
+
def self.register_highlighted_results
|
234
|
+
return unless Decidim.module_installed?(:accountability)
|
235
|
+
|
236
|
+
Decidim.content_blocks.register(:participatory_process_homepage, :highlighted_results) do |content_block|
|
237
|
+
content_block.cell = "decidim/accountability/content_blocks/highlighted_results"
|
238
|
+
content_block.settings_form_cell = "decidim/content_blocks/highlighted_elements_for_component_settings_form"
|
239
|
+
content_block.public_name_key = "decidim.accountability.content_blocks.highlighted_results.results"
|
240
|
+
content_block.component_manifest_name = "accountability"
|
241
|
+
|
242
|
+
content_block.settings do |settings|
|
243
|
+
settings.attribute :order, type: :enum, default: "random", choices: %w(random recent)
|
244
|
+
settings.attribute :component_id, type: :select, default: nil
|
245
|
+
end
|
246
|
+
end
|
247
|
+
|
248
|
+
Decidim.content_blocks.register(:participatory_process_group_homepage, :highlighted_results) do |content_block|
|
249
|
+
content_block.cell = "decidim/accountability/content_blocks/highlighted_results"
|
250
|
+
content_block.settings_form_cell = "decidim/content_blocks/highlighted_elements_settings_form"
|
251
|
+
content_block.public_name_key = "decidim.accountability.content_blocks.highlighted_results.results"
|
252
|
+
content_block.component_manifest_name = "accountability"
|
253
|
+
content_block.default!
|
254
|
+
|
255
|
+
content_block.settings do |settings|
|
256
|
+
settings.attribute :order, type: :enum, default: "random", choices: %w(random recent)
|
257
|
+
settings.attribute :show_space, type: :boolean, default: true
|
258
|
+
end
|
259
|
+
end
|
260
|
+
end
|
261
|
+
|
262
|
+
def self.register_related_assemblies
|
263
|
+
return unless Decidim.module_installed?(:assemblies)
|
264
|
+
|
265
|
+
Decidim.content_blocks.register(:participatory_process_homepage, :related_assemblies) do |content_block|
|
266
|
+
content_block.cell = "decidim/assemblies/content_blocks/related_assemblies"
|
267
|
+
content_block.settings_form_cell = "decidim/assemblies/content_blocks/highlighted_assemblies_settings_form"
|
268
|
+
content_block.public_name_key = "decidim.assemblies.content_blocks.related_assemblies.name"
|
269
|
+
|
270
|
+
content_block.settings do |settings|
|
271
|
+
settings.attribute :max_results, type: :integer, default: 6
|
272
|
+
end
|
273
|
+
end
|
274
|
+
end
|
275
|
+
end
|
276
|
+
end
|
277
|
+
end
|
278
|
+
end
|
@@ -4,6 +4,8 @@ require "rails"
|
|
4
4
|
require "active_support/all"
|
5
5
|
|
6
6
|
require "decidim/core"
|
7
|
+
require "decidim/participatory_processes/menu"
|
8
|
+
require "decidim/participatory_processes/content_blocks/registry_manager"
|
7
9
|
require "decidim/participatory_processes/query_extensions"
|
8
10
|
|
9
11
|
module Decidim
|
@@ -31,8 +33,6 @@ module Decidim
|
|
31
33
|
resources :participatory_process_groups, only: :show, path: "processes_groups"
|
32
34
|
resources :participatory_processes, only: [:index, :show], param: :slug, path: "processes" do
|
33
35
|
get "all-metrics", on: :member
|
34
|
-
resources :participatory_process_steps, only: [:index], path: "steps"
|
35
|
-
resource :widget, only: :show, path: "embed"
|
36
36
|
end
|
37
37
|
|
38
38
|
scope "/processes/:participatory_process_slug/f/:component_id" do
|
@@ -46,6 +46,14 @@ module Decidim
|
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
49
|
+
initializer "decidim_participatory_processes.register_icons" do
|
50
|
+
Decidim.icons.register(name: "Decidim::ParticipatoryProcess", icon: "treasure-map-line", description: "Participatory Process", category: "activity",
|
51
|
+
engine: :participatory_process)
|
52
|
+
Decidim.icons.register(name: "archive-line", icon: "archive-line", category: "system", description: "", engine: :participatory_process)
|
53
|
+
Decidim.icons.register(name: "grid-line", icon: "grid-line", category: "system", description: "", engine: :participatory_process)
|
54
|
+
Decidim.icons.register(name: "globe-line", icon: "globe-line", category: "system", description: "", engine: :participatory_process)
|
55
|
+
end
|
56
|
+
|
49
57
|
initializer "decidim_participatory_processes.query_extensions" do
|
50
58
|
Decidim::Api::QueryType.include Decidim::ParticipatoryProcesses::QueryExtensions
|
51
59
|
end
|
@@ -56,110 +64,12 @@ module Decidim
|
|
56
64
|
end
|
57
65
|
|
58
66
|
initializer "decidim_participatory_processes.menu" do
|
59
|
-
Decidim.
|
60
|
-
|
61
|
-
I18n.t("menu.processes", scope: "decidim"),
|
62
|
-
decidim_participatory_processes.participatory_processes_path,
|
63
|
-
position: 2,
|
64
|
-
if: Decidim::ParticipatoryProcess.where(organization: current_organization).published.any?,
|
65
|
-
active: %r{^/process(es|_groups)}
|
66
|
-
end
|
67
|
+
Decidim::ParticipatoryProcesses::Menu.register_menu!
|
68
|
+
Decidim::ParticipatoryProcesses::Menu.register_home_content_block_menu!
|
67
69
|
end
|
68
70
|
|
69
71
|
initializer "decidim_participatory_processes.content_blocks" do
|
70
|
-
Decidim.
|
71
|
-
content_block.cell = "decidim/participatory_processes/content_blocks/highlighted_processes"
|
72
|
-
content_block.public_name_key = "decidim.participatory_processes.content_blocks.highlighted_processes.name"
|
73
|
-
content_block.settings_form_cell = "decidim/participatory_processes/content_blocks/highlighted_processes_settings_form"
|
74
|
-
|
75
|
-
content_block.settings do |settings|
|
76
|
-
settings.attribute :max_results, type: :integer, default: 4
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
Decidim.content_blocks.register(:participatory_process_group_homepage, :title) do |content_block|
|
81
|
-
content_block.cell = "decidim/participatory_process_groups/content_blocks/title"
|
82
|
-
content_block.public_name_key = "decidim.participatory_process_groups.content_blocks.title.name"
|
83
|
-
content_block.default!
|
84
|
-
end
|
85
|
-
|
86
|
-
(1..3).each do |index|
|
87
|
-
Decidim.content_blocks.register(:participatory_process_group_homepage, :"html_#{index}") do |content_block|
|
88
|
-
content_block.cell = "decidim/participatory_process_groups/content_blocks/html"
|
89
|
-
content_block.public_name_key = "decidim.participatory_process_groups.content_blocks.html_#{index}.name"
|
90
|
-
content_block.settings_form_cell = "decidim/content_blocks/html_settings_form"
|
91
|
-
|
92
|
-
content_block.settings do |settings|
|
93
|
-
settings.attribute :html_content, type: :text, translated: true
|
94
|
-
end
|
95
|
-
content_block.default!
|
96
|
-
end
|
97
|
-
end
|
98
|
-
|
99
|
-
Decidim.content_blocks.register(:participatory_process_group_homepage, :metadata) do |content_block|
|
100
|
-
content_block.cell = "decidim/participatory_process_groups/content_blocks/metadata"
|
101
|
-
content_block.public_name_key = "decidim.participatory_process_groups.content_blocks.metadata.name"
|
102
|
-
content_block.default!
|
103
|
-
end
|
104
|
-
|
105
|
-
Decidim.content_blocks.register(:participatory_process_group_homepage, :cta) do |content_block|
|
106
|
-
content_block.cell = "decidim/content_blocks/cta"
|
107
|
-
content_block.settings_form_cell = "decidim/content_blocks/cta_settings_form"
|
108
|
-
content_block.public_name_key = "decidim.content_blocks.cta.name"
|
109
|
-
|
110
|
-
content_block.images = [
|
111
|
-
{
|
112
|
-
name: :background_image,
|
113
|
-
uploader: "Decidim::HomepageImageUploader"
|
114
|
-
}
|
115
|
-
]
|
116
|
-
|
117
|
-
content_block.settings do |settings|
|
118
|
-
settings.attribute :button_text, type: :text, translated: true
|
119
|
-
settings.attribute :button_url, type: :string, required: true
|
120
|
-
settings.attribute :description, type: :string, translated: true, editor: true
|
121
|
-
end
|
122
|
-
|
123
|
-
content_block.default!
|
124
|
-
end
|
125
|
-
|
126
|
-
Decidim.content_blocks.register(:participatory_process_group_homepage, :highlighted_proposals) do |content_block|
|
127
|
-
content_block.cell = "decidim/proposals/content_blocks/highlighted_proposals"
|
128
|
-
content_block.settings_form_cell = "decidim/content_blocks/highlighted_elements_settings_form"
|
129
|
-
content_block.public_name_key = "decidim.proposals.content_blocks.highlighted_proposals.proposals"
|
130
|
-
|
131
|
-
content_block.settings do |settings|
|
132
|
-
settings.attribute :order, type: :enum, default: "random", choices: %w(random recent)
|
133
|
-
end
|
134
|
-
end
|
135
|
-
|
136
|
-
Decidim.content_blocks.register(:participatory_process_group_homepage, :highlighted_results) do |content_block|
|
137
|
-
content_block.cell = "decidim/accountability/content_blocks/highlighted_results"
|
138
|
-
content_block.settings_form_cell = "decidim/content_blocks/highlighted_elements_settings_form"
|
139
|
-
content_block.public_name_key = "decidim.accountability.content_blocks.highlighted_results.results"
|
140
|
-
|
141
|
-
content_block.settings do |settings|
|
142
|
-
settings.attribute :order, type: :enum, default: "random", choices: %w(random recent)
|
143
|
-
end
|
144
|
-
end
|
145
|
-
|
146
|
-
Decidim.content_blocks.register(:participatory_process_group_homepage, :highlighted_meetings) do |content_block|
|
147
|
-
content_block.cell = "decidim/meetings/content_blocks/highlighted_meetings"
|
148
|
-
content_block.public_name_key = "decidim.meetings.content_blocks.upcoming_meetings.name"
|
149
|
-
content_block.default!
|
150
|
-
end
|
151
|
-
|
152
|
-
Decidim.content_blocks.register(:participatory_process_group_homepage, :stats) do |content_block|
|
153
|
-
content_block.cell = "decidim/participatory_process_groups/content_blocks/statistics"
|
154
|
-
content_block.public_name_key = "decidim.participatory_process_groups.content_blocks.stats.name"
|
155
|
-
content_block.default!
|
156
|
-
end
|
157
|
-
|
158
|
-
Decidim.content_blocks.register(:participatory_process_group_homepage, :participatory_processes) do |content_block|
|
159
|
-
content_block.cell = "decidim/participatory_process_groups/content_blocks/highlighted_participatory_processes"
|
160
|
-
content_block.public_name_key = "decidim.participatory_process_groups.content_blocks.participatory_processes.name"
|
161
|
-
content_block.default!
|
162
|
-
end
|
72
|
+
Decidim::ParticipatoryProcesses::ContentBlocks::RegistryManager.register!
|
163
73
|
end
|
164
74
|
|
165
75
|
initializer "decidim_participatory_processes.stats" do
|
@@ -0,0 +1,190 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module ParticipatoryProcesses
|
5
|
+
class Menu
|
6
|
+
def self.register_menu!
|
7
|
+
Decidim.menu :menu do |menu|
|
8
|
+
menu.add_item :participatory_processes,
|
9
|
+
I18n.t("menu.processes", scope: "decidim"),
|
10
|
+
decidim_participatory_processes.participatory_processes_path,
|
11
|
+
position: 2,
|
12
|
+
if: Decidim::ParticipatoryProcess.where(organization: current_organization).published.any?,
|
13
|
+
active: %r{^/process(es|_groups)}
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.register_home_content_block_menu!
|
18
|
+
Decidim.menu :home_content_block_menu do |menu|
|
19
|
+
menu.add_item :participatory_processes,
|
20
|
+
I18n.t("menu.processes", scope: "decidim"),
|
21
|
+
decidim_participatory_processes.participatory_processes_path,
|
22
|
+
position: 10,
|
23
|
+
if: Decidim::ParticipatoryProcess.where(organization: current_organization).published.any?,
|
24
|
+
active: %r{^/process(es|_groups)}
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.register_admin_menu_modules!
|
29
|
+
Decidim.menu :admin_menu_modules do |menu|
|
30
|
+
menu.add_item :participatory_processes,
|
31
|
+
I18n.t("menu.participatory_processes", scope: "decidim.admin"),
|
32
|
+
decidim_admin_participatory_processes.participatory_processes_path,
|
33
|
+
icon_name: "treasure-map-line",
|
34
|
+
position: 2,
|
35
|
+
active: is_active_link?(decidim_admin_participatory_processes.participatory_processes_path, :inclusive) ||
|
36
|
+
is_active_link?(decidim_admin_participatory_processes.participatory_process_groups_path, :inclusive) ||
|
37
|
+
is_active_link?(decidim_admin_participatory_processes.participatory_process_types_path),
|
38
|
+
if: allowed_to?(:enter, :space_area, space_name: :processes) || allowed_to?(:enter, :space_area, space_name: :process_groups)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def self.register_admin_participatory_processes_menu!
|
43
|
+
Decidim.menu :admin_participatory_processes_menu do |menu|
|
44
|
+
menu.add_item :participatory_processes,
|
45
|
+
I18n.t("menu.participatory_processes", scope: "decidim.admin"),
|
46
|
+
decidim_admin_participatory_processes.participatory_processes_path,
|
47
|
+
position: 1,
|
48
|
+
icon_name: "home-8-line",
|
49
|
+
if: allowed_to?(:enter, :space_area, space_name: :processes),
|
50
|
+
active: is_active_link?(decidim_admin_participatory_processes.participatory_processes_path)
|
51
|
+
|
52
|
+
menu.add_item :participatory_process_groups,
|
53
|
+
I18n.t("menu.participatory_process_groups", scope: "decidim.admin"),
|
54
|
+
decidim_admin_participatory_processes.participatory_process_groups_path,
|
55
|
+
position: 2,
|
56
|
+
icon_name: "home-8-line",
|
57
|
+
if: allowed_to?(:enter, :space_area, space_name: :process_groups),
|
58
|
+
active: is_active_link?(decidim_admin_participatory_processes.participatory_process_groups_path)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
def self.register_participatory_process_admin_attachments_menu!
|
63
|
+
Decidim.menu :participatory_process_admin_attachments_menu do |menu|
|
64
|
+
menu.add_item :participatory_process_attachments,
|
65
|
+
I18n.t("attachment_files", scope: "decidim.admin.menu.participatory_processes_submenu"),
|
66
|
+
decidim_admin_participatory_processes.participatory_process_attachments_path(current_participatory_space),
|
67
|
+
active: is_active_link?(decidim_admin_participatory_processes.participatory_process_attachments_path(current_participatory_space)),
|
68
|
+
if: allowed_to?(:read, :attachment),
|
69
|
+
icon_name: "attachment-line"
|
70
|
+
|
71
|
+
menu.add_item :participatory_process_attachment_collections,
|
72
|
+
I18n.t("attachment_collections", scope: "decidim.admin.menu.participatory_processes_submenu"),
|
73
|
+
decidim_admin_participatory_processes.participatory_process_attachment_collections_path(current_participatory_space),
|
74
|
+
active: is_active_link?(decidim_admin_participatory_processes.participatory_process_attachment_collections_path(current_participatory_space)),
|
75
|
+
if: allowed_to?(:read, :attachment_collection),
|
76
|
+
icon_name: "folder-line"
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
def self.register_admin_participatory_process_components_menu!
|
81
|
+
Decidim.menu :admin_participatory_process_components_menu do |menu|
|
82
|
+
current_participatory_space.components.each do |component|
|
83
|
+
caption = translated_attribute(component.name)
|
84
|
+
if component.primary_stat.present?
|
85
|
+
caption += content_tag(:span, component.primary_stat, class: component.primary_stat.zero? ? "component-counter component-counter--off" : "component-counter")
|
86
|
+
end
|
87
|
+
|
88
|
+
menu.add_item [component.manifest_name, component.id].join("_"),
|
89
|
+
caption.html_safe,
|
90
|
+
manage_component_path(component),
|
91
|
+
active: is_active_link?(manage_component_path(component)) ||
|
92
|
+
is_active_link?(decidim_admin_participatory_processes.edit_component_path(current_participatory_space, component)) ||
|
93
|
+
is_active_link?(decidim_admin_participatory_processes.edit_component_permissions_path(current_participatory_space, component)) ||
|
94
|
+
participatory_space_active_link?(component),
|
95
|
+
if: component.manifest.admin_engine && user_role_config.component_is_accessible?(component.manifest_name)
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
def self.register_admin_participatory_process_menu!
|
101
|
+
Decidim.menu :admin_participatory_process_menu do |menu|
|
102
|
+
menu.add_item :edit_participatory_process,
|
103
|
+
I18n.t("info", scope: "decidim.admin.menu.participatory_processes_submenu"),
|
104
|
+
decidim_admin_participatory_processes.edit_participatory_process_path(current_participatory_space),
|
105
|
+
active: is_active_link?(decidim_admin_participatory_processes.edit_participatory_process_path(current_participatory_space)),
|
106
|
+
icon_name: "information-line",
|
107
|
+
if: allowed_to?(:update, :process, process: current_participatory_space)
|
108
|
+
|
109
|
+
menu.add_item :edit_participatory_process_landing_page,
|
110
|
+
I18n.t("landing_page", scope: "decidim.admin.menu.participatory_processes_submenu"),
|
111
|
+
decidim_admin_participatory_processes.edit_participatory_process_landing_page_path(current_participatory_space),
|
112
|
+
active: is_active_link?(decidim_admin_participatory_processes.participatory_process_landing_page_path(current_participatory_space)),
|
113
|
+
icon_name: "layout-masonry-line",
|
114
|
+
if: allowed_to?(:update, :process, process: current_participatory_space)
|
115
|
+
|
116
|
+
menu.add_item :participatory_process_steps,
|
117
|
+
I18n.t("steps", scope: "decidim.admin.menu.participatory_processes_submenu"),
|
118
|
+
decidim_admin_participatory_processes.participatory_process_steps_path(current_participatory_space),
|
119
|
+
active: is_active_link?(decidim_admin_participatory_processes.participatory_process_steps_path(current_participatory_space)),
|
120
|
+
icon_name: "direction-line",
|
121
|
+
if: allowed_to?(:read, :process_step)
|
122
|
+
|
123
|
+
menu.add_item :components,
|
124
|
+
I18n.t("components", scope: "decidim.admin.menu.participatory_processes_submenu"),
|
125
|
+
decidim_admin_participatory_processes.components_path(current_participatory_space),
|
126
|
+
active: is_active_link?(decidim_admin_participatory_processes.components_path(current_participatory_space),
|
127
|
+
["decidim/participatory_processes/admin/components", %w(index new edit)]),
|
128
|
+
icon_name: "tools-line",
|
129
|
+
if: allowed_to?(:read, :component),
|
130
|
+
submenu: { target_menu: :admin_participatory_process_components_menu }
|
131
|
+
|
132
|
+
menu.add_item :categories,
|
133
|
+
I18n.t("categories", scope: "decidim.admin.menu.participatory_processes_submenu"),
|
134
|
+
decidim_admin_participatory_processes.categories_path(current_participatory_space),
|
135
|
+
active: is_active_link?(decidim_admin_participatory_processes.categories_path(current_participatory_space)),
|
136
|
+
icon_name: "price-tag-3-line",
|
137
|
+
if: allowed_to?(:read, :category)
|
138
|
+
|
139
|
+
menu.add_item :attachments,
|
140
|
+
I18n.t("attachments", scope: "decidim.admin.menu.participatory_processes_submenu"),
|
141
|
+
decidim_admin_participatory_processes.participatory_process_attachments_path(current_participatory_space),
|
142
|
+
active: is_active_link?(decidim_admin_participatory_processes.participatory_process_attachment_collections_path(current_participatory_space)) ||
|
143
|
+
is_active_link?(decidim_admin_participatory_processes.participatory_process_attachments_path(current_participatory_space)),
|
144
|
+
icon_name: "attachment-2",
|
145
|
+
if: allowed_to?(:read, :attachment_collection) || allowed_to?(:read, :attachment)
|
146
|
+
|
147
|
+
menu.add_item :participatory_process_user_roles,
|
148
|
+
I18n.t("process_admins", scope: "decidim.admin.menu.participatory_processes_submenu"),
|
149
|
+
decidim_admin_participatory_processes.participatory_process_user_roles_path(current_participatory_space),
|
150
|
+
active: is_active_link?(decidim_admin_participatory_processes.participatory_process_user_roles_path(current_participatory_space)),
|
151
|
+
icon_name: "user-settings-line",
|
152
|
+
if: allowed_to?(:read, :process_user_role)
|
153
|
+
|
154
|
+
menu.add_item :participatory_space_private_users,
|
155
|
+
I18n.t("private_users", scope: "decidim.admin.menu.participatory_processes_submenu"),
|
156
|
+
decidim_admin_participatory_processes.participatory_space_private_users_path(current_participatory_space),
|
157
|
+
active: is_active_link?(decidim_admin_participatory_processes.participatory_space_private_users_path(current_participatory_space)),
|
158
|
+
icon_name: "spy-line",
|
159
|
+
if: allowed_to?(:read, :space_private_user, current_participatory_space:)
|
160
|
+
|
161
|
+
menu.add_item :moderations,
|
162
|
+
I18n.t("moderations", scope: "decidim.admin.menu.participatory_processes_submenu"),
|
163
|
+
decidim_admin_participatory_processes.moderations_path(current_participatory_space),
|
164
|
+
active: is_active_link?(decidim_admin_participatory_processes.moderations_path(current_participatory_space)),
|
165
|
+
icon_name: "flag-line",
|
166
|
+
if: allowed_to?(:read, :moderation, current_participatory_space:)
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
def self.register_admin_participatory_process_group_menu!
|
171
|
+
Decidim.menu :admin_participatory_process_group_menu do |menu|
|
172
|
+
menu.add_item :edit_participatory_process_group,
|
173
|
+
I18n.t("info", scope: "decidim.admin.menu.participatory_process_groups_submenu"),
|
174
|
+
decidim_admin_participatory_processes.edit_participatory_process_group_path(participatory_process_group),
|
175
|
+
position: 1,
|
176
|
+
icon_name: "information-line",
|
177
|
+
if: allowed_to?(:update, :process_group, process_group: participatory_process_group),
|
178
|
+
active: is_active_link?(decidim_admin_participatory_processes.edit_participatory_process_group_path(participatory_process_group))
|
179
|
+
menu.add_item :edit_participatory_process_group_landing_page,
|
180
|
+
I18n.t("landing_page", scope: "decidim.admin.menu.participatory_process_groups_submenu"),
|
181
|
+
decidim_admin_participatory_processes.edit_participatory_process_group_landing_page_path(participatory_process_group),
|
182
|
+
position: 2,
|
183
|
+
icon_name: "layout-masonry-line",
|
184
|
+
if: allowed_to?(:update, :process_group, process_group: participatory_process_group),
|
185
|
+
active: is_active_link?(decidim_admin_participatory_processes.participatory_process_group_landing_page_path(participatory_process_group))
|
186
|
+
end
|
187
|
+
end
|
188
|
+
end
|
189
|
+
end
|
190
|
+
end
|