unepwcmc/SAPI

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

Summary

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