%= 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" : "" %>