sanger/sequencescape

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

Summary

Maintainability
Test Coverage

<table id="study_list">
  <thead>
  <tr>
    <th>Study</th>
    <th>Created on</th>
    <th>Created by</th>
    <th>Download</th>
    <th>Rerun</th>
    </tr>
  </thead>
  <tbody>
  <% study_reports.each do |study_report| %>
    <tr>
      <td><%= link_to study_report.study.name, study_reports_study_path(study_report.study) %></td>
      <td class="strong faint"><%= study_report.created_at.to_formatted_s(:sortable) %></td>
      <td>
        <% if study_report.user %>

          <%= link_to study_report.user.login, study_reports_profile_path(study_report.user) %>
        <% end %>
      </td>
      <td>
      <% if study_report.report.present? %>
         <%= link_to 'Download', study_report_path(study_report), title: "Download report for #{study_report.study.name}" %>
      <% else %>
        Processing
      <% end %>
      </td>
      <td>
        <% if study_report.report.present? %>
          <%= link_to "Rerun", new_study_report_path(study: study_report.study) %>
        <% end %>
      </td>
    </tr>
  <% end %>
  </tbody>
</table>