semantic_navigation 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/TODO +1 -0
- data/lib/semantic_navigation/helper_methods.rb +18 -5
- data/lib/semantic_navigation/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NjJkZDMyMDczZDgxODNiNDcyZGI3OWFhZGIwNzZiNjE4NjFmMDI3NQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NjZjZTlhZDU3MTE0MTZjMTlkMDc2MjljMjU2M2E1MGYwMmVjYWQwYw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZTVjYTY1ZGE1OTE0YmVkMjA3YzM0ZDVmNmNmYTY4ODQ2YjcxYmJjZjNlMjI5
|
10
|
+
ZTliNjFjZDEyODA0YTkzNDU5ZDQ3M2VlMjU0NWVlYWM3YjI3MDVmNDk3ZmY4
|
11
|
+
YWVkNTg5MmRiMzc3MWRmMjQ5NTcxZTQwZjU3MGQwOWIxNDZhYTE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZDE1MTRlY2M1ZjBiYjdjM2I0NGYwYzE1NGI0Nzg0NmNkNzk5ZjYzOGJjNzYx
|
14
|
+
MTUxOWI4OTg3MzE4MTdmYmU2ZGRlNGU0OGJkYmU1MGY0Mjg3ZTg1MWYxNTAw
|
15
|
+
Yjk3ZTJhOTJjMTQ3YzE0Nzg1ODE5MDY0NGQ5MDFiZWE1MmNlNmI=
|
data/TODO
CHANGED
@@ -7,6 +7,22 @@ module SemanticNavigation::HelperMethods
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def active_item_for(name, level = nil, &block)
|
10
|
+
item = _current_item(name, level)
|
11
|
+
if block_given?
|
12
|
+
capture(item, &block)
|
13
|
+
else
|
14
|
+
item != navigation ? item.name(:active_item_for) : ''
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def active_level_for(name)
|
19
|
+
item = _current_item(name, nil)
|
20
|
+
item.try(:level) || -1
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def _current_item(name, level)
|
10
26
|
SemanticNavigation::Configuration.view_object = self
|
11
27
|
navigation = SemanticNavigation::Configuration.navigation(name)
|
12
28
|
navigation.mark_active
|
@@ -16,10 +32,7 @@ module SemanticNavigation::HelperMethods
|
|
16
32
|
(!level.nil? ? item.level < level : true)
|
17
33
|
item = item.sub_elements.find{|e| e.active}
|
18
34
|
end
|
19
|
-
|
20
|
-
item != navigation ? item.name(:active_item_for) : ''
|
21
|
-
else
|
22
|
-
capture(item, &block)
|
23
|
-
end
|
35
|
+
item
|
24
36
|
end
|
37
|
+
|
25
38
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: semantic_navigation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergey Gribovski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|