<%= render_breadcrumbs builder: Sufia::BootstrapBreadcrumbsBuilder %>

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

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

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

Descriptions:

<% @terms.each do |term| %>
<%= simple_form_for @generic_file, url: batch_edits_path, method: :put, remote: true, builder: Sufia::FormBuilder, html: { id: "form_#{term.to_s}", class: "ajax-form"} 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) %>
<%= f.submit "Save changes", class: 'btn btn-primary field-save updates-batches' , id: "#{term.to_s}_save" %> Cancel
<% end %>
<% end %>
<%= form_for @generic_file, url: batch_edits_path, method: :put, remote: true, html: { id: "form_permissions", class: "ajax-form"} do |f| %> <%= hidden_field_tag('update_type', 'update') %> <%= hidden_field_tag('key', 'permissions') %> <%= render "generic_files/permission_form", f: f %>
<%= f.submit "Save changes", class: 'btn btn-primary updates-batches', id: 'permissions_save' %>
<% end %>
<%= button_to "Clear Batch", { controller: :batch_edits, action: :clear }, form_class: 'hidden', remote: true, id: 'clear_batch' %>