sul-dlss/argo

View on GitHub
app/views/bulk_actions/index.html.erb

Summary

Maintainability
Test Coverage
<div class='container'>

  <h1>Bulk Actions</h1>
  <div class="row">
    <div class="col-md-10">
      <%= link_to 'New Bulk Action', new_bulk_action_path(search_state.reset_search.to_h), class: 'btn btn-primary' %>
    </div>
    <div class="col-md-2">
      <%= link_back_to_catalog label: 'Back to search', class: 'btn btn-default' %>
    </div>
  </div>

  <table class='table'>
    <thead>
      <tr>
        <th>Submitted</th>
        <th>Action</th>
        <th>Description</th>
        <th>Status</th>
        <th>Total / Success / Failed</th>
        <th colspan="3"></th>
      </tr>
    </thead>

    <tbody>
      <% @bulk_actions.each do |bulk_action| %>
        <tr>
          <td><%= l bulk_action.created_at.localtime %></td>
          <td><%= bulk_action.action_type %></td>
          <td><%= bulk_action.description %></td>
          <td><%= bulk_action.status %></td>
          <td>
            <%= bulk_action.druid_count_total %> /
            <%= bulk_action.druid_count_success %> /
            <%= bulk_action.druid_count_fail %>
          </td>
          <td><%= link_to('Log', file_bulk_action_path(bulk_action.id, filename: Settings.bulk_metadata.log), download: true) %></td>
          <td><%= render_bulk_action_type(bulk_action) %></td>
          <td>
            <%= link_to 'Delete', bulk_action, data: { turbo_method: :delete, turbo_confirm: 'Are you sure?' }, class: 'btn btn-danger' %>
          </td>
        </tr>
      <% end %>
    </tbody>
  </table>
</div>