decidim-participatory_processes 0.30.0 → 0.30.1
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/app/views/decidim/participatory_processes/admin/participatory_processes/index.html.erb +11 -9
- 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: 3ec746618231c71ebc5363f1ec0b72f46df5edba27e9656c7d66044070c833ee
|
4
|
+
data.tar.gz: ab0e1e197c3045a357e1028b56c9a3e05e81e578733c8572f1742cb747e46331
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7808fb5e4933b2245df4147dca4b7d19841075a64193023ddcce4b32cbbb350519f9d27fe1f62ada2ffed9e37640323cdba531a5daaf900a9a9a1ee690c91e7
|
7
|
+
data.tar.gz: 35a0fdb71e859f20248178186dfbaab595cbdd121d377db363abf956b4210764f251ff2108bee476b376dc0dde61f7e37882dd90130a9767c88d9c65c0bbac60
|
@@ -31,6 +31,7 @@ module Decidim
|
|
31
31
|
copy_participatory_process_attachments
|
32
32
|
copy_participatory_process_steps if @form.copy_steps?
|
33
33
|
copy_participatory_process_components if @form.copy_components?
|
34
|
+
copy_landing_page_blocks if @form.copy_landing_page_blocks?
|
34
35
|
end
|
35
36
|
end
|
36
37
|
|
@@ -108,6 +109,39 @@ module Decidim
|
|
108
109
|
acc.update(@steps_relationship[step_id.to_s] => settings)
|
109
110
|
end
|
110
111
|
end
|
112
|
+
|
113
|
+
def copy_landing_page_blocks
|
114
|
+
blocks = Decidim::ContentBlock.where(scoped_resource_id: @participatory_process.id, scope_name: "participatory_process_homepage",
|
115
|
+
organization: @participatory_process.organization)
|
116
|
+
return if blocks.blank?
|
117
|
+
|
118
|
+
blocks.each do |block|
|
119
|
+
new_block = Decidim::ContentBlock.create!(
|
120
|
+
organization: @copied_process.organization,
|
121
|
+
scope_name: "participatory_process_homepage",
|
122
|
+
scoped_resource_id: @copied_process.id,
|
123
|
+
manifest_name: block.manifest_name,
|
124
|
+
settings: block.settings,
|
125
|
+
weight: block.weight,
|
126
|
+
published_at: block.published_at.present? ? @copied_process.created_at : nil # determine if block is active/inactive
|
127
|
+
)
|
128
|
+
copy_block_attachments(block, new_block) if block.attachments.present?
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
def copy_block_attachments(block, new_block)
|
133
|
+
block.attachments.map(&:name).each do |name|
|
134
|
+
original_image = block.images_container.send(name).blob
|
135
|
+
next if original_image.blank?
|
136
|
+
|
137
|
+
new_block.images_container.send("#{name}=", ActiveStorage::Blob.create_and_upload!(
|
138
|
+
io: StringIO.new(original_image.download),
|
139
|
+
filename: "image.png",
|
140
|
+
content_type: block.images_container.background_image.blob.content_type
|
141
|
+
))
|
142
|
+
new_block.save!
|
143
|
+
end
|
144
|
+
end
|
111
145
|
end
|
112
146
|
end
|
113
147
|
end
|
@@ -16,6 +16,7 @@ module Decidim
|
|
16
16
|
attribute :slug, String
|
17
17
|
attribute :copy_steps, Boolean
|
18
18
|
attribute :copy_components, Boolean
|
19
|
+
attribute :copy_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
|
@@ -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?
|
@@ -135,7 +133,7 @@ module Decidim
|
|
135
133
|
return true unless process.private_space
|
136
134
|
return false unless user
|
137
135
|
|
138
|
-
user.admin || process.users.include?(user)
|
136
|
+
user.admin || user_has_any_role?(user, process, broad_check: true) || process.users.include?(user)
|
139
137
|
end
|
140
138
|
|
141
139
|
# Only organization admins can enter the process groups space area.
|
@@ -156,7 +154,7 @@ module Decidim
|
|
156
154
|
permission_action.subject == :space_area &&
|
157
155
|
context.fetch(:space_name, nil) == :processes
|
158
156
|
|
159
|
-
toggle_allow(user.admin? || has_manageable_processes?)
|
157
|
+
toggle_allow(user.admin? || user_has_any_role?(user, process, broad_check: true) || has_manageable_processes?)
|
160
158
|
end
|
161
159
|
|
162
160
|
# Only organization admins can manage process groups.
|
@@ -16,14 +16,16 @@
|
|
16
16
|
</tbody>
|
17
17
|
</table>
|
18
18
|
</div>
|
19
|
-
|
20
|
-
|
21
|
-
<%=
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
19
|
+
<% if allowed_to? :read, :process, trashable_deleted_resource: @participatory_processes %>
|
20
|
+
<div class="card mt-4">
|
21
|
+
<%= link_to manage_trash_participatory_processes_path, class: "flex items-center underline text-secondary" do %>
|
22
|
+
<%= icon "delete-bin-2-line", class: "mr-2 fill-current text-secondary", role: "img" %>
|
23
|
+
<%= t("actions.view_deleted_processes", scope: "decidim.admin") %>
|
24
|
+
<span class="ml-2">
|
25
|
+
<%= icon_with_tooltip("information-line", t("tooltips.deleted_processes_info", scope: "decidim.admin")) %>
|
26
|
+
</span>
|
27
|
+
<% end %>
|
28
|
+
</div>
|
29
|
+
<% end %>
|
28
30
|
|
29
31
|
<%= decidim_paginate @participatory_processes %>
|
data/config/locales/cs.yml
CHANGED
@@ -417,6 +417,8 @@ cs:
|
|
417
417
|
few: "%{count} procesy"
|
418
418
|
many: "%{count} procesů"
|
419
419
|
other: "%{count} procesy"
|
420
|
+
related_processes:
|
421
|
+
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.
|
420
422
|
show:
|
421
423
|
title: Skupiny účastnických procesů
|
422
424
|
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.30.
|
4
|
+
version: 0.30.1
|
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-
|
13
|
+
date: 2025-06-17 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.30.
|
21
|
+
version: 0.30.1
|
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.30.
|
28
|
+
version: 0.30.1
|
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.30.
|
35
|
+
version: 0.30.1
|
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.30.
|
42
|
+
version: 0.30.1
|
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.30.
|
49
|
+
version: 0.30.1
|
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.30.
|
56
|
+
version: 0.30.1
|
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.30.
|
63
|
+
version: 0.30.1
|
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.30.
|
70
|
+
version: 0.30.1
|
71
71
|
description: Participatory processes component for decidim.
|
72
72
|
email:
|
73
73
|
- josepjaume@gmail.com
|