%h1.effective-admin-heading= @page_title - if defined?(EffectiveRegions) .row.effective-admin-actions .col-sm-6 %p To edit the main menu, drag and drop items from the fullscreen editor. .col-sm-6 %p.text-right = link_to "Edit #{@menu}", effective_regions.edit_path('/'), class: 'btn btn-primary', 'data-no-turbolink': true, target: '_blank' - if defined?(EffectiveRoles) %h2 Menu Items - if @menu.menu_items.length > 1 %table.table %thead %th Menu Item %th.text-center Public %th.text-center Signed In - EffectiveRoles.roles.each do |role| %th.text-center= ":#{role}" %tbody - stack = [@menu.menu_items.first] - @menu.menu_items.each_with_index do |menu_item, index| - next if index == 0 - stack.pop while menu_item.rgt > stack.last.rgt if stack.size > 1 %tr %td = ("  " * (stack.size-1)).html_safe = (menu_item.divider? ? ':divider' : menu_item.title) %td.text-center= visible_badge(menu_item, stack, Proc.new { |item| item.roles_mask == nil || item.roles_mask == -1 }) %td.text-center= visible_badge(menu_item, stack, Proc.new { |item| item.roles_mask == nil || item.roles_mask == 0 }) - EffectiveRoles.roles.each do |role| %td.text-center= visible_badge(menu_item, stack, Proc.new { |item| item.visible_for?(role) }) - stack.push(menu_item) - else %p No menu items.