decidim-pages 0.27.0 → 0.27.2
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/serializers/decidim/pages/data_importer.rb +27 -0
- data/app/serializers/decidim/pages/data_serializer.rb +22 -0
- data/config/locales/gn-PY.yml +1 -0
- data/config/locales/ka-GE.yml +1 -0
- data/config/locales/lo-LA.yml +1 -0
- data/config/locales/ro-RO.yml +2 -0
- data/lib/decidim/pages/component.rb +3 -0
- data/lib/decidim/pages/version.rb +1 -1
- metadata +14 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b84f6bde26d88deff20f1b1ac71843fe2dc0cab369de085b8e71bf531118b914
|
4
|
+
data.tar.gz: 503a4ee28a9ac7a781968d84af519257894a8b52252adcb6f579380e3624453c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae4379a0c98d05e1840a2064ed43848f3095d5ca2648c2f748b958cb490bfddb6871c141ac8f93607ee45f8dd551c0a62bbdccfc575690a9ec3111d1724f3895
|
7
|
+
data.tar.gz: 468065183f33b65d2897a9a7439b54c452095e782fa1ed76ef0e8ad9f416fe6602183b734e3dd8c271cbc4907abdf7cbedb9b924114d84721192964a377595b3
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Pages
|
5
|
+
# Importer for Pages specific data (i.e. its page content).
|
6
|
+
class DataImporter < Decidim::Importers::Importer
|
7
|
+
def initialize(component)
|
8
|
+
@component = component
|
9
|
+
end
|
10
|
+
|
11
|
+
# Creates a new Decidim::Pages::Page associated to the given **component**
|
12
|
+
# for the serialized page object.
|
13
|
+
#
|
14
|
+
# @param serialized [Hash] The serialized data read from the import file.
|
15
|
+
# @param _user [Decidim::User] The user performing the import.
|
16
|
+
# @return [Decidim::Pages::Page] The imported page
|
17
|
+
def import(serialized, _user)
|
18
|
+
return unless serialized
|
19
|
+
|
20
|
+
Page.create!(
|
21
|
+
component: @component,
|
22
|
+
body: serialized["body"]
|
23
|
+
)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Pages
|
5
|
+
# This class serializes the specific data in each Page. This is the page
|
6
|
+
# data outside of the component settings.
|
7
|
+
class DataSerializer < Decidim::Exporters::Serializer
|
8
|
+
include Decidim::TranslationsHelper
|
9
|
+
|
10
|
+
# Serializes the page data for this component.
|
11
|
+
#
|
12
|
+
# @return [Hash] The serialized data
|
13
|
+
def serialize
|
14
|
+
page = Page.find_by(component: resource)
|
15
|
+
|
16
|
+
{
|
17
|
+
body: page&.body || empty_translatable
|
18
|
+
}
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
gn:
|
@@ -0,0 +1 @@
|
|
1
|
+
ka:
|
@@ -0,0 +1 @@
|
|
1
|
+
lo:
|
data/config/locales/ro-RO.yml
CHANGED
@@ -6,6 +6,9 @@ Decidim.register_component(:pages) do |component|
|
|
6
6
|
component.engine = Decidim::Pages::Engine
|
7
7
|
component.admin_engine = Decidim::Pages::AdminEngine
|
8
8
|
component.icon = "media/images/decidim_pages.svg"
|
9
|
+
component.serializes_specific_data = true
|
10
|
+
component.specific_data_serializer_class_name = "Decidim::Pages::DataSerializer"
|
11
|
+
component.specific_data_importer_class_name = "Decidim::Pages::DataImporter"
|
9
12
|
component.permissions_class_name = "Decidim::Pages::Permissions"
|
10
13
|
|
11
14
|
component.query_type = "Decidim::Pages::PagesType"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decidim-pages
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.27.
|
4
|
+
version: 0.27.2
|
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:
|
13
|
+
date: 2023-02-13 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: decidim-core
|
@@ -18,42 +18,42 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - '='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.27.
|
21
|
+
version: 0.27.2
|
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.27.
|
28
|
+
version: 0.27.2
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: decidim-dev
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
33
|
- - '='
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: 0.27.
|
35
|
+
version: 0.27.2
|
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.27.
|
42
|
+
version: 0.27.2
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: decidim-participatory_processes
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
47
|
- - '='
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 0.27.
|
49
|
+
version: 0.27.2
|
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.27.
|
56
|
+
version: 0.27.2
|
57
57
|
description: A pages component for decidim's participatory processes.
|
58
58
|
email:
|
59
59
|
- josepjaume@gmail.com
|
@@ -80,6 +80,8 @@ files:
|
|
80
80
|
- app/packs/images/decidim/pages/decidim_pages.svg
|
81
81
|
- app/permissions/decidim/pages/permissions.rb
|
82
82
|
- app/presenters/decidim/pages/admin_log/page_presenter.rb
|
83
|
+
- app/serializers/decidim/pages/data_importer.rb
|
84
|
+
- app/serializers/decidim/pages/data_serializer.rb
|
83
85
|
- app/views/decidim/pages/admin/pages/_form.html.erb
|
84
86
|
- app/views/decidim/pages/admin/pages/edit.html.erb
|
85
87
|
- app/views/decidim/pages/application/show.html.erb
|
@@ -114,6 +116,7 @@ files:
|
|
114
116
|
- config/locales/fr.yml
|
115
117
|
- config/locales/ga-IE.yml
|
116
118
|
- config/locales/gl.yml
|
119
|
+
- config/locales/gn-PY.yml
|
117
120
|
- config/locales/hr-HR.yml
|
118
121
|
- config/locales/hr.yml
|
119
122
|
- config/locales/hu.yml
|
@@ -122,10 +125,12 @@ files:
|
|
122
125
|
- config/locales/is.yml
|
123
126
|
- config/locales/it.yml
|
124
127
|
- config/locales/ja.yml
|
128
|
+
- config/locales/ka-GE.yml
|
125
129
|
- config/locales/ko-KR.yml
|
126
130
|
- config/locales/ko.yml
|
127
131
|
- config/locales/lb-LU.yml
|
128
132
|
- config/locales/lb.yml
|
133
|
+
- config/locales/lo-LA.yml
|
129
134
|
- config/locales/lt-LT.yml
|
130
135
|
- config/locales/lt.yml
|
131
136
|
- config/locales/lv.yml
|
@@ -189,7 +194,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
189
194
|
- !ruby/object:Gem::Version
|
190
195
|
version: '0'
|
191
196
|
requirements: []
|
192
|
-
rubygems_version: 3.
|
197
|
+
rubygems_version: 3.3.7
|
193
198
|
signing_key:
|
194
199
|
specification_version: 4
|
195
200
|
summary: Decidim pages module
|