Class: AmaLayout::Agent::NavigationDecorator

Inherits:
Object
  • Object
show all
Includes:
DraperReplacement
Defined in:
lib/ama_layout/decorators/agent/navigation_decorator.rb

Instance Method Summary collapse

Instance Method Details

#cash_drawer_nameObject



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_textObject



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

#itemsObject



8
9
10
# File 'lib/ama_layout/decorators/agent/navigation_decorator.rb', line 8

def items
  object.items.map(&:decorate)
end


28
29
30
31
32
# File 'lib/ama_layout/decorators/agent/navigation_decorator.rb', line 28

def sidebar
  return '' unless user

  h.render partial: ('sidebar'), locals: { navigation: self }
end


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_navObject



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