Sha256: e9c80cb6e31a6f5cfabf4345d815c5da28b606e027a90bc322bf4d3e9c8bb1e5
Contents?: true
Size: 756 Bytes
Versions: 61
Compression:
Stored size: 756 Bytes
Contents
module ExpressAdmin # renders a sidebar partial if one is available # otherwise uses menu.yml class ModuleSidebar < ExpressTemplates::Components::Base tag :section contains -> { ul(class: 'menu-items') { li(class: 'title') { current_menu_name } menu_list(helpers.current_menu.items) } } def build(*args, &block) begin render("shared/#{helpers.current_module_path_name}/sidebar") rescue Exception => e super(*args, &block) end end def menu_list(list) list.each do |item| menu_list_item(item) end end def menu_list_item(item) li { link_to item.title.html_safe, helpers.instance_eval(item.path) } end end end
Version data entries
61 entries across 61 versions & 1 rubygems