unepwcmc/SAPI

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

Summary

Maintainability
Test Coverage
<thead>
  <th>Name</th>
  <th>Effective from</th>
  <th>Current</th>
  <th>No of listing changes</th>
  <th>Documents</th>
  <th width="10%">Actions</th>
</thead>
<tbody>
  <% collection.each do |cites_cop| -%>
    <tr class="<%= if cites_cop.is_current? then "current_listing" end %>">
      <td>
        <a href="#" class="editable editable-click editable-required"
          data-type="text" data-resource="cites_cop" data-name="name"
          data-placeholder="Required" data-original-title="Enter the CITES CoP's name"
          data-url="<%= resource_url(cites_cop) %>" data-pk="<%= cites_cop.id %>">
          <%= cites_cop.name %>
        </a>
      </td>
      <td><%= cites_cop.effective_at_formatted %></td>
      <td><%= true_false_icon(cites_cop.is_current) %></td>
      <td>
        <%= cites_cop.listing_changes.count %>
      </td>
      <td>
        <%= link_to cites_cop.documents.count, admin_event_documents_path(cites_cop) %>
      </td>
      <td>
        <%= link_to edit_icon, edit_resource_url(cites_cop), :remote => true %>
        <%= link_to delete_icon, resource_url(cites_cop),
          data: { confirm: "Warning: you are about to delete data. Are you sure?" }, :method => :delete
        %>
      </td>
    </tr>
  <% end -%>
</tbody>