unepwcmc/SAPI

View on GitHub
app/views/admin/taxon_eu_suspensions/_current_suspensions_form.html.erb

Summary

Maintainability
Test Coverage
<% if @taxon_concept.current_eu_suspensions.count > 0 %>
  <table class="eu_suspension table table-bordered table-striped">
    <thead>
      <th>Year</th>
      <th>Regulation</th>
      <th>Country or Territory</th>
      <th>Type</th>
      <th>Term</th>
      <th>Source</th>
      <th>Notes</th>
      <th>Internal notes</th>
    </thead>

    <tbody>
    <% @taxon_concept.current_eu_suspensions.each do |suspension| %>

      <tr>
        <td><%= suspension.year %></td>
        <td><%= suspension.start_event.name %></td>
        <td><%= suspension.geo_entity && suspension.geo_entity.name_en %></td>
        <td>
          <%= suspension.eu_decision_type.name %>
          <%= '(' + suspension.eu_decision_type.tooltip + ')' if suspension.
            eu_decision_type.tooltip.present? %>
        </td>
        <td><%= suspension.term && suspension.term.code %></td>
        <td><%= suspension.source && suspension.source.code %></td>
        <td><%= suspension.notes %></td>
        <td><%= suspension.internal_notes %></td>
        <td>
          <%= form_for [:admin, @taxon_concept, suspension], :remote => true do |f| %>
            <%= f.check_box :is_current %>
          <% end %>
        </td>
      </tr>

    <% end %>
    </tbody>
  </table>
<% else %>
  There are no current EU suspensions for this Taxon Concept.
<% end %>