decidim-participatory_processes 0.29.3 → 0.29.4
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/copy_participatory_process.rb +34 -0
- data/app/controllers/decidim/participatory_processes/participatory_processes_controller.rb +1 -1
- data/app/forms/decidim/participatory_processes/admin/participatory_process_copy_form.rb +1 -0
- data/app/permissions/decidim/participatory_processes/permissions.rb +2 -4
- data/app/views/decidim/participatory_processes/admin/participatory_process_copies/_form.html.erb +4 -0
- data/config/locales/cs.yml +2 -0
- data/config/locales/de.yml +1 -1
- data/config/locales/sv.yml +1 -1
- data/lib/decidim/participatory_processes/version.rb +1 -1
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 638da94129c4ea244343f361423df19de628ff9877b6087198b1b00b98f29842
|
4
|
+
data.tar.gz: 966c9bbee561e69dff485f866e2d5cd875f9d1b244f1991a32efc035ab5532b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ba330c8d79a06a96098ec14b3c95ba719141eb51af017c8ab737ff9ade2cdd42be2245fb6306e5d8921e607205f5b1a01ffa0961d4598f6a499ddea9fcfa808
|
7
|
+
data.tar.gz: 7ab9b68628b4c7bc549534694eb0dc5c647a121a1bedae2af3df3da38184feef35d3b1ea80050ae65bc962d39bc5d413292c5665beb96df39aaa37eb82342d5e
|
@@ -32,6 +32,7 @@ module Decidim
|
|
32
32
|
copy_participatory_process_steps if @form.copy_steps?
|
33
33
|
copy_participatory_process_categories if @form.copy_categories?
|
34
34
|
copy_participatory_process_components if @form.copy_components?
|
35
|
+
copy_landing_page_blocks if @form.copy_landing_page_blocks?
|
35
36
|
end
|
36
37
|
end
|
37
38
|
|
@@ -129,6 +130,39 @@ module Decidim
|
|
129
130
|
acc.update(@steps_relationship[step_id.to_s] => settings)
|
130
131
|
end
|
131
132
|
end
|
133
|
+
|
134
|
+
def copy_landing_page_blocks
|
135
|
+
blocks = Decidim::ContentBlock.where(scoped_resource_id: @participatory_process.id, scope_name: "participatory_process_homepage",
|
136
|
+
organization: @participatory_process.organization)
|
137
|
+
return if blocks.blank?
|
138
|
+
|
139
|
+
blocks.each do |block|
|
140
|
+
new_block = Decidim::ContentBlock.create!(
|
141
|
+
organization: @copied_process.organization,
|
142
|
+
scope_name: "participatory_process_homepage",
|
143
|
+
scoped_resource_id: @copied_process.id,
|
144
|
+
manifest_name: block.manifest_name,
|
145
|
+
settings: block.settings,
|
146
|
+
weight: block.weight,
|
147
|
+
published_at: block.published_at.present? ? @copied_process.created_at : nil # determine if block is active/inactive
|
148
|
+
)
|
149
|
+
copy_block_attachments(block, new_block) if block.attachments.present?
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
def copy_block_attachments(block, new_block)
|
154
|
+
block.attachments.map(&:name).each do |name|
|
155
|
+
original_image = block.images_container.send(name).blob
|
156
|
+
next if original_image.blank?
|
157
|
+
|
158
|
+
new_block.images_container.send("#{name}=", ActiveStorage::Blob.create_and_upload!(
|
159
|
+
io: StringIO.new(original_image.download),
|
160
|
+
filename: "image.png",
|
161
|
+
content_type: block.images_container.background_image.blob.content_type
|
162
|
+
))
|
163
|
+
new_block.save!
|
164
|
+
end
|
165
|
+
end
|
132
166
|
end
|
133
167
|
end
|
134
168
|
end
|
@@ -17,6 +17,7 @@ module Decidim
|
|
17
17
|
attribute :copy_steps, Boolean
|
18
18
|
attribute :copy_categories, Boolean
|
19
19
|
attribute :copy_components, Boolean
|
20
|
+
attribute :copy_landing_page_blocks, Boolean
|
20
21
|
|
21
22
|
validates :slug, presence: true, format: { with: Decidim::ParticipatoryProcess.slug_format }
|
22
23
|
validates :title, translatable_presence: true
|
@@ -3,8 +3,6 @@
|
|
3
3
|
module Decidim
|
4
4
|
module ParticipatoryProcesses
|
5
5
|
class Permissions < Decidim::DefaultPermissions
|
6
|
-
include Decidim::UserRoleChecker
|
7
|
-
|
8
6
|
def permissions
|
9
7
|
user_can_enter_processes_space_area?
|
10
8
|
user_can_enter_process_groups_space_area?
|
@@ -127,7 +125,7 @@ module Decidim
|
|
127
125
|
return true unless process.private_space
|
128
126
|
return false unless user
|
129
127
|
|
130
|
-
user.admin || process.users.include?(user)
|
128
|
+
user.admin || user_has_any_role?(user, process, broad_check: true) || process.users.include?(user)
|
131
129
|
end
|
132
130
|
|
133
131
|
# Only organization admins can enter the process groups space area.
|
@@ -148,7 +146,7 @@ module Decidim
|
|
148
146
|
permission_action.subject == :space_area &&
|
149
147
|
context.fetch(:space_name, nil) == :processes
|
150
148
|
|
151
|
-
toggle_allow(user.admin? || has_manageable_processes?)
|
149
|
+
toggle_allow(user.admin? || user_has_any_role?(user, process, broad_check: true) || has_manageable_processes?)
|
152
150
|
end
|
153
151
|
|
154
152
|
# Only organization admins can manage process groups.
|
data/config/locales/cs.yml
CHANGED
@@ -397,6 +397,8 @@ cs:
|
|
397
397
|
few: "%{count} procesy"
|
398
398
|
many: "%{count} procesů"
|
399
399
|
other: "%{count} procesy"
|
400
|
+
related_processes:
|
401
|
+
help: Všechny vybrané procesy budou přiřazeny k této skupině, včetně těch, které jsou již přiřazeny do jiných skupin.
|
400
402
|
show:
|
401
403
|
title: Skupiny účastnických procesů
|
402
404
|
participatory_process_steps:
|
data/config/locales/de.yml
CHANGED
data/config/locales/sv.yml
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decidim-participatory_processes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.29.
|
4
|
+
version: 0.29.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josep Jaume Rey Peroy
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2025-04
|
13
|
+
date: 2025-06-04 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: decidim-core
|
@@ -18,56 +18,56 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - '='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.29.
|
21
|
+
version: 0.29.4
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - '='
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: 0.29.
|
28
|
+
version: 0.29.4
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: decidim-admin
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
33
|
- - '='
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: 0.29.
|
35
|
+
version: 0.29.4
|
36
36
|
type: :development
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
40
|
- - '='
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: 0.29.
|
42
|
+
version: 0.29.4
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: decidim-dev
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
47
|
- - '='
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 0.29.
|
49
|
+
version: 0.29.4
|
50
50
|
type: :development
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
54
|
- - '='
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: 0.29.
|
56
|
+
version: 0.29.4
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
58
|
name: decidim-meetings
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
61
|
- - '='
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version: 0.29.
|
63
|
+
version: 0.29.4
|
64
64
|
type: :development
|
65
65
|
prerelease: false
|
66
66
|
version_requirements: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
68
|
- - '='
|
69
69
|
- !ruby/object:Gem::Version
|
70
|
-
version: 0.29.
|
70
|
+
version: 0.29.4
|
71
71
|
description: Participatory processes component for decidim.
|
72
72
|
email:
|
73
73
|
- josepjaume@gmail.com
|