Sha256: 1e59912bb896549c54754e45f1909e783d9bad774fb8a6c85c28c4a25e11ff10

Contents?: true

Size: 1.36 KB

Versions: 8

Compression:

Stored size: 1.36 KB

Contents

<% if Alchemy::Node.roots.where(language: @page.language).any? %>
  <% unless @page.language_root %>
    <%= page_status_checkbox(@page, :visible, label: Alchemy.t("show in url of child pages")) %>
  <% end %>
  <% if @page.menus.any? %>
    <label style="vertical-align: middle">
      <%= Alchemy.t(:attached_to) %>
    </label>
    <% @page.menus.each do |menu| %>
      <span class="page-menu-name label">
        <%= I18n.t(menu.name, scope: [:alchemy, :menu_names]) %>
      </span>
    <% end %>
  <% else %>
    <a class="button small" id="attach-page"><%= Alchemy.t("attach to a menu") %></a>
    <%= f.input :menu_id, collection: Alchemy::Node.roots.map { |n|
        [I18n.t(n.name, scope: [:alchemy, :menu_names]), n.id]
      },
      prompt: Alchemy.t("Please choose a menu"),
      input_html: { class: "alchemy_selectbox" },
      wrapper_html: { class: "hidden" },
      label: false %>
    <script>
      (function() {
        var wrapper = document.querySelector(".input.page_menu_id")
        document.querySelector("#attach-page").addEventListener("click", function() {
          var select = wrapper.querySelector("select")
          this.classList.toggle("active")
          wrapper.classList.toggle("hidden")
          $(select).select2("val", "")
        })
      })()
    </script>
  <% end %>
<% else %>
  <%= page_status_checkbox(@page, :visible) %>
<% end %>

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
alchemy_cms-4.6.7 app/views/alchemy/admin/pages/_menu_fields.html.erb
alchemy_cms-4.6.6 app/views/alchemy/admin/pages/_menu_fields.html.erb
alchemy_cms-4.6.5 app/views/alchemy/admin/pages/_menu_fields.html.erb
alchemy_cms-4.6.4 app/views/alchemy/admin/pages/_menu_fields.html.erb
alchemy_cms-4.6.3 app/views/alchemy/admin/pages/_menu_fields.html.erb
alchemy_cms-4.6.2 app/views/alchemy/admin/pages/_menu_fields.html.erb
alchemy_cms-4.6.1 app/views/alchemy/admin/pages/_menu_fields.html.erb
alchemy_cms-4.6.0 app/views/alchemy/admin/pages/_menu_fields.html.erb