radiant-navigation_tags-extension 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
@@ -24,7 +24,7 @@ module NavigationTags
24
24
  tag "nav" do |tag|
25
25
  if tag.double?
26
26
  root = Page.find_by_path(tag.expand)
27
- elsif defined?(Globalize2Extension) && Globalize2Extension.locales.size > 1
27
+ elsif defined?(Globalize2Extension) && Globalize2Extension.locales.size <= 1
28
28
  root = Page.find_by_path(root_url = tag.attr.delete('root') || "/#{I18n.locale}")
29
29
  else
30
30
  root = Page.find_by_path(root_url = tag.attr.delete('root') || "/")
@@ -77,21 +77,21 @@ module NavigationTags
77
77
  tag "sub-nav" do |tag|
78
78
  current_page = tag.locals.page
79
79
  child_page = tag.attr[:page]
80
- @depth ||= tag.attr.delete(:depth)
80
+ depth = tag.attr.delete(:depth)
81
81
  @first_set ||= tag.attr.delete(:first_set)
82
- return if @depth < 0 or child_page.virtual? or !child_page.published? or child_page.class_name.eql? "FileNotFoundPage" or child_page.part("no-map")
82
+ return if depth.to_i < 0 or child_page.virtual? or !child_page.published? or child_page.class_name.eql? "FileNotFoundPage" or child_page.part("no-map")
83
83
 
84
84
  r = %{<li#{li_attrs_for_current_page_vs_navigation_item(current_page, child_page)}>
85
85
  #{link_for_page(child_page)}\n}
86
86
  # mind the open li
87
87
  rr = ""
88
88
  if child_page.children.size > 0 and
89
- @depth.to_i > 0 and
89
+ depth.to_i > 0 and
90
90
  child_page.class_name != 'ArchivePage' and
91
91
  (@expand_all || current_page.url.starts_with?(child_page.url) )
92
92
  @first_set = false
93
93
  child_page.children.each do |child|
94
- rr << tag.render('sub-nav', :page => child, :depth => @depth.to_i - 1, :first_set => @first_set ) unless child.part("no-map") || !child.published?
94
+ rr << tag.render('sub-nav', :page => child, :depth => depth.to_i - 1, :first_set => @first_set ) unless child.part("no-map") || !child.published?
95
95
  end
96
96
 
97
97
  r << "<ul>\n" + rr + "</ul>\n" unless rr.empty?
@@ -1,5 +1,5 @@
1
1
  class NavigationTagsExtension < Radiant::Extension
2
- version "2.1"
2
+ version "2.2"
3
3
  description "Makes building navigations much easier."
4
4
  url "https://github.com/jomz/navigation_tags"
5
5
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: radiant-navigation_tags-extension
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 1
10
- version: 0.2.1
9
+ - 2
10
+ version: 0.2.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Benny Degezelle
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-29 00:00:00 +02:00
18
+ date: 2011-04-15 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency