Module: LotusAdmin::SidebarHelpers

Defined in:
app/helpers/lotus_admin/sidebar_helpers.rb

Instance Method Summary collapse

Instance Method Details

#class_for_menu(identifier) ⇒ Object



15
16
17
# File 'app/helpers/lotus_admin/sidebar_helpers.rb', line 15

def class_for_menu(identifier)
  return 'active' if menu_identifier.to_s == identifier.to_s
end

#class_for_parent_menu_item(identifier) ⇒ Object



19
20
21
22
23
# File 'app/helpers/lotus_admin/sidebar_helpers.rb', line 19

def class_for_parent_menu_item(identifier)
  return 'sub-menu active toggled' if parent_menu_identifier == identifier

  'sub-menu'
end


3
4
5
# File 'app/helpers/lotus_admin/sidebar_helpers.rb', line 3

def sidebar_item(identifier, &block)
  (:li, class: class_for_menu(identifier), &block)
end


7
8
9
10
11
12
13
# File 'app/helpers/lotus_admin/sidebar_helpers.rb', line 7

def sidebar_parent_item(identifier, icon, name, &block)
  (:li, class: class_for_parent_menu_item(identifier)) do
    link_to('#', data: { ma_action: 'submenu-toggle' }) do
      (:i, nil, class: "zmdi zmdi-#{ icon }") + name
    end + capture_haml(&block)
  end
end