<%= render "form_javascripts" %> <% form_class = headless_mode? ? 'form-vertical' : 'form-horizontal' %> <% resource_options = options.delete(@resource.model_name.param_key) %> <%= form_for @item, :url => options, :html => { :multipart => true, :class => form_class } do |form| %> <%= render "helpers/admin/resources/errors" %>
<% if resource_options %> <%= hidden_field_tag("#{@resource.model_name.param_key}[#{resource_options.keys.first}]", resource_options.values.first) %> <% end %> <%= build_form(fields, form) %> <%= hidden_field_tag :resource_class, @item.class.model_name.name %> <% if headless_mode? %> <% unless @item.new_record? %> <%= hidden_field_tag "_id", @item.id %> <%= hidden_field_tag "_label", @item.to_label %> <% end %> <%= hidden_field_tag "_continue" %> <% else %>
<% build_save_options.each do |key, value, special| %> <% klass = key.eql?("_save") ? 'btn-primary' : 'btn' %> <% message = Typus::I18n.t(value) options = { :name => key, :onclick => "Typus.setConfirmUnload(false);", 'data-disable-with' => message, :class => "btn #{klass}" } %> <%= submit_tag message, options %> <% end %>
<% end %>
<% end %>