SpeciesFileGroup/taxonworks

View on GitHub
app/views/shared/data/all/batch_load/_preview.html.erb

Summary

Maintainability
Test Coverage
<h2> Batch preview </h2>
<% if @result.valid? -%>
  <div><span class="feedback feedback-info"> To complete this batch import, select the file again and click create.</span></div>
  <h3> Batch form </h3> 
  <%= content_for :batch_form -%>
<% end %>

<hr>
<%= render partial: 'shared/data/all/batch_load/import_file_properties' %>
<hr>

<h3> Line breakdown </h3>
<% if content_for?(:line_breakdown) -%>
  <%= yield :line_breakdown -%>
<% else %>
  <table class="top_align_text" border="1">
    <tr>
      <th class="four_character_width">line</th>
      <th class="four_character_width">data count</th>
      <th class="four_character_width">valid count*</th>
      <th class="one_third_width">data errors</th>
      <th>parse errors</th>
    </tr>

    <% @result.sorted_processed_rows.each do |i, rp| -%>
      <tr>
        <%= batch_line_link_td(i) -%>
        <%= batch_all_objects_count_td(rp) -%>
        <%= batch_valid_objects_td(rp) -%>
        <%= batch_data_errors_td(rp) -%>
        <%= batch_parse_errors_td(rp) -%>
      </tr>
    <% end -%>
  </table>
<% end %>

<h3> Input file </h3>
<%= render partial: '/shared/data/all/batch_load/input_file', locals: {csv: @result.csv} -%>