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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f62baad6499413313f952d8b3f6cf3552d7bea7fccd6186157bebcdab786c080
4
- data.tar.gz: 30b390a99a17c135613e7e78d3335dd3d1b6e90d85f56edc4e3207568421c20e
3
+ metadata.gz: 638da94129c4ea244343f361423df19de628ff9877b6087198b1b00b98f29842
4
+ data.tar.gz: 966c9bbee561e69dff485f866e2d5cd875f9d1b244f1991a32efc035ab5532b7
5
5
  SHA512:
6
- metadata.gz: bc955ce744afa121d2d0335d4cb836a79c7bf8900ebfd672639837aac0ef02008ab4de718d009e69654a1b62de84bbdf8becdcbdbfbaa74001d4e2751faae5c2
7
- data.tar.gz: 2a737cfd019efe487eef20ceb16fa691c5a26cea8a799c6ef7be87255d4455685fb15042d7f085ded96fd52b781f33658fc748929301d839857682c3c2d02531
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
@@ -38,7 +38,7 @@ module Decidim
38
38
  private
39
39
 
40
40
  def search_collection
41
- ParticipatoryProcess.where(organization: current_organization).published.visible_for(current_user).includes(:area)
41
+ published_processes.query
42
42
  end
43
43
 
44
44
  def default_filter_params
@@ -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.
@@ -25,6 +25,10 @@
25
25
  <div class="columns">
26
26
  <%= form.check_box :copy_components %>
27
27
  </div>
28
+
29
+ <div class="columns">
30
+ <%= form.check_box :copy_landing_page_blocks %>
31
+ </div>
28
32
  </div>
29
33
  </div>
30
34
  </div>
@@ -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:
@@ -497,7 +497,7 @@ de:
497
497
  all: Alle
498
498
  past: Vergangenheit
499
499
  upcoming: Bevorstehende
500
- see: Sehen
500
+ see: Anzeigen
501
501
  type: Typ
502
502
  show:
503
503
  title: Über diesen Prozess
@@ -54,7 +54,7 @@ sv:
54
54
  target: Vem deltar
55
55
  title: Titel
56
56
  participatory_process_step:
57
- cta_path: Sökväg för knapp
57
+ cta_path: Knappens länk
58
58
  cta_text: Text till knapp
59
59
  description: Beskrivning
60
60
  end_date: Slutdatum
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-participatory_processes version.
5
5
  module ParticipatoryProcesses
6
6
  def self.version
7
- "0.29.3"
7
+ "0.29.4"
8
8
  end
9
9
  end
10
10
  end
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.3
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-29 00:00:00.000000000 Z
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.3
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.3
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.3
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.3
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.3
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.3
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.3
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.3
70
+ version: 0.29.4
71
71
  description: Participatory processes component for decidim.
72
72
  email:
73
73
  - josepjaume@gmail.com