BathHacked/energy-sparks

View on GitHub
app/views/schools/batch_runs/show.html.erb

Summary

Maintainability
Test Coverage
<% if !@school_batch_run.done? %>
  <% content_for :head do %>
    <meta http-equiv="refresh" content="5" />
  <% end %>
<% end %>

<% content_for :page_title, "#{@school.name} regeneration" %>

<h1>Regeneration for <%= @school.name %></h1>

<p>
  <%= link_to "Back to school", school_path(@school) %>
</p>

<h2>
  Status: <strong><%= @school_batch_run.status  %></strong>
</h2>

<table class="table table-striped">
  <thead>
  <tr class="row">
    <th class="col-md-4">Time</th>
    <th class="col-md-8">Message</th>
  </tr>
  </thead>
  <tbody>
  <% @school_batch_run.school_batch_run_log_entries.by_date.each do |entry| %>
    <tr class="row">
      <td class="col-md-4"><%= nice_dates(entry.created_at) %> <%= entry.created_at.strftime("%H:%M:%S") %></td>
      <td class="col-md-8"><%= entry.message %></td>
    </tr>
  <% end %>
  </tbody>
</table>