unepwcmc/SAPI

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

Summary

Maintainability
Test Coverage
<% if @taxon_concept.current_quotas.count > 0 %>
  <table class="quota table table-bordered table-striped">
    <thead>
      <th>Quota</th>
      <th>Year</th>
      <th>Published at</th>
      <th>Country or Territory</th>
      <th>Notes</th>
      <th>Current</th>
    </thead>

    <tbody>
    <% @taxon_concept.current_quotas.each do |quota| %>

      <tr>
        <td><%= quota.quota %> <%= quota.unit.try(:code) %></td>
        <td><%= quota.year %></td>
        <td><%= quota.publication_date_formatted %></td>
        <td><%= quota.geo_entity && quota.geo_entity.iso_code2 %></td>
        <td><%= quota.notes %></td>
        <td>
          <%= form_for [:admin, @taxon_concept, quota], :remote => true do |f| %>
            <%= f.check_box :is_current %>
          <% end %>
        </td>
      </tr>

    <% end %>
    </tbody>
  </table>
<% end %>