Batch Edit Descriptions    Click on labels below to edit work descriptions.

Changes will be applied to: (<%= @form.names.size %> works)

<%= @form.names.join(", ").html_safe %>

Descriptions:

<% @form.terms.each do |term| %>
<%= simple_form_for @form, url: hyrax.batch_edits_path, method: :put, remote: true, builder: Hyrax::FormBuilder, html: { id: "form_#{term.to_s}", class: "ajax-form" }, data: { model: @form.model_name.param_key } do |f| %>
<%= hidden_field_tag('update_type', 'update') %> <%= hidden_field_tag('key', term.to_s) %> <%# TODO we don't need to show required %> <%= render_edit_field_partial(term, f: f) %> <% @form.batch_document_ids.each do |batch_id| %> <%= hidden_field_tag "batch_document_ids[]", batch_id %> <% end %>
<%= f.submit "Save changes", class: 'btn btn-primary field-save', id: "#{term.to_s}_save" %> Cancel
<% end %>
<% end %>
<%= simple_form_for @form, url: hyrax.batch_edits_path, method: :put, remote: true, builder: Hyrax::FormBuilder, html: { id: "form_permissions_visibility", class: "ajax-form"}, data: { 'param-key' => @form.model_name.param_key } do |f| %>
<%= hidden_field_tag('update_type', 'update') %> <%= hidden_field_tag('key', 'permissions') %> <%= render "hyrax/base/form_permission", f: f %> <% @form.batch_document_ids.each do |batch_id| %> <%= hidden_field_tag "batch_document_ids[]", batch_id %> <% end %>
<%= f.submit "Save changes", class: 'btn btn-primary field-save', id: "permissions_visibility_save" %> Cancel
<% end %>
<%= simple_form_for @form, url: hyrax.batch_edits_path, method: :put, remote: true, builder: Hyrax::FormBuilder, html: { id: "form_permissions", class: "ajax-form"}, data: { 'param-key' => @form.model_name.param_key } do |f| %>
<%= hidden_field_tag('update_type', 'update') %> <%= hidden_field_tag('key', 'permissions') %> <%= render "hyrax/base/form_share", f: f %> <% @form.batch_document_ids.each do |batch_id| %> <%= hidden_field_tag "batch_document_ids[]", batch_id %> <% end %>
<%= f.submit "Save changes", class: 'btn btn-primary field-save', id: "permissions_sharing_save" %> Cancel
<% end %>
<%= button_to "Clear Batch", hyrax.clear_batch_edits_path, form_class: 'hidden', remote: true, id: 'clear_batch' %>