Sha256: 6bc5b9ff3caad0703d01d360b0b542cf2800fb6b69b91e6d5f6dbf72a2805acb

Contents?: true

Size: 1.51 KB

Versions: 1

Compression:

Stored size: 1.51 KB

Contents

= simple_form_for(menu, (EffectivePages.simple_form_options || {}).merge(:url => (menu.persisted? ? effective_pages.admin_menu_path(menu) : effective_pages.admin_menus_path))) do |f|
  = f.input :title, :hint => "Give this menu a title"

  - if defined?(EffectiveRoles)
    %h2 Menu Item Visibility

    %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)

  .form-group
    .col-xs-12
      .form-group
        .pull-right
          = f.button :submit, 'Save', data: { disable_with: 'Saving...' }
          = link_to 'Cancel', effective_pages.admin_menus_path

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
effective_pages-1.1.0 app/views/admin/menus/_form.html.haml