Importer: <%= @importer.name %>

<% if @importer.parser_klass == 'Bulkrax::CsvParser' && @work_entries.map(&:failed?).any? %>
<%= link_to 'Export Errored Entries', importer_export_errors_path(@importer.id), class: 'btn btn-primary' %> <%= link_to 'Upload Corrected Entries', importer_upload_corrected_entries_path(@importer.id), class: 'btn btn-primary' %>
<% end %>

<%= t('bulkrax.importer.labels.name') %>: <%= @importer.name %>

<% if defined?(::Hyrax) %>

<%= t('bulkrax.importer.labels.admin_set') %>: <%= @importer.admin_set_id %>

<% end %>

<%= t('bulkrax.importer.labels.user') %>: <%= @importer.user %>

<%= t('bulkrax.importer.labels.frequency') %>: <%= @importer.frequency %>

<%= t('bulkrax.importer.labels.parser_klass') %>: <%= @importer.parser_klass %>

<%= t('bulkrax.importer.labels.limit') %>: <%= @importer.limit %>

<%= render partial: 'bulkrax/shared/bulkrax_errors', locals: {item: @importer} %>
<% @importer.parser_fields.each do |key,value| %> <%= key %>: <%= value %>
<% end %>
<%= render partial: 'bulkrax/shared/bulkrax_field_mapping', locals: {item: @importer} %>

<%= t('bulkrax.importer.labels.total_work_entries') %>: <%= @importer.last_run&.total_work_entries %>

<%= t('bulkrax.importer.labels.total_collections') %>: <%= @importer.last_run&.total_collection_entries %>

<%= t('bulkrax.importer.labels.total_file_sets') %>: <%= @importer.last_run&.total_file_set_entries %>

<%= render partial: 'bulkrax/shared/work_entries_tab', locals: { item: @importer, entries: @work_entries } %> <%= render partial: 'bulkrax/shared/collection_entries_tab', locals: { item: @importer, entries: @collection_entries } %> <%= render partial: 'bulkrax/shared/file_set_entries_tab', locals: { item: @importer, entries: @file_set_entries } %>

<%= link_to 'Edit', edit_importer_path(@importer) %> | <%= link_to 'Back', importers_path %>

<% if @importer.validate_only == true %>
<%= button_to 'Continue', importer_continue_path(@importer), method: :put, class: 'btn btn-primary' %>
<%= button_to 'Discard', @importer, method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-primary' %>
<% end %>