sanger/sequencescape

View on GitHub
app/views/studies/information/summary.html.erb

Summary

Maintainability
Test Coverage

<%- add :about, "Study specification and management." %>
<% if can? :administer, @study %>
  <% add :menu, "Study manage" => admin_study_path(@study) -%>
<% end %>
<% add :back_menu, I18n.t("navigation.menu.back_to_study") => study_information_path(@study) -%>

<div id='content-links'>
 <%= link_to "Full details", study_path(@study) -%>
</div>

<div class="page-header"><h1>Summary of <%= @study.name %></h1></div>
<div class='subtitle'>
  Study <%= @study.id %> &middot; Created on <%= @study.created_at.to_formatted_s(:long) %> &middot; <%= @study.state.capitalize %>
</div>

<% unless @summary.size > 0  -%>
  No events registered for this study.
<% else -%>
  <div style="text-align:center">
    <%= pagination @summary %>
  </div>
  <table width='100%' cellspacing="0" cellpadding="4" class="sortable">
    <thead>
      <tr>
        <th>Date</th>
        <th>Event</th>
        <th>Study information</th>
        <th>Lab information</th>
        </tr>
    </thead>
    <tbody>
    <% @summary.each do |summary_item| %>
      <tr class="<%= cycle("rowodd", "roweven") %>">
        <td><%= summary_item.timestamp.to_formatted_s(:sortable) %></td>
        <td><%= summary_item.message %></td>
        <td><%= dynamic_link_to(summary_item) %></td>
        <% if summary_item.external_message %>
          <td><%= link_to(summary_item.external_message, summary_item.external_link.to_s) %></td>
        <% else %>
          <td></td>
        <% end %>
      </tr>
    <% end %>
    </tbody>
  </table>
  <br />
  <div style="text-align:center">
    <%= pagination @summary %>
  </div>
<% end -%>