<% # TODO: the "if @page.persisted?" business below could possibly be done w/ some clever polymorphic routing. # Leaving as-is for now since technically you can't get to the new page form anyway. %> <%= bootstrap_form_for([spotlight, @page.exhibit, @page], role: 'form', html: { data: configurations_for_current_page.merge('form-observer': true)}) do |f| %> <%= render @page.lock if @page.lock and not @page.lock.stale? and not @page.lock.current_session? %> <% if @page.errors.any? %>

<%= pluralize(@page.errors.count, "error") %> prohibited this page from being saved:

<% end %>
<%= f.label :title, class: 'sr-only' %> <%= f.text_field_without_bootstrap :title, class: 'form-control input-lg', placeholder: t(:'.title_placeholder') %>
<%= f.label :content, class: 'sr-only' %> <%= f.text_area_without_bootstrap :content, value: { data: f.object.content.as_json }.to_json, class: content_editor_class(f.object), data: { 'block-types': Spotlight::Engine.config.sir_trevor_widgets } %>
<%= render "page_options", f: f %>
<% if @page.respond_to? :thumbnail %>
<%= f.fields_for :thumbnail, (@page.thumbnail || @page.build_thumbnail) do |m| %>

<%= t(:'.thumbnail.help') %>

<%= render '/spotlight/featured_images/form', f: m, initial_crop_selection: Spotlight::Engine.config.featured_image_thumb_size, crop_type: :thumbnail %> <% end %>
<% end %>
<%= link_to(t('cancel'), :back, class: "btn btn-link", data: (@page.lock && @page.lock.current_session? ? { lock: url_for([spotlight, @page.exhibit, @page.lock]) } : {})) %> <%= f.submit class: 'btn btn-primary' %>
<% end %>