unepwcmc/SAPI

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

Summary

Maintainability
Test Coverage
<thead>
  <th width="7%">ID</th>
  <th width="10%">Taxonomy</th>
  <th width="10%">Rank</th>
  <th width="20%">Scientific name</th>
  <th width="15%">Author year</th>
  <th width="18%">Parent</th>
  <th width="10%">Taxonomic position</th>
  <th width="5%">Name status</th>
  <th width="5%">Actions</th>
</thead>
<tbody>

  <% collection.each do |taxon_concept| -%>
    <tr>
      <td>
        <%= taxon_concept.id %>
      </td>
      <td>
        <%= taxon_concept.taxonomy.name %>
      </td>
      <td>
        <%= taxon_concept.rank.name %>
      </td>
      <td>
        <%= taxon_concept.full_name || taxon_concept.taxon_name.scientific_name %>
      </td>
      <td>
        <%= taxon_concept.author_year %>
      </td>
      <td>
        <%= taxon_concept.parent && taxon_concept.parent.full_name %>
      </td>
      <td>
        <% if taxon_concept.fixed_order_required? %>
        <a href="#" class="editable editable-click editable-required" data-type="text" data-resource="taxon_concept" data-name="taxonomic_position"
          data-placeholder="Required" data-original-title="Enter the sort order position"
          data-url="<%= resource_url(taxon_concept) %>" data-pk="<%= taxon_concept.id %>">
          <%= taxon_concept.taxonomic_position %>
        </a>
        <% else %>
          N/A
        <% end %>
      </td>
      <td>
        <%= taxon_concept.name_status %>
      </td>
      <td>
        <%= link_to edit_icon, admin_taxon_concept_names_path(taxon_concept) %>
        <% if can? :destroy, taxon_concept %>
          <%= link_to delete_icon, resource_url(taxon_concept), data: { confirm: "Warning: you are about to delete data. Are you sure?" }, :method => :delete %>
        <% end %>
      </td>
    </tr>
  <% end -%>
</tbody>