Class: AmaLayout::Agent::NavigationDecorator
- Inherits:
-
Object
- Object
- AmaLayout::Agent::NavigationDecorator
- Includes:
- DraperReplacement
- Defined in:
- lib/ama_layout/decorators/agent/navigation_decorator.rb
Instance Method Summary collapse
- #cash_drawer_name ⇒ Object
- #display_name_text ⇒ Object
- #items ⇒ Object
- #sidebar ⇒ Object
- #sign_out_link ⇒ Object
- #top_nav ⇒ Object
Instance Method Details
#cash_drawer_name ⇒ Object
34 35 36 |
# File 'lib/ama_layout/decorators/agent/navigation_decorator.rb', line 34 def cash_drawer_name user.cash_drawers.any? ? " - #{user.cash_drawers.last.name}" : '' end |
#display_name_text ⇒ Object
12 13 14 |
# File 'lib/ama_layout/decorators/agent/navigation_decorator.rb', line 12 def display_name_text "Welcome, #{display_name.titleize}#{cash_drawer_name}" end |
#items ⇒ Object
8 9 10 |
# File 'lib/ama_layout/decorators/agent/navigation_decorator.rb', line 8 def items object.items.map(&:decorate) end |
#sidebar ⇒ Object
28 29 30 31 32 |
# File 'lib/ama_layout/decorators/agent/navigation_decorator.rb', line 28 def return '' unless user h.render partial: ('sidebar'), locals: { navigation: self } end |
#sign_out_link ⇒ Object
16 17 18 19 20 |
# File 'lib/ama_layout/decorators/agent/navigation_decorator.rb', line 16 def sign_out_link return '' unless user h.render partial: ama_layout_partial('sign_out_link') end |
#top_nav ⇒ Object
22 23 24 25 26 |
# File 'lib/ama_layout/decorators/agent/navigation_decorator.rb', line 22 def top_nav return '' unless user h.render partial: ama_layout_partial('agent/top_nav'), locals: { navigation: self } end |