Importer: <%= @importer.name %>

<% if @importer.parser_klass == 'Bulkrax::CsvParser' && @work_entries.map { |e| e.status == '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 %>

Name: <%= @importer.name %>

Admin set: <%= @importer.admin_set_id %>

User: <%= @importer.user %>

Frequency: <%= @importer.frequency %>

Parser klass: <%= @importer.parser_klass %>

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} %>

Total Works: <%= @importer.last_run&.total_work_entries %>

Total Collections: <%= @importer.last_run&.total_collection_entries %>

Total File Sets: <%= @importer.last_run&.total_file_set_entries %>

<% @work_entries.each do |e| %> <% if e.status == "Complete" %> <% elsif e.status == "Pending" %> <% else %> <% end %> <% if e.last_error.present? %> <% else %> <% end %> <% end %>
Identifier Entry ID Status Errors Status Set At Actions
<%= link_to e.identifier, bulkrax.importer_entry_path(@importer.id, e.id) %> <%= e.id %> <%= e.status %> <%= e.status %> <%= e.status %><%= link_to e.last_error.dig("error_class"), bulkrax.importer_entry_path(@importer.id, e.id) %><%= e.status_at %> <%= link_to raw(''), bulkrax.importer_entry_path(@importer.id, e.id) %>
<%= page_entries_info(@work_entries) %>
<%= paginate(@work_entries, theme: 'blacklight', param_name: :work_entries_page, params: { anchor: 'work-entries'}) %>
<% @collection_entries.each do |e| %> <% if e.status == "Complete" %> <% elsif e.status == "Pending" %> <% else %> <% end %> <% if e.last_error.present? %> <% else %> <% end %> <% end %>
Identifier Entry ID Status Errors Status Set At Actions
<%= link_to e.identifier, bulkrax.importer_entry_path(@importer.id, e.id) %> <%= e.id %> <%= e.status %> <%= e.status %> <%= e.status %><%= link_to e.last_error.dig("error_class"), bulkrax.importer_entry_path(@importer.id, e.id) %><%= e.status_at %> <%= link_to raw(''), bulkrax.importer_entry_path(@importer.id, e.id) %>
<%= page_entries_info(@collection_entries) %>
<%= paginate(@collection_entries, theme: 'blacklight', param_name: :collections_entries_page, params: {anchor: 'collection-entries'}) %>
<% @file_set_entries.each do |e| %> <% if e.status == "Complete" %> <% elsif e.status == "Pending" %> <% else %> <% end %> <% if e.last_error.present? %> <% else %> <% end %> <% end %>
Identifier Entry ID Status Errors Status Set At Actions
<%= link_to e.identifier, bulkrax.importer_entry_path(@importer.id, e.id) %> <%= e.id %> <%= e.status %> <%= e.status %> <%= e.status %><%= link_to e.last_error.dig("error_class"), bulkrax.importer_entry_path(@importer.id, e.id) %><%= e.status_at %> <%= link_to raw(''), bulkrax.importer_entry_path(@importer.id, e.id) %>
<%= page_entries_info(@file_set_entries) %>
<%= paginate(@file_set_entries, theme: 'blacklight', param_name: :file_set_entries_page, params: {anchor: '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 %>