SpeciesFileGroup/taxonworks

View on GitHub
app/views/tasks/biological_associations/dwc_extension_preview/index.html.erb

Summary

Maintainability
Test Coverage
<h1> Biological Associations - Darwin Core Resource Relationship Preview </h1>

<%= tag.div link_to('Back to filter', filter_biological_associations_task_path(@biological_associations_query.params)) %>
<%= tag.div(paginate @biological_associations) %>
<%= tag.span @biological_associations.count.to_param + ' records', class: [:feedback, 'feedback-thin', 'feedback-info'] %>
<br>
<%= copy_table_to_clipboard('#preview_table') %>
<br><br>

<table id="preview_table" class="tablesorter">
  <thead>
    <%= tag.tr(
      Export::CSV::Dwc::Extension::BiologicalAssociations::HEADERS.collect{|c| fancy_th_tag(name: c)}.join.html_safe
    ) %>
  </thead>

  <tbody>
    <% @biological_associations.each do |b| %>
      <%= tag.tr( b.darwin_core_extension_row.collect{|c| tag.td(c)}.join.html_safe ) %>
    <% end %>
  </tbody>
</table>