Sha256: 027c4a475cab84a07e29c750b072659ecd79a5f094cb57a840c7bfa47ba9cdf9

Contents?: true

Size: 1.43 KB

Versions: 16

Compression:

Stored size: 1.43 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"

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

16 entries across 16 versions & 1 rubygems

Version Path
effective_pages-1.0.14 app/views/admin/menus/_form.html.haml
effective_pages-1.0.13 app/views/admin/menus/_form.html.haml
effective_pages-1.0.12 app/views/admin/menus/_form.html.haml
effective_pages-1.0.11 app/views/admin/menus/_form.html.haml
effective_pages-1.0.10 app/views/admin/menus/_form.html.haml
effective_pages-1.0.9 app/views/admin/menus/_form.html.haml
effective_pages-1.0.8 app/views/admin/menus/_form.html.haml
effective_pages-1.0.7 app/views/admin/menus/_form.html.haml
effective_pages-1.0.6 app/views/admin/menus/_form.html.haml
effective_pages-1.0.5 app/views/admin/menus/_form.html.haml
effective_pages-1.0.4 app/views/admin/menus/_form.html.haml
effective_pages-1.0.3 app/views/admin/menus/_form.html.haml
effective_pages-1.0.2 app/views/admin/menus/_form.html.haml
effective_pages-1.0.1 app/views/admin/menus/_form.html.haml
effective_pages-1.0.0 app/views/admin/menus/_form.html.haml
effective_pages-0.9.9 app/views/admin/menus/_form.html.haml