decidim-participatory_processes 0.31.9 → 0.32.0.rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -7
- data/app/cells/decidim/participatory_processes/content_blocks/democratic_quality_stats_cell.rb +1 -1
- data/app/cells/decidim/participatory_processes/content_blocks/main_data_cell.rb +1 -0
- data/app/cells/decidim/participatory_processes/process_step/show.erb +1 -1
- data/app/commands/decidim/participatory_processes/admin/create_participatory_process.rb +3 -3
- data/app/commands/decidim/participatory_processes/admin/create_participatory_process_group.rb +1 -3
- data/app/commands/decidim/participatory_processes/admin/duplicate_participatory_process.rb +2 -2
- data/app/commands/decidim/participatory_processes/admin/update_participatory_process.rb +3 -4
- data/app/commands/decidim/participatory_processes/admin/update_participatory_process_group.rb +1 -3
- data/app/commands/decidim/participatory_processes/admin/update_participatory_process_step.rb +1 -1
- data/app/commands/decidim/participatory_processes/create_democratic_quality_indicators_page.rb +0 -2
- data/app/controllers/concerns/decidim/participatory_processes/admin/filterable.rb +9 -3
- data/app/controllers/decidim/participatory_processes/admin/component_share_tokens_controller.rb +0 -2
- data/app/controllers/decidim/participatory_processes/admin/concerns/participatory_process_admin.rb +7 -9
- data/app/controllers/decidim/participatory_processes/admin/members_controller.rb +13 -0
- data/app/controllers/decidim/participatory_processes/admin/members_csv_imports_controller.rb +22 -0
- data/app/controllers/decidim/participatory_processes/admin/moderations/reports_controller.rb +0 -2
- data/app/controllers/decidim/participatory_processes/admin/moderations_controller.rb +0 -2
- data/app/controllers/decidim/participatory_processes/admin/participatory_process_attachment_collections_controller.rb +0 -2
- data/app/controllers/decidim/participatory_processes/admin/participatory_process_attachments_controller.rb +0 -2
- data/app/controllers/decidim/participatory_processes/admin/participatory_process_duplicates_controller.rb +1 -1
- data/app/controllers/decidim/participatory_processes/admin/participatory_process_exports_controller.rb +0 -2
- data/app/controllers/decidim/participatory_processes/admin/participatory_process_group_landing_page_controller.rb +5 -7
- data/app/controllers/decidim/participatory_processes/admin/participatory_process_groups_controller.rb +3 -3
- data/app/controllers/decidim/participatory_processes/admin/participatory_process_imports_controller.rb +1 -1
- data/app/controllers/decidim/participatory_processes/admin/participatory_process_landing_page_controller.rb +2 -8
- data/app/controllers/decidim/participatory_processes/admin/participatory_process_share_tokens_controller.rb +0 -2
- data/app/controllers/decidim/participatory_processes/admin/participatory_process_steps_controller.rb +2 -6
- data/app/controllers/decidim/participatory_processes/admin/participatory_process_user_roles_controller.rb +0 -2
- data/app/controllers/decidim/participatory_processes/admin/participatory_processes_controller.rb +3 -3
- data/app/controllers/decidim/participatory_processes/{participatory_space_private_users_controller.rb → members_controller.rb} +2 -11
- data/app/controllers/decidim/participatory_processes/participatory_processes_controller.rb +1 -1
- data/app/forms/decidim/participatory_processes/admin/participatory_process_duplicate_form.rb +2 -1
- data/app/forms/decidim/participatory_processes/admin/participatory_process_form.rb +9 -3
- 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 +0 -3
- data/app/helpers/decidim/participatory_processes/participatory_process_helper.rb +6 -16
- data/app/jobs/decidim/participatory_processes/change_active_step_job.rb +8 -26
- data/app/models/decidim/participatory_process.rb +13 -8
- data/app/models/decidim/participatory_process_step.rb +1 -1
- data/app/permissions/decidim/participatory_processes/permissions.rb +9 -9
- data/app/presenters/decidim/participatory_processes/admin_log/participatory_process_presenter.rb +2 -2
- data/app/presenters/decidim/participatory_processes/admin_log/step_presenter.rb +1 -3
- 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/open_data_participatory_process_serializer.rb +2 -6
- data/app/serializers/decidim/participatory_processes/participatory_process_importer.rb +12 -4
- data/app/serializers/decidim/participatory_processes/participatory_process_serializer.rb +1 -3
- data/app/views/decidim/participatory_processes/admin/participatory_process_duplicates/_form.html.erb +3 -0
- data/app/views/decidim/participatory_processes/admin/participatory_process_duplicates/new.html.erb +3 -2
- data/app/views/decidim/participatory_processes/admin/participatory_process_groups/edit.html.erb +3 -2
- data/app/views/decidim/participatory_processes/admin/participatory_process_groups/index.html.erb +2 -1
- data/app/views/decidim/participatory_processes/admin/participatory_process_groups/new.html.erb +3 -2
- data/app/views/decidim/participatory_processes/admin/participatory_process_imports/new.html.erb +2 -2
- data/app/views/decidim/participatory_processes/admin/participatory_process_steps/_form.html.erb +0 -9
- data/app/views/decidim/participatory_processes/admin/participatory_process_steps/edit.html.erb +3 -8
- data/app/views/decidim/participatory_processes/admin/participatory_process_steps/index.html.erb +5 -4
- data/app/views/decidim/participatory_processes/admin/participatory_process_steps/new.html.erb +4 -3
- data/app/views/decidim/participatory_processes/admin/participatory_process_user_roles/edit.html.erb +3 -3
- data/app/views/decidim/participatory_processes/admin/participatory_process_user_roles/index.html.erb +2 -2
- data/app/views/decidim/participatory_processes/admin/participatory_process_user_roles/new.html.erb +2 -2
- data/app/views/decidim/participatory_processes/admin/participatory_processes/_form.html.erb +33 -7
- data/app/views/decidim/participatory_processes/admin/participatory_processes/_process_row.html.erb +6 -7
- data/app/views/decidim/participatory_processes/admin/participatory_processes/_processes_thead.html.erb +1 -1
- data/app/views/decidim/participatory_processes/admin/participatory_processes/edit.html.erb +3 -2
- data/app/views/decidim/participatory_processes/admin/participatory_processes/index.html.erb +2 -1
- data/app/views/decidim/participatory_processes/admin/participatory_processes/manage_trash.html.erb +2 -2
- data/app/views/decidim/participatory_processes/admin/participatory_processes/new.html.erb +3 -2
- data/app/views/decidim/participatory_processes/members/index.html.erb +24 -0
- data/app/views/decidim/participatory_processes/participatory_process_groups/show.html.erb +1 -1
- data/app/views/decidim/participatory_processes/participatory_processes/show.html.erb +14 -9
- data/config/locales/ar.yml +0 -16
- data/config/locales/bg.yml +1 -35
- data/config/locales/bs-BA.yml +0 -1
- data/config/locales/ca-IT.yml +58 -57
- data/config/locales/ca.yml +58 -57
- data/config/locales/cs.yml +40 -236
- data/config/locales/de.yml +7 -245
- data/config/locales/el.yml +1 -27
- data/config/locales/en.yml +57 -56
- data/config/locales/es-MX.yml +62 -62
- data/config/locales/es-PY.yml +62 -62
- data/config/locales/es.yml +55 -55
- data/config/locales/eu.yml +191 -190
- data/config/locales/fi-plain.yml +160 -159
- data/config/locales/fi.yml +159 -158
- data/config/locales/fr-CA.yml +48 -66
- data/config/locales/fr.yml +48 -66
- data/config/locales/ga-IE.yml +0 -8
- data/config/locales/gl.yml +11 -351
- data/config/locales/hu.yml +1 -27
- data/config/locales/id-ID.yml +0 -16
- data/config/locales/is-IS.yml +1 -10
- data/config/locales/it.yml +0 -25
- data/config/locales/ja.yml +38 -56
- data/config/locales/kaa.yml +0 -1
- data/config/locales/lb.yml +0 -10
- data/config/locales/lt.yml +1 -27
- data/config/locales/lv.yml +0 -16
- data/config/locales/nl.yml +0 -16
- data/config/locales/no.yml +1 -26
- data/config/locales/pl.yml +1 -35
- data/config/locales/pt-BR.yml +35 -44
- data/config/locales/pt.yml +0 -17
- data/config/locales/ro-RO.yml +3 -27
- data/config/locales/ru.yml +0 -13
- data/config/locales/sk.yml +0 -544
- data/config/locales/sl.yml +0 -1
- data/config/locales/sr-CS.yml +0 -1
- data/config/locales/sv.yml +22 -54
- data/config/locales/tr-TR.yml +0 -16
- data/config/locales/uk.yml +0 -13
- data/config/locales/zh-CN.yml +0 -16
- data/config/locales/zh-TW.yml +1 -27
- data/db/data/20260104094929_remove_process_types_references.rb +25 -0
- data/db/data/20260111190000_replace_legacy_fields_to_access_mode_for_participatory_processes.rb +18 -0
- data/db/data/20260210195709_move_announcement_to_content_block_on_participatory_processes.rb +40 -0
- data/db/migrate/20210310120750_add_followable_counter_cache_to_participatory_processes.rb +6 -2
- data/db/migrate/20251007094913_remove_cta_path_and_text_from_steps.rb +8 -0
- data/db/migrate/20251112113613_remove_legacy_images_from_participatory_processes_module.rb +9 -0
- data/db/migrate/20251203071213_remove_legacy_file_column_from_attachments_table.rb +11 -0
- data/db/migrate/20251205120001_add_has_members_to_decidim_participatory_processes.rb +7 -0
- data/db/migrate/20260104093600_remove_participatory_process_types.rb +13 -0
- data/db/migrate/20260111120010_add_access_mode_to_participatory_processes.rb +11 -0
- data/decidim-participatory_processes.gemspec +10 -11
- data/lib/decidim/api/participatory_process_step_type.rb +0 -2
- data/lib/decidim/api/participatory_process_type.rb +1 -2
- data/lib/decidim/participatory_processes/admin_engine.rb +11 -5
- data/lib/decidim/participatory_processes/api.rb +0 -1
- data/lib/decidim/participatory_processes/content_blocks/registry_manager.rb +5 -0
- data/lib/decidim/participatory_processes/engine.rb +29 -19
- data/lib/decidim/participatory_processes/menu.rb +11 -11
- data/lib/decidim/participatory_processes/participatory_space.rb +0 -2
- data/lib/decidim/participatory_processes/query_extensions.rb +2 -29
- data/lib/decidim/participatory_processes/test/factories.rb +13 -26
- data/lib/decidim/participatory_processes/version.rb +1 -1
- metadata +31 -33
- data/app/cells/decidim/participatory_processes/process_dropdown_metadata/metadata.erb +0 -15
- data/app/cells/decidim/participatory_processes/process_dropdown_metadata_cell.rb +0 -46
- data/app/controllers/decidim/participatory_processes/admin/participatory_space_private_users_controller.rb +0 -23
- data/app/controllers/decidim/participatory_processes/admin/participatory_space_private_users_csv_imports_controller.rb +0 -24
- data/app/models/decidim/participatory_process_type.rb +0 -27
- data/app/presenters/decidim/log/value_types/participatory_process_type_presenter.rb +0 -27
- data/app/presenters/decidim/participatory_processes/admin_log/participatory_process_type_presenter.rb +0 -38
- data/app/views/decidim/participatory_processes/admin/participatory_process_steps/show.html.erb +0 -17
- data/app/views/decidim/participatory_processes/participatory_space_private_users/index.html.erb +0 -24
- data/app/views/layouts/decidim/admin/participatory_process_type.html.erb +0 -17
- data/lib/decidim/api/participatory_process_type_type.rb +0 -17
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 38b3e078ff1e3ee045eaad938a7ef953438c41244c49fe361d9a93bc65a9b5e5
|
|
4
|
+
data.tar.gz: 9acf6173eafb225ffbc76890e883d7ad7f09e20412fff33cc2b6b40cd3b638e9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c92bce98f52d0593b07fbeaaaaf584f0dbf888570b9ce18388a6517ccb0d2ca31d8849e38fb04c5ca7d0939c271e02d6a308ad01686784ccfc06ab9e8abd7622
|
|
7
|
+
data.tar.gz: 65b09408fa9116db2a9f6a7ea517d7a871d9ed5af351ed891d2a9116458546f6552ccf9c4ad496f32cf44af2d044bf2c64bb93586ce0b0a797e1bb1371bb0085
|
data/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# decidim-participatory_processes
|
|
2
2
|
|
|
3
3
|
Participatory processes are the standard Decidim's participatory space.
|
|
4
4
|
|
|
@@ -23,16 +23,12 @@ This module provides:
|
|
|
23
23
|
|
|
24
24
|
* Public views for participatory process via a high level section in the main menu.
|
|
25
25
|
|
|
26
|
+
You can see the documentation of this feature at the [Decidim Documentation](https://docs.decidim.org/en/develop/admin/spaces/processes).
|
|
27
|
+
|
|
26
28
|
## Installation
|
|
27
29
|
|
|
28
30
|
This is on the default Decidim installation so you should not change anything to use this participatory space.
|
|
29
31
|
|
|
30
|
-
## Screenshots
|
|
31
|
-
|
|
32
|
-

|
|
33
|
-
|
|
34
|
-

|
|
35
|
-
|
|
36
32
|
## Contributing
|
|
37
33
|
|
|
38
34
|
See [Decidim](https://github.com/decidim/decidim).
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<%= decidim_modal id: "process-steps-modal", class: "participatory-space__metadata-modal", data: do %>
|
|
2
2
|
<div data-dialog-container>
|
|
3
3
|
<%= icon "flag-line" %>
|
|
4
|
-
<
|
|
4
|
+
<h3 id="dialog-title-process-steps-modal" data-dialog-title><%= t("participatory_process_steps.index.process_steps", scope: "decidim") %></h3>
|
|
5
5
|
<div>
|
|
6
6
|
<div class="participatory-space__metadata-modal__list-container" data-controller="accordion" data-multiselectable="false" data-collapsible="false">
|
|
7
7
|
<ol class="participatory-space__metadata-modal__list">
|
|
@@ -9,8 +9,8 @@ module Decidim
|
|
|
9
9
|
fetch_file_attributes :hero_image
|
|
10
10
|
|
|
11
11
|
fetch_form_attributes :organization, :title, :subtitle, :weight, :slug, :description,
|
|
12
|
-
:short_description, :promoted, :taxonomizations,
|
|
13
|
-
:
|
|
12
|
+
:short_description, :promoted, :taxonomizations,
|
|
13
|
+
:has_members, :access_mode, :developer_group, :local_area, :target,
|
|
14
14
|
:participatory_scope, :participatory_structure, :meta_scope, :start_date, :end_date,
|
|
15
15
|
:participatory_process_group
|
|
16
16
|
|
|
@@ -49,7 +49,7 @@ module Decidim
|
|
|
49
49
|
end
|
|
50
50
|
|
|
51
51
|
def related_processes
|
|
52
|
-
@related_processes ||=
|
|
52
|
+
@related_processes ||= Decidim::ParticipatoryProcess.where(id: form.related_process_ids)
|
|
53
53
|
end
|
|
54
54
|
|
|
55
55
|
def link_related_processes
|
data/app/commands/decidim/participatory_processes/admin/create_participatory_process_group.rb
CHANGED
|
@@ -11,8 +11,6 @@ module Decidim
|
|
|
11
11
|
fetch_form_attributes :organization, :title, :description, :group_url, :target, :promoted,
|
|
12
12
|
:developer_group, :local_area, :meta_scope, :participatory_scope, :participatory_structure
|
|
13
13
|
|
|
14
|
-
delegate :current_organization, to: :form
|
|
15
|
-
|
|
16
14
|
protected
|
|
17
15
|
|
|
18
16
|
def run_after_hooks
|
|
@@ -26,7 +24,7 @@ module Decidim
|
|
|
26
24
|
end
|
|
27
25
|
|
|
28
26
|
def participatory_processes
|
|
29
|
-
Decidim::ParticipatoryProcess.where(
|
|
27
|
+
Decidim::ParticipatoryProcess.where(id: form.participatory_process_ids)
|
|
30
28
|
end
|
|
31
29
|
end
|
|
32
30
|
end
|
|
@@ -29,9 +29,9 @@ module Decidim
|
|
|
29
29
|
ParticipatoryProcess.transaction do
|
|
30
30
|
duplicate_participatory_process
|
|
31
31
|
duplicate_participatory_process_attachments
|
|
32
|
-
duplicate_landing_page_blocks
|
|
33
32
|
duplicate_participatory_process_steps if @form.duplicate_steps?
|
|
34
33
|
duplicate_participatory_process_components if @form.duplicate_components?
|
|
34
|
+
duplicate_landing_page_blocks if @form.duplicate_landing_page_blocks?
|
|
35
35
|
end
|
|
36
36
|
end
|
|
37
37
|
|
|
@@ -60,7 +60,7 @@ module Decidim
|
|
|
60
60
|
start_date: @participatory_process.start_date,
|
|
61
61
|
end_date: @participatory_process.end_date,
|
|
62
62
|
participatory_process_group: @participatory_process.participatory_process_group,
|
|
63
|
-
|
|
63
|
+
access_mode: @participatory_process.access_mode,
|
|
64
64
|
taxonomies: @participatory_process.taxonomies
|
|
65
65
|
)
|
|
66
66
|
end
|
|
@@ -9,10 +9,9 @@ module Decidim
|
|
|
9
9
|
fetch_file_attributes :hero_image
|
|
10
10
|
|
|
11
11
|
fetch_form_attributes :title, :subtitle, :weight, :slug, :promoted,
|
|
12
|
-
:taxonomizations, :
|
|
12
|
+
:taxonomizations, :has_members, :access_mode, :developer_group, :local_area,
|
|
13
13
|
:target, :participatory_scope, :participatory_structure,
|
|
14
|
-
:meta_scope, :start_date, :end_date, :participatory_process_group
|
|
15
|
-
:announcement
|
|
14
|
+
:meta_scope, :start_date, :end_date, :participatory_process_group
|
|
16
15
|
|
|
17
16
|
protected
|
|
18
17
|
|
|
@@ -29,7 +28,7 @@ module Decidim
|
|
|
29
28
|
private
|
|
30
29
|
|
|
31
30
|
def related_processes
|
|
32
|
-
@related_processes ||=
|
|
31
|
+
@related_processes ||= Decidim::ParticipatoryProcess.where(id: form.related_process_ids)
|
|
33
32
|
end
|
|
34
33
|
|
|
35
34
|
def run_after_hooks
|
data/app/commands/decidim/participatory_processes/admin/update_participatory_process_group.rb
CHANGED
|
@@ -15,14 +15,12 @@ module Decidim
|
|
|
15
15
|
|
|
16
16
|
attr_reader :form
|
|
17
17
|
|
|
18
|
-
delegate :current_organization, to: :form
|
|
19
|
-
|
|
20
18
|
def attributes
|
|
21
19
|
super.merge({ participatory_processes: })
|
|
22
20
|
end
|
|
23
21
|
|
|
24
22
|
def participatory_processes
|
|
25
|
-
Decidim::ParticipatoryProcess.where(
|
|
23
|
+
Decidim::ParticipatoryProcess.where(id: form.participatory_process_ids)
|
|
26
24
|
end
|
|
27
25
|
end
|
|
28
26
|
end
|
data/app/commands/decidim/participatory_processes/admin/update_participatory_process_step.rb
CHANGED
|
@@ -6,7 +6,7 @@ module Decidim
|
|
|
6
6
|
# A command with all the business logic when updating a participatory
|
|
7
7
|
# process step in the system.
|
|
8
8
|
class UpdateParticipatoryProcessStep < Decidim::Commands::UpdateResource
|
|
9
|
-
fetch_form_attributes :
|
|
9
|
+
fetch_form_attributes :title, :start_date, :end_date, :description
|
|
10
10
|
|
|
11
11
|
private
|
|
12
12
|
|
data/app/commands/decidim/participatory_processes/create_democratic_quality_indicators_page.rb
CHANGED
|
@@ -7,9 +7,7 @@ module Decidim
|
|
|
7
7
|
#
|
|
8
8
|
# @param organization_id [Integer] an id to fetch a Decidim::Organization instance
|
|
9
9
|
def initialize(organization_id)
|
|
10
|
-
# rubocop:disable Decidim/OrganizationScopedFinder -- organization id comes from trusted internal callers, not user params
|
|
11
10
|
@organization = Decidim::Organization.find(organization_id)
|
|
12
|
-
# rubocop:enable Decidim/OrganizationScopedFinder
|
|
13
11
|
end
|
|
14
12
|
|
|
15
13
|
# Executes the command that creates the required static page or returns it if it already exists.
|
|
@@ -19,7 +19,7 @@ module Decidim
|
|
|
19
19
|
|
|
20
20
|
def filters
|
|
21
21
|
[
|
|
22
|
-
:
|
|
22
|
+
:with_any_access_mode,
|
|
23
23
|
:published_at_null,
|
|
24
24
|
:decidim_participatory_process_group_id_eq
|
|
25
25
|
]
|
|
@@ -27,7 +27,7 @@ module Decidim
|
|
|
27
27
|
|
|
28
28
|
def filters_with_values
|
|
29
29
|
{
|
|
30
|
-
|
|
30
|
+
with_any_access_mode: access_modes,
|
|
31
31
|
published_at_null: [true, false],
|
|
32
32
|
decidim_participatory_process_group_id_eq: OrganizationParticipatoryProcessGroups.new(current_organization).pluck(:id)
|
|
33
33
|
}
|
|
@@ -38,7 +38,13 @@ module Decidim
|
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
def translated_decidim_participatory_process_group_id_eq(id)
|
|
41
|
-
translated_attribute(Decidim::ParticipatoryProcessGroup.
|
|
41
|
+
translated_attribute(Decidim::ParticipatoryProcessGroup.find(id).title)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
private
|
|
45
|
+
|
|
46
|
+
def access_modes
|
|
47
|
+
ParticipatoryProcess::ACCESS_MODES
|
|
42
48
|
end
|
|
43
49
|
end
|
|
44
50
|
end
|
data/app/controllers/decidim/participatory_processes/admin/component_share_tokens_controller.rb
CHANGED
|
@@ -9,8 +9,6 @@ module Decidim
|
|
|
9
9
|
class ComponentShareTokensController < Decidim::Admin::ShareTokensController
|
|
10
10
|
include Concerns::ParticipatoryProcessAdmin
|
|
11
11
|
|
|
12
|
-
protected
|
|
13
|
-
|
|
14
12
|
def resource
|
|
15
13
|
@resource ||= current_participatory_space.components.find(params[:component_id])
|
|
16
14
|
end
|
data/app/controllers/decidim/participatory_processes/admin/concerns/participatory_process_admin.rb
CHANGED
|
@@ -20,28 +20,26 @@ module Decidim
|
|
|
20
20
|
included do
|
|
21
21
|
include Decidim::Admin::ParticipatorySpaceAdminContext
|
|
22
22
|
|
|
23
|
-
helper_method :current_participatory_process
|
|
23
|
+
helper_method :current_participatory_process
|
|
24
24
|
add_breadcrumb_item_from_menu :admin_participatory_process_menu
|
|
25
25
|
|
|
26
26
|
participatory_space_admin_layout
|
|
27
27
|
|
|
28
|
+
def organization_processes
|
|
29
|
+
@organization_processes ||= OrganizationParticipatoryProcesses.new(current_organization).query
|
|
30
|
+
end
|
|
31
|
+
|
|
28
32
|
def current_participatory_space
|
|
29
33
|
request.env["current_participatory_space"] ||
|
|
30
34
|
organization_processes.find_by!(slug: params[:participatory_process_slug] || params[:slug])
|
|
31
35
|
end
|
|
32
36
|
|
|
33
|
-
alias_method :current_participatory_process, :current_participatory_space
|
|
34
|
-
|
|
35
|
-
protected
|
|
36
|
-
|
|
37
|
-
def organization_processes
|
|
38
|
-
@organization_processes ||= OrganizationParticipatoryProcesses.new(current_organization).query
|
|
39
|
-
end
|
|
40
|
-
|
|
41
37
|
def permissions_context
|
|
42
38
|
super.merge(current_participatory_space:)
|
|
43
39
|
end
|
|
44
40
|
|
|
41
|
+
alias_method :current_participatory_process, :current_participatory_space
|
|
42
|
+
|
|
45
43
|
def permission_class_chain
|
|
46
44
|
PermissionsRegistry.chain_for(ParticipatoryProcessAdmin)
|
|
47
45
|
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Decidim
|
|
4
|
+
module ParticipatoryProcesses
|
|
5
|
+
module Admin
|
|
6
|
+
# Controller that allows managing participatory process members
|
|
7
|
+
class MembersController < Decidim::Admin::ApplicationController
|
|
8
|
+
include Concerns::ParticipatoryProcessAdmin
|
|
9
|
+
include Decidim::Admin::ParticipatorySpace::Concerns::HasMembers
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Decidim
|
|
4
|
+
module ParticipatoryProcesses
|
|
5
|
+
module Admin
|
|
6
|
+
# Controller that allows importing participatory process members
|
|
7
|
+
# on participatory processes
|
|
8
|
+
class MembersCsvImportsController < Decidim::Admin::ApplicationController
|
|
9
|
+
include Concerns::ParticipatoryProcessAdmin
|
|
10
|
+
include Decidim::Admin::ParticipatorySpace::Concerns::HasMembersCsvImport
|
|
11
|
+
|
|
12
|
+
def after_import_path
|
|
13
|
+
members_path(current_participatory_process)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def participatory_space
|
|
17
|
+
current_participatory_process
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -14,18 +14,16 @@ module Decidim
|
|
|
14
14
|
|
|
15
15
|
layout "decidim/admin/participatory_process_group"
|
|
16
16
|
|
|
17
|
-
helper_method :participatory_process_group
|
|
18
|
-
|
|
19
|
-
def scoped_resource
|
|
20
|
-
@scoped_resource ||= collection.find(params[:participatory_process_group_id])
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
protected
|
|
17
|
+
helper_method :participatory_process_group
|
|
24
18
|
|
|
25
19
|
def content_block_scope
|
|
26
20
|
:participatory_process_group_homepage
|
|
27
21
|
end
|
|
28
22
|
|
|
23
|
+
def scoped_resource
|
|
24
|
+
@scoped_resource ||= collection.find(params[:participatory_process_group_id])
|
|
25
|
+
end
|
|
26
|
+
|
|
29
27
|
def enforce_permission_to_update_resource
|
|
30
28
|
enforce_permission_to :update, :process_group, process_group: scoped_resource
|
|
31
29
|
end
|
|
@@ -36,7 +36,7 @@ module Decidim
|
|
|
36
36
|
|
|
37
37
|
on(:invalid) do
|
|
38
38
|
flash.now[:alert] = I18n.t("participatory_processes_group.create.error", scope: "decidim.admin")
|
|
39
|
-
render :new, status: :
|
|
39
|
+
render :new, status: :unprocessable_content
|
|
40
40
|
end
|
|
41
41
|
end
|
|
42
42
|
end
|
|
@@ -61,7 +61,7 @@ module Decidim
|
|
|
61
61
|
|
|
62
62
|
on(:invalid) do
|
|
63
63
|
flash.now[:alert] = I18n.t("participatory_process_groups.update.error", scope: "decidim.admin")
|
|
64
|
-
render :edit, layout: "decidim/admin/participatory_process_group", status: :
|
|
64
|
+
render :edit, layout: "decidim/admin/participatory_process_group", status: :unprocessable_content
|
|
65
65
|
end
|
|
66
66
|
end
|
|
67
67
|
end
|
|
@@ -78,7 +78,7 @@ module Decidim
|
|
|
78
78
|
|
|
79
79
|
on(:invalid) do
|
|
80
80
|
flash.now[:alert] = I18n.t("participatory_process_groups.destroy.error", scope: "decidim.admin")
|
|
81
|
-
render :index, status: :
|
|
81
|
+
render :index, status: :unprocessable_content
|
|
82
82
|
end
|
|
83
83
|
end
|
|
84
84
|
end
|
|
@@ -10,18 +10,12 @@ module Decidim
|
|
|
10
10
|
|
|
11
11
|
layout "decidim/admin/participatory_process"
|
|
12
12
|
|
|
13
|
-
helper_method :scoped_resource
|
|
14
|
-
|
|
15
|
-
def scoped_resource
|
|
16
|
-
current_participatory_space
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
protected
|
|
20
|
-
|
|
21
13
|
def content_block_scope
|
|
22
14
|
current_participatory_space_manifest.content_blocks_scope_name
|
|
23
15
|
end
|
|
24
16
|
|
|
17
|
+
alias scoped_resource current_participatory_space
|
|
18
|
+
|
|
25
19
|
def enforce_permission_to_update_resource
|
|
26
20
|
enforce_permission_to :update, :process, process: scoped_resource
|
|
27
21
|
end
|
data/app/controllers/decidim/participatory_processes/admin/participatory_process_steps_controller.rb
CHANGED
|
@@ -32,7 +32,7 @@ module Decidim
|
|
|
32
32
|
|
|
33
33
|
on(:invalid) do
|
|
34
34
|
flash.now[:alert] = I18n.t("participatory_process_steps.create.error", scope: "decidim.admin")
|
|
35
|
-
render :new, status: :
|
|
35
|
+
render :new, status: :unprocessable_content
|
|
36
36
|
end
|
|
37
37
|
end
|
|
38
38
|
end
|
|
@@ -54,15 +54,11 @@ module Decidim
|
|
|
54
54
|
|
|
55
55
|
on(:invalid) do
|
|
56
56
|
flash.now[:alert] = I18n.t("participatory_process_steps.update.error", scope: "decidim.admin")
|
|
57
|
-
render :edit, status: :
|
|
57
|
+
render :edit, status: :unprocessable_content
|
|
58
58
|
end
|
|
59
59
|
end
|
|
60
60
|
end
|
|
61
61
|
|
|
62
|
-
def show
|
|
63
|
-
enforce_permission_to :read, :process_step, process_step: @participatory_process_step
|
|
64
|
-
end
|
|
65
|
-
|
|
66
62
|
def destroy
|
|
67
63
|
enforce_permission_to :destroy, :process_step, process_step: @participatory_process_step
|
|
68
64
|
|
|
@@ -8,8 +8,6 @@ module Decidim
|
|
|
8
8
|
class ParticipatoryProcessUserRolesController < Decidim::Admin::ParticipatorySpace::UserRoleController
|
|
9
9
|
include Concerns::ParticipatoryProcessAdmin
|
|
10
10
|
|
|
11
|
-
protected
|
|
12
|
-
|
|
13
11
|
def authorization_scope = :process_user_role
|
|
14
12
|
|
|
15
13
|
def resource_form = form(ParticipatoryProcessUserRoleForm)
|
data/app/controllers/decidim/participatory_processes/admin/participatory_processes_controller.rb
CHANGED
|
@@ -10,7 +10,7 @@ module Decidim
|
|
|
10
10
|
include Decidim::ParticipatoryProcesses::Admin::Filterable
|
|
11
11
|
include Decidim::Admin::HasTrashableResources
|
|
12
12
|
|
|
13
|
-
add_breadcrumb_item_from_menu :admin_participatory_process_menu, only: :
|
|
13
|
+
add_breadcrumb_item_from_menu :admin_participatory_process_menu, only: :edit
|
|
14
14
|
|
|
15
15
|
participatory_space_admin_layout only: [:edit]
|
|
16
16
|
|
|
@@ -42,7 +42,7 @@ module Decidim
|
|
|
42
42
|
|
|
43
43
|
on(:invalid) do
|
|
44
44
|
flash.now[:alert] = I18n.t("participatory_processes.create.error", scope: "decidim.admin")
|
|
45
|
-
render :new, status: :
|
|
45
|
+
render :new, status: :unprocessable_content
|
|
46
46
|
end
|
|
47
47
|
end
|
|
48
48
|
end
|
|
@@ -68,7 +68,7 @@ module Decidim
|
|
|
68
68
|
|
|
69
69
|
on(:invalid) do
|
|
70
70
|
flash.now[:alert] = I18n.t("participatory_processes.update.error", scope: "decidim.admin")
|
|
71
|
-
render :edit, layout: "decidim/admin/participatory_process", status: :
|
|
71
|
+
render :edit, layout: "decidim/admin/participatory_process", status: :unprocessable_content
|
|
72
72
|
end
|
|
73
73
|
end
|
|
74
74
|
end
|
|
@@ -2,15 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
module Decidim
|
|
4
4
|
module ParticipatoryProcesses
|
|
5
|
-
class
|
|
5
|
+
class MembersController < Decidim::ParticipatoryProcesses::ApplicationController
|
|
6
6
|
include ParticipatorySpaceContext
|
|
7
|
-
include Decidim::HasMembersPage
|
|
8
|
-
include Paginable
|
|
7
|
+
include Decidim::ParticipatorySpace::HasMembersPage
|
|
9
8
|
|
|
10
9
|
def index
|
|
11
10
|
raise ActionController::RoutingError, "No members for this participatory process" if members.none?
|
|
12
11
|
|
|
13
|
-
@members = paginate(members)
|
|
14
12
|
enforce_permission_to :list, :members
|
|
15
13
|
redirect_to decidim_participatory_processes.participatory_process_path(current_participatory_space) unless can_visit_index?
|
|
16
14
|
end
|
|
@@ -24,13 +22,6 @@ module Decidim
|
|
|
24
22
|
OrganizationParticipatoryProcesses.new(current_organization).query.where(id: params[:participatory_process_slug])
|
|
25
23
|
).first!
|
|
26
24
|
end
|
|
27
|
-
|
|
28
|
-
def page_params
|
|
29
|
-
{
|
|
30
|
-
per_page:,
|
|
31
|
-
page: params[:page]
|
|
32
|
-
}
|
|
33
|
-
end
|
|
34
25
|
end
|
|
35
26
|
end
|
|
36
27
|
end
|
|
@@ -51,7 +51,7 @@ module Decidim
|
|
|
51
51
|
def current_participatory_space
|
|
52
52
|
return unless params["slug"]
|
|
53
53
|
|
|
54
|
-
@current_participatory_space ||= organization_participatory_processes.where(slug: params["slug"]).or(
|
|
54
|
+
@current_participatory_space ||= organization_participatory_processes.where(slug: params["slug"]).or(
|
|
55
55
|
organization_participatory_processes.where(id: params["slug"])
|
|
56
56
|
).first!
|
|
57
57
|
end
|
data/app/forms/decidim/participatory_processes/admin/participatory_process_duplicate_form.rb
CHANGED
|
@@ -16,6 +16,7 @@ module Decidim
|
|
|
16
16
|
attribute :slug, String
|
|
17
17
|
attribute :duplicate_steps, Boolean
|
|
18
18
|
attribute :duplicate_components, Boolean
|
|
19
|
+
attribute :duplicate_landing_page_blocks, Boolean
|
|
19
20
|
|
|
20
21
|
validates :slug, presence: true, format: { with: Decidim::ParticipatoryProcess.slug_format }
|
|
21
22
|
validates :title, translatable_presence: true
|
|
@@ -24,7 +25,7 @@ module Decidim
|
|
|
24
25
|
private
|
|
25
26
|
|
|
26
27
|
def slug_uniqueness
|
|
27
|
-
return unless OrganizationParticipatoryProcesses.new(current_organization).query.
|
|
28
|
+
return unless OrganizationParticipatoryProcesses.new(current_organization).query.where(slug:).where.not(id:).any?
|
|
28
29
|
|
|
29
30
|
errors.add(:slug, :taken)
|
|
30
31
|
end
|
|
@@ -13,7 +13,6 @@ module Decidim
|
|
|
13
13
|
|
|
14
14
|
mimic :participatory_process
|
|
15
15
|
|
|
16
|
-
translatable_attribute :announcement, Decidim::Attributes::RichText
|
|
17
16
|
translatable_attribute :description, Decidim::Attributes::RichText
|
|
18
17
|
translatable_attribute :developer_group, String
|
|
19
18
|
translatable_attribute :local_area, String
|
|
@@ -31,7 +30,8 @@ module Decidim
|
|
|
31
30
|
attribute :related_process_ids, Array[Integer]
|
|
32
31
|
attribute :weight, Integer, default: 0
|
|
33
32
|
|
|
34
|
-
attribute :
|
|
33
|
+
attribute :access_mode, String, default: :open
|
|
34
|
+
attribute :has_members, Boolean
|
|
35
35
|
attribute :promoted, Boolean
|
|
36
36
|
|
|
37
37
|
attribute :end_date, Decidim::Attributes::LocalizedDate
|
|
@@ -50,6 +50,9 @@ module Decidim
|
|
|
50
50
|
|
|
51
51
|
validates :weight, presence: true
|
|
52
52
|
|
|
53
|
+
validates :access_mode, presence: true, inclusion: { in: Decidim::ParticipatoryProcess.access_modes.keys }
|
|
54
|
+
validate :ensure_access_mode_for_has_members
|
|
55
|
+
|
|
53
56
|
validates :start_date, date: { before: :end_date, allow_blank: true, if: proc { |obj| obj.end_date.present? } }
|
|
54
57
|
validates :end_date, date: { after: :start_date, allow_blank: true, if: proc { |obj| obj.start_date.present? } }
|
|
55
58
|
|
|
@@ -84,12 +87,15 @@ module Decidim
|
|
|
84
87
|
def slug_uniqueness
|
|
85
88
|
return unless organization_participatory_processes
|
|
86
89
|
.where(slug:)
|
|
87
|
-
.with_deleted
|
|
88
90
|
.where.not(id: context[:process_id])
|
|
89
91
|
.any?
|
|
90
92
|
|
|
91
93
|
errors.add(:slug, :taken)
|
|
92
94
|
end
|
|
95
|
+
|
|
96
|
+
def ensure_access_mode_for_has_members
|
|
97
|
+
self.access_mode = :open if has_members == false
|
|
98
|
+
end
|
|
93
99
|
end
|
|
94
100
|
end
|
|
95
101
|
end
|
|
@@ -73,7 +73,7 @@ module Decidim
|
|
|
73
73
|
private
|
|
74
74
|
|
|
75
75
|
def slug_uniqueness
|
|
76
|
-
return unless OrganizationParticipatoryProcesses.new(current_organization).query.
|
|
76
|
+
return unless OrganizationParticipatoryProcesses.new(current_organization).query.where(slug:).where.not(id:).any?
|
|
77
77
|
|
|
78
78
|
errors.add(:slug, :taken)
|
|
79
79
|
end
|