app/views/spotlight/pages/_form.html.erb in blacklight-spotlight-0.1.0 vs app/views/spotlight/pages/_form.html.erb in blacklight-spotlight-0.2.0
- old
+ new
@@ -3,13 +3,15 @@
:'form-observer' => true,
:'attachment-endpoint' => spotlight.exhibit_attachments_url(@page.exhibit),
:'metadata-url' => spotlight.exhibit_metadata_path(@page.exhibit, format: "json"),
:'autocomplete-url'=> spotlight.autocomplete_exhibit_catalog_index_path(@page.exhibit, format: "json"),
:'searches-endpoint' => spotlight.exhibit_searches_path(@page.exhibit, format: "json"),
- :'available-configurations-endpoint' => spotlight.exhibit_available_configurations_path(@page.exhibit, format: "json")
+ :'available-configurations-endpoint' => spotlight.exhibit_available_configurations_path(@page.exhibit, format: "json"),
+ :'preview-url' => spotlight.exhibit_preview_block_url(@page.exhibit)
}
}) do |f| %>
+ <%= render @page.lock if @page.lock and not @page.lock.stale? and not @page.lock.current_session? %>
<% if @page.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@page.errors.count, "error") %> prohibited this page from being saved:</h2>
<ul>
@@ -33,15 +35,15 @@
<%= f.label :title, class: 'sr-only' %>
<%= f.text_field :title, class: 'form-control input-lg', placeholder: t(:'.title_placeholder') %>
</div>
<div class="form-group">
<%= f.label :content, class: 'sr-only' %>
- <%= f.sir_trevor_text_area :content %>
+ <%= f.text_area :content, class: 'js-st-instance' %>
</div>
<div class="form-actions">
<div class="primary-actions">
- <%= link_to(t('cancel'), :back, class: "btn btn-link") %>
+ <%= 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' %>
</div>
</div>
<% end %>