radiant-child_layout-extension 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/child_layout_extension.rb +5 -5
- data/lib/radiant-child_layout-extension.rb +2 -2
- metadata +4 -4
data/child_layout_extension.rb
CHANGED
@@ -14,18 +14,18 @@ class ChildLayoutExtension < Radiant::Extension
|
|
14
14
|
Page.class_eval do
|
15
15
|
|
16
16
|
belongs_to :set_layout, :class_name => 'Layout', :foreign_key => 'layout_id'
|
17
|
-
|
17
|
+
belongs_to :child_layout, :class_name => 'Layout', :foreign_key => "child_layout_id"
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
19
|
+
# Override layout to check for a passed child layout before inheriting the parent set layout
|
20
|
+
def layout
|
21
|
+
unless set_layout
|
22
22
|
if parent?
|
23
23
|
parent.child_layout ? parent.child_layout : parent.layout
|
24
24
|
end
|
25
25
|
else
|
26
26
|
set_layout
|
27
27
|
end
|
28
|
-
|
28
|
+
end
|
29
29
|
|
30
30
|
end
|
31
31
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module RadiantChildLayoutExtension
|
2
|
-
VERSION = "1.0.
|
2
|
+
VERSION = "1.0.1"
|
3
3
|
SUMMARY = "Child Layout for Radiant CMS"
|
4
4
|
DESCRIPTION = "Allows a page to specify a seperate layout for children to inherit, useful for landing pages to tell children to use a content layout"
|
5
|
-
URL = "https://github.com/
|
5
|
+
URL = "https://github.com/melchoy/radiant-child_layout-extension"
|
6
6
|
AUTHORS = ["Melissa Choy"]
|
7
7
|
EMAIL = ["mel@otilas.com.au"]
|
8
8
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: radiant-child_layout-extension
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-03-14 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Allows a page to specify a seperate layout for children to inherit, useful
|
15
15
|
for landing pages to tell children to use a content layout
|
@@ -35,7 +35,7 @@ files:
|
|
35
35
|
- README.md
|
36
36
|
- spec/spec.opts
|
37
37
|
- spec/spec_helper.rb
|
38
|
-
homepage: https://github.com/
|
38
|
+
homepage: https://github.com/melchoy/radiant-child_layout-extension
|
39
39
|
licenses: []
|
40
40
|
post_install_message:
|
41
41
|
rdoc_options: []
|
@@ -55,7 +55,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
55
55
|
version: '0'
|
56
56
|
requirements: []
|
57
57
|
rubyforge_project:
|
58
|
-
rubygems_version: 1.8.
|
58
|
+
rubygems_version: 1.8.23
|
59
59
|
signing_key:
|
60
60
|
specification_version: 3
|
61
61
|
summary: Child Layout for Radiant CMS
|