radiant-featured_pages-extension 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
data/lib/featured_pages_tags.rb
CHANGED
@@ -120,6 +120,8 @@ module FeaturedPagesTags
|
|
120
120
|
<pre><code><r:if_featured>...</r:if_featured></code></pre>
|
121
121
|
}
|
122
122
|
tag 'if_featured' do |tag|
|
123
|
+
return '' if tag.locals.page.featured_date.blank?
|
124
|
+
|
123
125
|
date = tag.attr["date"] || nil
|
124
126
|
latest = tag.attr['latest'] || false
|
125
127
|
|
@@ -161,6 +163,8 @@ module FeaturedPagesTags
|
|
161
163
|
<pre><code><r:unless_featured>...</r:unless_featured></code></pre>
|
162
164
|
}
|
163
165
|
tag 'unless_featured' do |tag|
|
166
|
+
return tag.expand unless tag.locals.page.featured_date.present?
|
167
|
+
|
164
168
|
date = tag.attr["date"] || nil
|
165
169
|
latest = tag.attr['latest'] || false
|
166
170
|
|
@@ -94,6 +94,10 @@ describe Page do
|
|
94
94
|
page.featured_date = nil
|
95
95
|
page.should render('<r:if_featured>YES!</r:if_featured>').as('')
|
96
96
|
end
|
97
|
+
it 'should ignore any arguments for a non-featured page' do
|
98
|
+
page.featured_date = nil
|
99
|
+
page.should render('<r:if_featured latest="true">YES!</r:if_featured>').as('')
|
100
|
+
end
|
97
101
|
context 'with saved featured pages' do
|
98
102
|
before do
|
99
103
|
save_pages
|
@@ -141,10 +145,14 @@ describe Page do
|
|
141
145
|
it "should not expand contents for a page with a featured date" do
|
142
146
|
page.should render('<r:unless_featured>YES!</r:unless_featured>').as('')
|
143
147
|
end
|
144
|
-
it 'should
|
148
|
+
it 'should render for a non-featured page' do
|
145
149
|
page.featured_date = nil
|
146
150
|
page.should render('<r:unless_featured>YES!</r:unless_featured>').as('YES!')
|
147
151
|
end
|
152
|
+
it 'should ignore any arguments for a non-featured page' do
|
153
|
+
page.featured_date = nil
|
154
|
+
page.should render('<r:unless_featured latest="true">YES!</r:unless_featured>').as('YES!')
|
155
|
+
end
|
148
156
|
context 'with saved featured pages' do
|
149
157
|
before do
|
150
158
|
save_pages
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: radiant-featured_pages-extension
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 2.0.
|
9
|
+
- 3
|
10
|
+
version: 2.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jim Gay
|
@@ -60,7 +60,7 @@ has_rdoc: true
|
|
60
60
|
homepage: http://github.com/saturnflyer/radiant-featured_pages-extension
|
61
61
|
licenses: []
|
62
62
|
|
63
|
-
post_install_message: "\n Add this to your radiant project with:\n config.gem 'radiant-featured_pages-extension', :version => '2.0.
|
63
|
+
post_install_message: "\n Add this to your radiant project with:\n config.gem 'radiant-featured_pages-extension', :version => '2.0.3'\n "
|
64
64
|
rdoc_options: []
|
65
65
|
|
66
66
|
require_paths:
|