sanger/sequencescape

View on GitHub
app/views/shared/_manifests.html.erb

Summary

Maintainability
Test Coverage

<table id="study_list" class="sortable table">
  <thead>
  <tr>
    <th>Name</th>
    <th>Contains</th>
    <th>Study</th>
    <th>Supplier</th>
    <th>Created</th>
    <th>Updated</th>
    <th>Created by</th>
    <th>Manifest</th>
    <th>Upload</th>
    <th>Errors</th>
    <th>State</th>
    </tr>
  </thead>
  <tbody>
  <% manifests.each do |manifest| %>
    <tr>
      <td><%= link_to manifest.name, sample_manifest_path(manifest), title: "Manifest for #{manifest.study.name}" %></td>
      <td><%= pluralize(manifest.count, manifest.asset_type || "plate") %></td>
      <td><%= link_to manifest.study.name, study_path(manifest.study) %></td>
      <td><%= link_to manifest.supplier.name, supplier_path(manifest.supplier) %></td>
      <td><%= time_tag(manifest.created_at, format: :sortable) %></td>
      <td><%= time_tag(manifest.updated_at, format: :sortable) %></td>
      <td>
        <% if manifest.user %>
          <%= link_to manifest.user.login, profile_path(manifest.user) %>
        <% end %>
      </td>
      <td><%= link_to "Blank manifest", export_sample_manifest_path(manifest) %></td>
      <td>
        <% if manifest.failed? || (! manifest.uploaded_document) %>
          <%= link_to 'Upload manifest', sample_manifest_path(manifest) %>
        <% else %>
          <%= link_to 'Completed manifest', uploaded_spreadsheet_sample_manifest_path(manifest) %>
        <% end %>
      </td>
      <td>
      <% if manifest.last_errors %>
        <%= link_to 'Errors', sample_manifest_path(manifest), title: "Errors for manifest for #{manifest.study.name}" %>
      <% end %>
      </td>
      <td><% if ! manifest.uploaded_document %>
        No manifest uploaded
        <% else %>
          <%= manifest.state.titleize %>
      <% end %>
      </td>
    </tr>
  <% end %>
  </tbody>
</table>