decidim-assemblies 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/assemblies/admin/copy_assembly.rb +33 -0
- data/app/controllers/decidim/assemblies/assemblies_controller.rb +1 -1
- data/app/forms/decidim/assemblies/admin/assembly_copy_form.rb +1 -0
- data/app/permissions/decidim/assemblies/permissions.rb +0 -2
- data/app/views/decidim/assemblies/admin/assembly_copies/_form.html.erb +3 -0
- data/lib/decidim/assemblies/version.rb +1 -1
- metadata +12 -12
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7d6642113d8f167a74580ae7b36d4b54f2e0cf441a56ea1abb8f0ad4c1fe4755
|
|
4
|
+
data.tar.gz: 42495dea1f3c1d55d50b2042d65fd31bea17c74cb8e50e0f080264769b00247f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7eaaae833c4b89e986b3947a80d0f56283df63adbe1f20a136d9aaf8a6f4c614746e6b40df57ae8e9e1ccf6c8acc915c1008ff87209d63ae69ed66e01867fd69
|
|
7
|
+
data.tar.gz: 0ab673aa157f27b79309c91aebe7c482a024880ea9f7e7f6583ba4d3615ccae5269c50af460b8c3d1c1532ece55bec3f4d78f94c882ec66e87f88df977baca9a
|
|
@@ -31,6 +31,7 @@ module Decidim
|
|
|
31
31
|
copy_assembly_attachments
|
|
32
32
|
copy_assembly_categories if @form.copy_categories?
|
|
33
33
|
copy_assembly_components if @form.copy_components?
|
|
34
|
+
copy_landing_page_blocks if @form.copy_landing_page_blocks?
|
|
34
35
|
end
|
|
35
36
|
end
|
|
36
37
|
|
|
@@ -96,6 +97,38 @@ module Decidim
|
|
|
96
97
|
component.manifest.run_hooks(:copy, new_component:, old_component: component)
|
|
97
98
|
end
|
|
98
99
|
end
|
|
100
|
+
|
|
101
|
+
def copy_landing_page_blocks
|
|
102
|
+
blocks = Decidim::ContentBlock.where(scoped_resource_id: @assembly.id, scope_name: "assembly_homepage", organization: @assembly.organization)
|
|
103
|
+
return if blocks.blank?
|
|
104
|
+
|
|
105
|
+
blocks.each do |block|
|
|
106
|
+
new_block = Decidim::ContentBlock.create!(
|
|
107
|
+
organization: @copied_assembly.organization,
|
|
108
|
+
scope_name: "assembly_homepage",
|
|
109
|
+
scoped_resource_id: @copied_assembly.id,
|
|
110
|
+
manifest_name: block.manifest_name,
|
|
111
|
+
settings: block.settings,
|
|
112
|
+
weight: block.weight,
|
|
113
|
+
published_at: block.published_at.present? ? @copied_assembly.created_at : nil # determine if block is active/inactive
|
|
114
|
+
)
|
|
115
|
+
copy_block_attachments(block, new_block) if block.attachments.present?
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
def copy_block_attachments(block, new_block)
|
|
120
|
+
block.attachments.map(&:name).each do |name|
|
|
121
|
+
original_image = block.images_container.send(name).blob
|
|
122
|
+
next if original_image.blank?
|
|
123
|
+
|
|
124
|
+
new_block.images_container.send("#{name}=", ActiveStorage::Blob.create_and_upload!(
|
|
125
|
+
io: StringIO.new(original_image.download),
|
|
126
|
+
filename: "image.png",
|
|
127
|
+
content_type: block.images_container.background_image.blob.content_type
|
|
128
|
+
))
|
|
129
|
+
new_block.save!
|
|
130
|
+
end
|
|
131
|
+
end
|
|
99
132
|
end
|
|
100
133
|
end
|
|
101
134
|
end
|
|
@@ -16,6 +16,7 @@ module Decidim
|
|
|
16
16
|
attribute :slug, String
|
|
17
17
|
attribute :copy_categories, 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::Assembly.slug_format }
|
|
21
22
|
validates :title, translatable_presence: true
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: decidim-assemblies
|
|
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,70 +18,70 @@ 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
|
- !ruby/object:Gem::Dependency
|
|
72
72
|
name: decidim-proposals
|
|
73
73
|
requirement: !ruby/object:Gem::Requirement
|
|
74
74
|
requirements:
|
|
75
75
|
- - '='
|
|
76
76
|
- !ruby/object:Gem::Version
|
|
77
|
-
version: 0.29.
|
|
77
|
+
version: 0.29.4
|
|
78
78
|
type: :development
|
|
79
79
|
prerelease: false
|
|
80
80
|
version_requirements: !ruby/object:Gem::Requirement
|
|
81
81
|
requirements:
|
|
82
82
|
- - '='
|
|
83
83
|
- !ruby/object:Gem::Version
|
|
84
|
-
version: 0.29.
|
|
84
|
+
version: 0.29.4
|
|
85
85
|
description: Assemblies component for decidim.
|
|
86
86
|
email:
|
|
87
87
|
- josepjaume@gmail.com
|