<%= bootstrap_form_for([current_exhibit, @resource.becomes(Spotlight::Resources::Upload)], layout: :horizontal, label_col: 'col-md-2', control_col: 'col-sm-6 col-md-6', html: { class: 'item-upload-form', multipart: true } ) do |f| %> <%= f.url_field :url, type: "file", help: t('.url-field.help', extensions: Spotlight::Engine.config.allowed_upload_extensions.join(' ')), label: "File" %> <%= f.fields_for :data do |d| %> <% Spotlight::Resources::Upload.fields(current_exhibit).each do |field, config| %> <%= d.send((config.form_field_type || :text_field), field) %> <% end %> <% current_exhibit.custom_fields.each do |custom_field| %> <%= d.text_field custom_field.field, label: custom_field.label %> <% end %> <% end %>
<%= cancel_link @resource, :back, class: 'btn btn-default' %> <%= f.submit t('.add_item_and_continue'), name: 'add-and-continue', class: 'btn btn-default' %> <%= f.submit t('.add_item'), class: 'btn btn-primary' %>
<% end %>