Sha256: 109fcdf294983d689bb6066243800c78dc8d685fb4ae014f5542a0d41ac720d8

Contents?: true

Size: 990 Bytes

Versions: 7

Compression:

Stored size: 990 Bytes

Contents

= effective_form_with(model: page, url: page.persisted? ? effective_pages.admin_page_path(page.id) : effective_pages.admin_pages_path) do |f|
  = f.check_box :menu, label: 'Yes, display this page on the menu'

  = f.show_if :menu, true do

    - if (menus = EffectivePages.menus).length > 1
      = f.select :menu_name, menus
    - else
      = f.hidden_field :menu_name, value: menus.first

    = f.check_box :menu_root_level, label: "This is a top level menu item. Do not show page content."

    = f.show_if :menu_root_level, true do
      = f.hidden_field :menu_parent_id, value: nil

    = f.show_if :menu_root_level, false do
      = f.select :menu_parent_id, Effective::Page.menuable.root_level.where.not(id: f.object), required: true

    = f.text_field :menu_title, hint: "Display this title on menus instead of full page title"

    = f.text_field :menu_url, label: "Redirect to path or url instead of displaying page",
      hint: "Must start with http(s):// or /"

  = f.submit

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
effective_pages-3.1.0 app/views/admin/pages/_form_menu.html.haml
effective_pages-3.0.10 app/views/admin/pages/_form_menu.html.haml
effective_pages-3.0.9 app/views/admin/pages/_form_menu.html.haml
effective_pages-3.0.8 app/views/admin/pages/_form_menu.html.haml
effective_pages-3.0.7 app/views/admin/pages/_form_menu.html.haml
effective_pages-3.0.6 app/views/admin/pages/_form_menu.html.haml
effective_pages-3.0.5 app/views/admin/pages/_form_menu.html.haml