<%= alchemy_form_for([:admin, node]) do |f| %> <% if node.root? %> <% if Alchemy::Node.respond_to? :available_menu_names %> <%= f.input :name, collection: Alchemy::Node.available_menu_names.map { |n| [I18n.t(n, scope: [:alchemy, :menu_names]), n] }, include_blank: false, input_html: {class: 'alchemy_selectbox'} %> <% else %> <%= f.input :name, input_html: { autofocus: true, value: node.page && node.read_attribute(:name).blank? ? nil : node.name, placeholder: node.page ? node.page.name : nil } %> <% end %> <% else %> <%= f.input :name, as: :string, input_html: { autofocus: true, value: node.page && node.read_attribute(:name).blank? ? nil : node.name, placeholder: node.page ? node.page.name : nil } %> <% active_klass = (node.errors.keys.include? :custom_model_klass or node.custom_model?) ? "ui-tabs-active" : "" %>
<%= f.input :custom_model_klass, input_html: {class: 'alchemy_selectbox'} %> <%= f.input :custom_model_method, input_html: {class: 'alchemy_selectbox'} %>
<%= f.input :page_id, label: Alchemy::Page.model_name.human, input_html: {class: 'alchemy_selectbox'} %> <%= f.input :url, input_html: {disabled: node.page}, hint: Alchemy.t(:node_url_hint) %> <%= f.input :title %> <%= f.input :nofollow %> <%= f.input :external %> <%= f.hidden_field :parent_id %>
<% end %> <% if node.respond_to? :site_id %> <%= f.hidden_field :site_id %> <% end %> <% if node.respond_to? :language_id %> <%= f.hidden_field :language_id %> <% end %> <%= f.submit button_label %> <% end %>