Module: Trestle::NavigationHelper
- Defined in:
- app/helpers/trestle/navigation_helper.rb
Overview
- Internal
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
8 9 10 11 12 |
# File 'app/helpers/trestle/navigation_helper.rb', line 8 def current_admin?(admin) respond_to?(:admin) && self.admin.respond_to?(:name) && self.admin.name == admin.name end |
#current_navigation_item?(item) ⇒ Boolean
4 5 6 |
# File 'app/helpers/trestle/navigation_helper.rb', line 4 def (item) current_page?(item.path) || (item.admin && current_admin?(item.admin)) end |
#navigation_group_collapsed?(group) ⇒ Boolean
14 15 16 17 18 19 20 21 22 |
# File 'app/helpers/trestle/navigation_helper.rb', line 14 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 |