radiant-layouts-extension 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -86,41 +86,28 @@ This would render the following if Page Layout was called
86
86
 
87
87
  ### Introduction
88
88
 
89
- Write your layouts and radius tags in haml, with support for nested layouts
89
+ Write your layouts and radius tags in haml, with support for nested layouts and radius attributes
90
90
 
91
- // Parent Layout
92
- %div{:id=>"parent"}
91
+ // Parent Layout - with content/type set as 'haml'
92
+ %div{:id=>"parent",:title=>"<r:title />"}
93
93
  %r:content_for_layout
94
94
 
95
- // Child Layout
95
+ // Child Layout - with content/type set as 'haml'
96
96
  %r:inside_layout{:name=>"Parent"}
97
97
  %h2
98
98
  %:title
99
+
100
+ <div id="parent" title="some title">
101
+ <h2>
102
+ some title
103
+ </h2>
104
+ </div>
99
105
 
100
- Note: Within Layouts you must set the name to end in `.haml`
101
-
102
- Integrates the work of [SaturnFlyer](http://github.com/saturnflyer) creating a haml_filter on pages and snippets. Additional task involved
106
+ Integrates the work of [SaturnFlyer](http://github.com/saturnflyer) creating a haml_filter on pages and snippets. Additional task involved.
107
+
103
108
  changing the order which objects with this type are renders. The content is turned into html before the
104
109
  radius tags are passed.
105
110
 
106
- ### Caveats
107
-
108
- You can't yet put a radiant tag inside an attribute of a haml element. ie:
109
-
110
- %div.product{:id=>"<r:id />"} // Will not work
111
-
112
- %div.product{:id=>"%r:id"} // Will not work
113
-
114
- %div.product{:id=><r:id />} // Will not work
115
-
116
- In the mean time use a plain filter whilst we come up with something awesome
117
-
118
- %body
119
- #primary
120
- :plain
121
- <div id="<r:id />" class="product">
122
- <r:snippet name='product' />
123
-
124
111
  ### Acknowledgments
125
112
 
126
113
  * [SaturnFlyer](http://github.com/saturnflyer) [@SaturnFlyer](http://twitter.com/saturnflyer) (Jim Gay) | Original idea http://github.com/saturnflyer/radiant-haml_filter-extension
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.1.1
@@ -8,7 +8,8 @@ module HamlLayouts
8
8
  # Will render html from haml if necessary
9
9
  def rendered_content
10
10
  if is_haml?
11
- Haml::Engine.new(content).render
11
+ # The gsub will replace all escaped radius tags with html
12
+ Haml::Engine.new(content).render.gsub(/&lt;(\/)?r:(.+?)\s*(\/|\\)*&gt;/m,"<\\1r:\\2\\3>")
12
13
  else
13
14
  content
14
15
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{radiant-layouts-extension}
8
- s.version = "1.1.0"
8
+ s.version = "1.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Michael Klett", "Jim Gay", "William Ross", "Tony Issakov", "Dirk Kelly"]
12
- s.date = %q{2010-11-26}
12
+ s.date = %q{2010-12-01}
13
13
  s.description = %q{Extends Radiant Layouts to support nesting, sharing with Rails Controllers and rendering HAML}
14
14
  s.email = %q{dk@dirkkelly.com}
15
15
  s.extra_rdoc_files = [
@@ -19,7 +19,7 @@ CONTENT
19
19
  :name => 'child',
20
20
  :content => <<-CONTENT
21
21
  <r:inside_layout name='parent'>
22
- <h1><r:layout /></h1>
22
+ <h1><r:layout/></h1>
23
23
  </r:inside_layout>
24
24
  CONTENT
25
25
 
@@ -28,7 +28,7 @@ CONTENT
28
28
  :content_type => 'haml',
29
29
  :content => <<-CONTENT
30
30
  %r:inside_layout{:name=>"parent"}
31
- %h1
31
+ %h1{:id=>"<r:layout />",:'data-layout'=>"<r:find url='find'><r:layout/></r:find>"}
32
32
  %r:layout
33
33
  CONTENT
34
34
  end
@@ -9,12 +9,12 @@ describe HamlLayouts::Models::Layout do
9
9
  it 'should return html rendered' do
10
10
  expected = <<-CONTENT
11
11
  <r:inside_layout name='parent'>
12
- <h1>
12
+ <h1 data-layout="<r:find url='find'><r:layout/></r:find>" id='<r:layout/>'>
13
13
  <r:layout></r:layout>
14
14
  </h1>
15
15
  </r:inside_layout>
16
16
  CONTENT
17
- layouts(:haml).content.should === expected
17
+ layouts(:haml).rendered_content.should === expected
18
18
  end
19
19
  end
20
20
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: radiant-layouts-extension
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 0
10
- version: 1.1.0
9
+ - 1
10
+ version: 1.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Michael Klett
@@ -19,7 +19,7 @@ autorequire:
19
19
  bindir: bin
20
20
  cert_chain: []
21
21
 
22
- date: 2010-11-26 00:00:00 +08:00
22
+ date: 2010-12-01 00:00:00 +08:00
23
23
  default_executable:
24
24
  dependencies:
25
25
  - !ruby/object:Gem::Dependency