decidim-participatory_processes 0.32.1 → 0.32.3
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/app/commands/decidim/participatory_processes/admin/create_participatory_process.rb +1 -1
- data/app/commands/decidim/participatory_processes/admin/create_participatory_process_group.rb +3 -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 +3 -1
- data/app/commands/decidim/participatory_processes/create_democratic_quality_indicators_page.rb +2 -0
- data/app/controllers/concerns/decidim/participatory_processes/admin/filterable.rb +1 -1
- data/app/controllers/decidim/participatory_processes/admin/component_share_tokens_controller.rb +2 -0
- data/app/controllers/decidim/participatory_processes/admin/concerns/participatory_process_admin.rb +9 -7
- data/app/controllers/decidim/participatory_processes/admin/members_csv_imports_controller.rb +2 -0
- data/app/controllers/decidim/participatory_processes/admin/moderations/reports_controller.rb +2 -0
- data/app/controllers/decidim/participatory_processes/admin/moderations_controller.rb +2 -0
- data/app/controllers/decidim/participatory_processes/admin/participatory_process_attachment_collections_controller.rb +2 -0
- data/app/controllers/decidim/participatory_processes/admin/participatory_process_attachments_controller.rb +2 -0
- data/app/controllers/decidim/participatory_processes/admin/participatory_process_exports_controller.rb +2 -0
- data/app/controllers/decidim/participatory_processes/admin/participatory_process_group_landing_page_controller.rb +7 -5
- data/app/controllers/decidim/participatory_processes/admin/participatory_process_landing_page_controller.rb +8 -2
- data/app/controllers/decidim/participatory_processes/admin/participatory_process_share_tokens_controller.rb +2 -0
- data/app/controllers/decidim/participatory_processes/admin/participatory_process_user_roles_controller.rb +2 -0
- data/app/controllers/decidim/participatory_processes/members_controller.rb +9 -0
- data/app/controllers/decidim/participatory_processes/participatory_processes_controller.rb +2 -0
- data/app/jobs/decidim/participatory_processes/change_active_step_job.rb +26 -8
- data/app/presenters/decidim/participatory_processes/admin_log/step_presenter.rb +1 -1
- data/app/views/decidim/participatory_processes/members/index.html.erb +2 -0
- data/config/locales/bg.yml +0 -1
- data/config/locales/ca-IT.yml +2 -1
- data/config/locales/ca.yml +3 -2
- data/config/locales/cs.yml +13 -2
- data/config/locales/de.yml +231 -3
- data/config/locales/el.yml +0 -1
- data/config/locales/en.yml +3 -2
- data/config/locales/es-MX.yml +2 -1
- data/config/locales/es-PY.yml +2 -1
- data/config/locales/es.yml +2 -1
- data/config/locales/eu.yml +140 -139
- data/config/locales/fi-plain.yml +2 -1
- data/config/locales/fi.yml +2 -1
- data/config/locales/fr-CA.yml +1 -0
- data/config/locales/fr.yml +1 -0
- data/config/locales/gl.yml +373 -11
- data/config/locales/hu.yml +0 -1
- data/config/locales/ja.yml +3 -2
- data/config/locales/lt.yml +0 -1
- data/config/locales/no.yml +0 -1
- data/config/locales/pl.yml +0 -1
- data/config/locales/pt-BR.yml +0 -2
- data/config/locales/ro-RO.yml +0 -1
- data/config/locales/sk.yml +5 -2
- data/config/locales/sv.yml +39 -3
- data/config/locales/zh-TW.yml +0 -1
- data/decidim-participatory_processes.gemspec +1 -1
- data/lib/decidim/participatory_processes/version.rb +1 -1
- metadata +15 -15
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f55930f1527e68ce1e21a3a91d977a819635f8ec13ded9b666ab66b7a85b8176
|
|
4
|
+
data.tar.gz: 21de9899545596c88f8844df66d327667b18e60796e90ff2044504e5d061c1b5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 78468c4525e6de283855de8eae916b269726648a2ea3f609551989435c64c5cf3160f6667a444e309c9db08adeb0f87501ce75790ec236ccb985c7727b8d2f96
|
|
7
|
+
data.tar.gz: b97bb1f88aaf5b4bde6a3edcb1ca90238f24363439a3b5e3dfe9f97dbf43011559f3dd5f5c68444e1d3b7d6d7cf602f2e9cf5418c8ba221ea5c65476373b6e8a
|
|
@@ -49,7 +49,7 @@ module Decidim
|
|
|
49
49
|
end
|
|
50
50
|
|
|
51
51
|
def related_processes
|
|
52
|
-
@related_processes ||=
|
|
52
|
+
@related_processes ||= resource.participatory_space_sibling_scope(:participatory_processes).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,6 +11,8 @@ 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
|
+
|
|
14
16
|
protected
|
|
15
17
|
|
|
16
18
|
def run_after_hooks
|
|
@@ -24,7 +26,7 @@ module Decidim
|
|
|
24
26
|
end
|
|
25
27
|
|
|
26
28
|
def participatory_processes
|
|
27
|
-
Decidim::ParticipatoryProcess.where(id: form.participatory_process_ids)
|
|
29
|
+
Decidim::ParticipatoryProcess.where(organization: current_organization, id: form.participatory_process_ids)
|
|
28
30
|
end
|
|
29
31
|
end
|
|
30
32
|
end
|
|
@@ -28,7 +28,7 @@ module Decidim
|
|
|
28
28
|
private
|
|
29
29
|
|
|
30
30
|
def related_processes
|
|
31
|
-
@related_processes ||=
|
|
31
|
+
@related_processes ||= resource.participatory_space_sibling_scope(:participatory_processes).where(id: form.related_process_ids)
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
def run_after_hooks
|
data/app/commands/decidim/participatory_processes/admin/update_participatory_process_group.rb
CHANGED
|
@@ -15,12 +15,14 @@ module Decidim
|
|
|
15
15
|
|
|
16
16
|
attr_reader :form
|
|
17
17
|
|
|
18
|
+
delegate :current_organization, to: :form
|
|
19
|
+
|
|
18
20
|
def attributes
|
|
19
21
|
super.merge({ participatory_processes: })
|
|
20
22
|
end
|
|
21
23
|
|
|
22
24
|
def participatory_processes
|
|
23
|
-
Decidim::ParticipatoryProcess.where(id: form.participatory_process_ids)
|
|
25
|
+
Decidim::ParticipatoryProcess.where(organization: current_organization, id: form.participatory_process_ids)
|
|
24
26
|
end
|
|
25
27
|
end
|
|
26
28
|
end
|
data/app/commands/decidim/participatory_processes/create_democratic_quality_indicators_page.rb
CHANGED
|
@@ -7,7 +7,9 @@ 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
|
|
10
11
|
@organization = Decidim::Organization.find(organization_id)
|
|
12
|
+
# rubocop:enable Decidim/OrganizationScopedFinder
|
|
11
13
|
end
|
|
12
14
|
|
|
13
15
|
# Executes the command that creates the required static page or returns it if it already exists.
|
|
@@ -38,7 +38,7 @@ 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.where(organization: current_organization).find_by(id:)&.title)
|
|
42
42
|
end
|
|
43
43
|
|
|
44
44
|
private
|
data/app/controllers/decidim/participatory_processes/admin/component_share_tokens_controller.rb
CHANGED
|
@@ -9,6 +9,8 @@ module Decidim
|
|
|
9
9
|
class ComponentShareTokensController < Decidim::Admin::ShareTokensController
|
|
10
10
|
include Concerns::ParticipatoryProcessAdmin
|
|
11
11
|
|
|
12
|
+
protected
|
|
13
|
+
|
|
12
14
|
def resource
|
|
13
15
|
@resource ||= current_participatory_space.components.find(params[:component_id])
|
|
14
16
|
end
|
data/app/controllers/decidim/participatory_processes/admin/concerns/participatory_process_admin.rb
CHANGED
|
@@ -20,26 +20,28 @@ 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, :current_participatory_space
|
|
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
|
-
|
|
32
28
|
def current_participatory_space
|
|
33
29
|
request.env["current_participatory_space"] ||
|
|
34
30
|
organization_processes.find_by!(slug: params[:participatory_process_slug] || params[:slug])
|
|
35
31
|
end
|
|
36
32
|
|
|
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
|
+
|
|
37
41
|
def permissions_context
|
|
38
42
|
super.merge(current_participatory_space:)
|
|
39
43
|
end
|
|
40
44
|
|
|
41
|
-
alias_method :current_participatory_process, :current_participatory_space
|
|
42
|
-
|
|
43
45
|
def permission_class_chain
|
|
44
46
|
PermissionsRegistry.chain_for(ParticipatoryProcessAdmin)
|
|
45
47
|
end
|
|
@@ -14,16 +14,18 @@ module Decidim
|
|
|
14
14
|
|
|
15
15
|
layout "decidim/admin/participatory_process_group"
|
|
16
16
|
|
|
17
|
-
helper_method :participatory_process_group
|
|
18
|
-
|
|
19
|
-
def content_block_scope
|
|
20
|
-
:participatory_process_group_homepage
|
|
21
|
-
end
|
|
17
|
+
helper_method :participatory_process_group, :scoped_resource
|
|
22
18
|
|
|
23
19
|
def scoped_resource
|
|
24
20
|
@scoped_resource ||= collection.find(params[:participatory_process_group_id])
|
|
25
21
|
end
|
|
26
22
|
|
|
23
|
+
protected
|
|
24
|
+
|
|
25
|
+
def content_block_scope
|
|
26
|
+
:participatory_process_group_homepage
|
|
27
|
+
end
|
|
28
|
+
|
|
27
29
|
def enforce_permission_to_update_resource
|
|
28
30
|
enforce_permission_to :update, :process_group, process_group: scoped_resource
|
|
29
31
|
end
|
|
@@ -10,12 +10,18 @@ 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
|
+
|
|
13
21
|
def content_block_scope
|
|
14
22
|
current_participatory_space_manifest.content_blocks_scope_name
|
|
15
23
|
end
|
|
16
24
|
|
|
17
|
-
alias scoped_resource current_participatory_space
|
|
18
|
-
|
|
19
25
|
def enforce_permission_to_update_resource
|
|
20
26
|
enforce_permission_to :update, :process, process: scoped_resource
|
|
21
27
|
end
|
|
@@ -8,6 +8,8 @@ module Decidim
|
|
|
8
8
|
class ParticipatoryProcessUserRolesController < Decidim::Admin::ParticipatorySpace::UserRoleController
|
|
9
9
|
include Concerns::ParticipatoryProcessAdmin
|
|
10
10
|
|
|
11
|
+
protected
|
|
12
|
+
|
|
11
13
|
def authorization_scope = :process_user_role
|
|
12
14
|
|
|
13
15
|
def resource_form = form(ParticipatoryProcessUserRoleForm)
|
|
@@ -4,11 +4,13 @@ module Decidim
|
|
|
4
4
|
module ParticipatoryProcesses
|
|
5
5
|
class MembersController < Decidim::ParticipatoryProcesses::ApplicationController
|
|
6
6
|
include ParticipatorySpaceContext
|
|
7
|
+
include Paginable
|
|
7
8
|
include Decidim::ParticipatorySpace::HasMembersPage
|
|
8
9
|
|
|
9
10
|
def index
|
|
10
11
|
raise ActionController::RoutingError, "No members for this participatory process" if members.none?
|
|
11
12
|
|
|
13
|
+
@members = paginate(members)
|
|
12
14
|
enforce_permission_to :list, :members
|
|
13
15
|
redirect_to decidim_participatory_processes.participatory_process_path(current_participatory_space) unless can_visit_index?
|
|
14
16
|
end
|
|
@@ -22,6 +24,13 @@ module Decidim
|
|
|
22
24
|
OrganizationParticipatoryProcesses.new(current_organization).query.where(id: params[:participatory_process_slug])
|
|
23
25
|
).first!
|
|
24
26
|
end
|
|
27
|
+
|
|
28
|
+
def page_params
|
|
29
|
+
{
|
|
30
|
+
per_page:,
|
|
31
|
+
page: params[:page]
|
|
32
|
+
}
|
|
33
|
+
end
|
|
25
34
|
end
|
|
26
35
|
end
|
|
27
36
|
end
|
|
@@ -51,9 +51,11 @@ module Decidim
|
|
|
51
51
|
def current_participatory_space
|
|
52
52
|
return unless params["slug"]
|
|
53
53
|
|
|
54
|
+
# rubocop:disable Decidim/OrganizationScopedFinder -- both branches are scoped to current_organization
|
|
54
55
|
@current_participatory_space ||= organization_participatory_processes.where(slug: params["slug"]).or(
|
|
55
56
|
organization_participatory_processes.where(id: params["slug"])
|
|
56
57
|
).first!
|
|
58
|
+
# rubocop:enable Decidim/OrganizationScopedFinder
|
|
57
59
|
end
|
|
58
60
|
|
|
59
61
|
def active_content_blocks
|
|
@@ -17,19 +17,37 @@ module Decidim
|
|
|
17
17
|
if steps.empty? && active_step
|
|
18
18
|
next_position = active_step.position + 1
|
|
19
19
|
next_step = process.steps.where(start_date: ..Time.zone.now.to_date).find_by(position: next_position)
|
|
20
|
-
if next_step.present?
|
|
21
|
-
active_step.update(active: false)
|
|
22
|
-
next_step.update(active: true)
|
|
23
|
-
end
|
|
20
|
+
activate_step(next_step, active_step) if next_step.present?
|
|
24
21
|
else
|
|
25
22
|
step_to_activate = steps.first
|
|
26
|
-
if active_step != step_to_activate
|
|
27
|
-
active_step&.update(active: false)
|
|
28
|
-
step_to_activate.update(active: true)
|
|
29
|
-
end
|
|
23
|
+
activate_step(step_to_activate, active_step) if active_step != step_to_activate
|
|
30
24
|
end
|
|
31
25
|
end
|
|
32
26
|
end
|
|
27
|
+
|
|
28
|
+
private
|
|
29
|
+
|
|
30
|
+
# Activates the given step and deactivates the previous one in a single
|
|
31
|
+
# transaction, so the log is always consistent with the phase changes.
|
|
32
|
+
# The target step is locked and reloaded inside the transaction so
|
|
33
|
+
# concurrent executions cannot log the same phase change twice: the first
|
|
34
|
+
# one performs the transition, the rest see the step as already active.
|
|
35
|
+
def activate_step(step, previous_step)
|
|
36
|
+
Decidim::ParticipatoryProcessStep.transaction do
|
|
37
|
+
step.lock!
|
|
38
|
+
|
|
39
|
+
next if step.active?
|
|
40
|
+
|
|
41
|
+
previous_step&.update!(active: false)
|
|
42
|
+
step.update!(active: true)
|
|
43
|
+
log(step)
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Since the action is not done by any specific user, we log it as a system action.
|
|
48
|
+
def log(step)
|
|
49
|
+
Decidim::ActionLogger.log_system(:system_activate, step)
|
|
50
|
+
end
|
|
33
51
|
end
|
|
34
52
|
end
|
|
35
53
|
end
|
data/config/locales/bg.yml
CHANGED
|
@@ -15,7 +15,6 @@ bg:
|
|
|
15
15
|
import_attachments: Импортиране на прикачени файлове
|
|
16
16
|
import_categories: Импортиране на категории
|
|
17
17
|
import_components: Импортиране на компоненти
|
|
18
|
-
import_steps: Стъпки за импортиране
|
|
19
18
|
local_area: Район на организацията
|
|
20
19
|
meta_scope: Метаданни сфера
|
|
21
20
|
participatory_process_group_id: Група процеси
|
data/config/locales/ca-IT.yml
CHANGED
|
@@ -20,7 +20,7 @@ ca-IT:
|
|
|
20
20
|
import_attachments: Importar arxius adjunts
|
|
21
21
|
import_categories: Importar categories
|
|
22
22
|
import_components: Importar components
|
|
23
|
-
import_steps: Importar fases
|
|
23
|
+
import_steps: Importar les fases
|
|
24
24
|
local_area: Àrea d'organització
|
|
25
25
|
meta_scope: Metadades d'àmbit
|
|
26
26
|
participatory_process_group_id: Grup de processos
|
|
@@ -285,6 +285,7 @@ ca-IT:
|
|
|
285
285
|
activate: "%{user_name} ha activat la fase %{resource_name} en el procés participatiu %{space_name}"
|
|
286
286
|
create: "%{user_name} ha creat la fase %{resource_name} en el procés participatiu %{space_name}"
|
|
287
287
|
delete: "%{user_name} ha eliminat la fase %{resource_name} en el procés participatiu %{space_name}"
|
|
288
|
+
system_activate: La fase de %{resource_name} s'ha activat automàticament al procés participatiu %{space_name}.
|
|
288
289
|
update: "%{user_name} ha actualitzat la fase %{resource_name} en el procés participatiu %{space_name}"
|
|
289
290
|
participatory_process_user_role:
|
|
290
291
|
create: "%{user_name} ha convidat la participant %{resource_name} al procés participatiu %{space_name}"
|
data/config/locales/ca.yml
CHANGED
|
@@ -20,7 +20,7 @@ ca:
|
|
|
20
20
|
import_attachments: Importar arxius adjunts
|
|
21
21
|
import_categories: Importar categories
|
|
22
22
|
import_components: Importar components
|
|
23
|
-
import_steps: Importar fases
|
|
23
|
+
import_steps: Importar les fases
|
|
24
24
|
local_area: Àrea d'organització
|
|
25
25
|
meta_scope: Metadades d'àmbit
|
|
26
26
|
participatory_process_group_id: Grup de processos
|
|
@@ -285,6 +285,7 @@ ca:
|
|
|
285
285
|
activate: "%{user_name} ha activat la fase %{resource_name} en el procés participatiu %{space_name}"
|
|
286
286
|
create: "%{user_name} ha creat la fase %{resource_name} en el procés participatiu %{space_name}"
|
|
287
287
|
delete: "%{user_name} ha eliminat la fase %{resource_name} en el procés participatiu %{space_name}"
|
|
288
|
+
system_activate: La fase de %{resource_name} s'ha activat automàticament al procés participatiu %{space_name}.
|
|
288
289
|
update: "%{user_name} ha actualitzat la fase %{resource_name} en el procés participatiu %{space_name}"
|
|
289
290
|
participatory_process_user_role:
|
|
290
291
|
create: "%{user_name} ha convidat la participant %{resource_name} al procés participatiu %{space_name}"
|
|
@@ -483,7 +484,7 @@ ca:
|
|
|
483
484
|
title: Duplicar el procés participatiu
|
|
484
485
|
participatory_process_groups:
|
|
485
486
|
edit:
|
|
486
|
-
title: Editar el grup de
|
|
487
|
+
title: Editar el grup de processos
|
|
487
488
|
form:
|
|
488
489
|
metadata: Metadades
|
|
489
490
|
title: Quant a aquest procés
|
data/config/locales/cs.yml
CHANGED
|
@@ -13,14 +13,12 @@ cs:
|
|
|
13
13
|
duplicate_categories: Duplikovat kategorie
|
|
14
14
|
duplicate_components: Duplikovat komponenty
|
|
15
15
|
duplicate_landing_page_blocks: Duplikovat bloky vstupní strany
|
|
16
|
-
duplicate_steps: Duplikovat kroky
|
|
17
16
|
end_date: Datum ukončení
|
|
18
17
|
has_members: Tento prostor má členy
|
|
19
18
|
hero_image: Domácí obrázek
|
|
20
19
|
import_attachments: Importovat přílohy
|
|
21
20
|
import_categories: Importovat kategorie
|
|
22
21
|
import_components: Importovat komponenty
|
|
23
|
-
import_steps: Importovat kroky
|
|
24
22
|
local_area: Oblast působnosti organizace
|
|
25
23
|
meta_scope: Metadata Oblasti působnosti
|
|
26
24
|
participatory_process_group_id: Skupina procesů
|
|
@@ -504,9 +502,22 @@ cs:
|
|
|
504
502
|
form:
|
|
505
503
|
document_legend: Přidat dokument
|
|
506
504
|
slug_help_html: 'URL slugy slouží ke generaci adres URL, které odkazují na tento proces. Povolená jsou pouze písmena, číslice a pomlčky a musí začínat písmenem. Příklad: %{url}'
|
|
505
|
+
new:
|
|
506
|
+
title: Importovat participační proces
|
|
507
507
|
participatory_process_steps:
|
|
508
|
+
edit:
|
|
509
|
+
title: Upravit fázi participačního procesu
|
|
510
|
+
index:
|
|
511
|
+
title: Fáze
|
|
508
512
|
new:
|
|
509
513
|
title: Nová fáze participativního procesu
|
|
514
|
+
participatory_process_user_roles:
|
|
515
|
+
edit:
|
|
516
|
+
title: Aktualizovat správce participačního procesu
|
|
517
|
+
index:
|
|
518
|
+
title: Správci participačního procesu
|
|
519
|
+
new:
|
|
520
|
+
title: Nový správce participačního procesu
|
|
510
521
|
participatory_processes:
|
|
511
522
|
edit:
|
|
512
523
|
title: O tomto procesu
|