Module: Trestle::NavigationHelper
- Defined in:
- app/helpers/trestle/navigation_helper.rb
Instance Method Summary collapse
- #current_admin?(admin) ⇒ Boolean
- #current_navigation_item?(item) ⇒ Boolean
- #navigation_group_collapsed?(group) ⇒ Boolean
Instance Method Details
#current_admin?(admin) ⇒ Boolean
7 8 9 10 11 |
# File 'app/helpers/trestle/navigation_helper.rb', line 7 def current_admin?(admin) respond_to?(:admin) && self.admin.respond_to?(:name) && self.admin.name == admin.name end |
#current_navigation_item?(item) ⇒ Boolean
3 4 5 |
# File 'app/helpers/trestle/navigation_helper.rb', line 3 def (item) current_page?(item.path) || (item.admin && current_admin?(item.admin)) end |
#navigation_group_collapsed?(group) ⇒ Boolean
13 14 15 16 17 18 19 20 21 |
# File 'app/helpers/trestle/navigation_helper.rb', line 13 def (group) if .include?(group.id) # Explicitly collapsed by user true elsif group.collapse? # Default to collapsed unless expanded by user !.include?(group.id) end end |