unepwcmc/SAPI

View on GitHub
app/views/admin/taxon_quotas/_list.html.erb

Summary

Maintainability
Test Coverage
<thead>
  <th>Year</th>
  <th>Country or Territory</th>
  <th>Quantity</th>
  <th>Unit</th>
  <th>Term</th>
  <th>Source</th>
  <th>Notes</th>
  <th>Date</th>
  <th>Public display?</th>
  <th>Actions</th>
  <th>Info</th>
</thead>
<tbody>
  <% collection.each do |quota| -%>
    <tr class="<%= if quota.is_current? then "current_listing" end %>">
      <td><%= quota.year %></td>
      <td><%= quota.geo_entity && quota.geo_entity.name_en %></td>
      <td>
        <% if quota.quota == -1 %>
          in preparation
        <% else %>
          <%= quota.quota %>
        <% end %>
      </td>
      <td><%= quota.unit.try(:code) %></td>
      <td><%= quota.terms && quota.terms.map(&:code).join(', ') %></td>
      <td><%= quota.sources && quota.sources.map(&:code).join(', ') %></td>
      <td><%= quota.notes %></td>
      <td><%= quota.publication_date_formatted %></td>
      <td><%= true_false_icon(quota.public_display) %></td>
      <td>
        <%= link_to edit_icon,
          edit_admin_taxon_concept_quota_path(@taxon_concept, quota)
        %>
        <%= link_to delete_icon,
          admin_taxon_concept_quota_path(@taxon_concept, quota),
          data: { confirm: "Warning: you are about to delete data. Are you sure?" }, :method => :delete
        %>
      </td>
      <td>
        <%= tracking_info(quota) %>
        <%= internal_notes(quota) %>
      </td>
    </tr>
  <% end -%>
</tbody>