radiant-children_config-extension 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +4 -2
- data/lib/children_config/page_extensions.rb +10 -10
- data/lib/radiant-children_config-extension/version.rb +2 -2
- metadata +26 -36
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2394f7cb402e519fba5b7c917ec00ea0680a22b6d77b18f991c68f98b5ec94e2
|
4
|
+
data.tar.gz: bf9c9fa66f24b505dd75d5070fa3b757b2a2eecb753be929d89d56978ff807db
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3cb3c980a718f2ab64de4a45be0b28287d67e56b021f8d5e72e86c1abb72f4694282fd611eaec436a8dd1e257f84aaded681cb6cf4e57732e5dce0d829a51b01
|
7
|
+
data.tar.gz: 1d87344d2dbf3ae5a2f903844259894f49df2362415586101181e6e1b7efe6111c9b8e314b70319b27625ce43ce0ccfcbc00190f5470dede2d4599c76ab1ab0d
|
data/README.md
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
# Children Config
|
2
2
|
|
3
|
-
Allows you to define new default page
|
3
|
+
Allows you to define new default page properties for every new child of a certain page.
|
4
|
+
Most commonly used to set new default page parts or fields, but you could also put 'template' content in page parts or create new children for the child page.
|
5
|
+
|
4
6
|
Based on the [default\_page\_parts extension](https://github.com/santry/radiant-default-page-parts-extension), originally created by Sean Santry.
|
5
7
|
|
6
|
-
##
|
8
|
+
## Examples
|
7
9
|
|
8
10
|
Let's say you want all pages under "Events" to have the page parts "location", "description" and "date" by default.
|
9
11
|
Simply add a "children_config" page part to the "Events" page. In the content of that page part, put:
|
@@ -2,7 +2,7 @@ module ChildrenConfig::PageExtensions
|
|
2
2
|
def self.included(base)
|
3
3
|
base.class_eval do
|
4
4
|
after_save :create_children
|
5
|
-
|
5
|
+
|
6
6
|
def self.new_with_children_config(config = Radiant::Config, parts = String)
|
7
7
|
begin
|
8
8
|
unless parts.empty?
|
@@ -21,9 +21,9 @@ module ChildrenConfig::PageExtensions
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
if config.select{|c| c.has_key? "layout"}.size > 0
|
24
|
-
|
25
|
-
|
26
|
-
|
24
|
+
page.layout = Layout.find_by_name(
|
25
|
+
config.select{|c| c.has_key? "layout"}.first["layout"]
|
26
|
+
)
|
27
27
|
end
|
28
28
|
page
|
29
29
|
end
|
@@ -34,10 +34,10 @@ module ChildrenConfig::PageExtensions
|
|
34
34
|
new_with_defaults(config)
|
35
35
|
end
|
36
36
|
end
|
37
|
-
|
37
|
+
|
38
38
|
end
|
39
39
|
end
|
40
|
-
|
40
|
+
|
41
41
|
def create_children
|
42
42
|
if updated_at == created_at and parent and children_config = parent.part(:children_config).try(:content)
|
43
43
|
config = YAML::load(children_config)
|
@@ -67,11 +67,11 @@ module ChildrenConfig::PageExtensions
|
|
67
67
|
raise page.errors.full_messages.join ", " unless page.valid?
|
68
68
|
page.save
|
69
69
|
end
|
70
|
-
|
70
|
+
|
71
71
|
end
|
72
72
|
end
|
73
73
|
end
|
74
|
-
|
74
|
+
|
75
75
|
def parts_from_config(config)
|
76
76
|
result, options = [], {}
|
77
77
|
config.select{|c| c.has_key? "parts"}.first["parts"].each do |part|
|
@@ -87,5 +87,5 @@ module ChildrenConfig::PageExtensions
|
|
87
87
|
end
|
88
88
|
result
|
89
89
|
end
|
90
|
-
|
91
|
-
end
|
90
|
+
|
91
|
+
end
|
@@ -1,3 +1,3 @@
|
|
1
1
|
module RadiantChildrenConfigExtension
|
2
|
-
VERSION = '1.1.
|
3
|
-
end
|
2
|
+
VERSION = '1.1.3'
|
3
|
+
end
|
metadata
CHANGED
@@ -1,28 +1,24 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: radiant-children_config-extension
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
version: 1.1.2
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.3
|
6
5
|
platform: ruby
|
7
|
-
authors:
|
6
|
+
authors:
|
8
7
|
- Benny Degezelle
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
|
13
|
-
date: 2012-10-22 00:00:00 Z
|
11
|
+
date: 2022-12-07 00:00:00.000000000 Z
|
14
12
|
dependencies: []
|
15
|
-
|
16
13
|
description: Allows you to define new defaults on a page per page basis.
|
17
|
-
email:
|
14
|
+
email:
|
18
15
|
- rubygems@monkeypatch.be
|
19
16
|
executables: []
|
20
|
-
|
21
17
|
extensions: []
|
22
|
-
|
23
18
|
extra_rdoc_files: []
|
24
|
-
|
25
|
-
|
19
|
+
files:
|
20
|
+
- README.md
|
21
|
+
- Rakefile
|
26
22
|
- children_config_extension.rb
|
27
23
|
- config/initializers/radiant_config.rb
|
28
24
|
- config/locales/en.yml
|
@@ -33,48 +29,42 @@ files:
|
|
33
29
|
- features/support/paths.rb
|
34
30
|
- lib/children_config/page_extensions.rb
|
35
31
|
- lib/children_config/pages_controller_extensions.rb
|
36
|
-
- lib/radiant-children_config-extension/version.rb
|
37
32
|
- lib/radiant-children_config-extension.rb
|
33
|
+
- lib/radiant-children_config-extension/version.rb
|
38
34
|
- lib/tasks/children_config_extension_tasks.rake
|
39
35
|
- radiant-children_config-extension.gemspec
|
40
|
-
- Rakefile
|
41
|
-
- README.md
|
42
36
|
- spec/controllers/admin/pages_controller_spec.rb
|
43
37
|
- spec/datasets/children_config_dataset.rb
|
44
38
|
- spec/spec.opts
|
45
39
|
- spec/spec_helper.rb
|
46
40
|
homepage: https://github.com/jomz/radiant-children_config-extension
|
47
41
|
licenses: []
|
48
|
-
|
49
|
-
post_install_message: "\n Add this to your radiant project by putting this line in
|
42
|
+
metadata: {}
|
43
|
+
post_install_message: "\n Add this to your radiant project by putting this line in
|
44
|
+
your Gemfile:\n gem \"radiant-children_config-extension\", \"~> 1.1.3\"\n "
|
50
45
|
rdoc_options: []
|
51
|
-
|
52
|
-
require_paths:
|
46
|
+
require_paths:
|
53
47
|
- lib
|
54
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
55
|
-
|
56
|
-
requirements:
|
48
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
49
|
+
requirements:
|
57
50
|
- - ">="
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
version:
|
60
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
|
-
|
62
|
-
requirements:
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '0'
|
53
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
63
55
|
- - ">="
|
64
|
-
- !ruby/object:Gem::Version
|
65
|
-
version:
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '0'
|
66
58
|
requirements: []
|
67
|
-
|
68
|
-
rubyforge_project:
|
69
|
-
rubygems_version: 1.8.24
|
59
|
+
rubygems_version: 3.1.6
|
70
60
|
signing_key:
|
71
|
-
specification_version:
|
61
|
+
specification_version: 4
|
72
62
|
summary: Children Config extension for Radiant CMS
|
73
|
-
test_files:
|
63
|
+
test_files:
|
74
64
|
- spec/controllers/admin/pages_controller_spec.rb
|
65
|
+
- spec/spec_helper.rb
|
75
66
|
- spec/datasets/children_config_dataset.rb
|
76
67
|
- spec/spec.opts
|
77
|
-
- spec/spec_helper.rb
|
78
68
|
- features/admin/children_config.feature
|
79
69
|
- features/support/env.rb
|
80
70
|
- features/support/paths.rb
|