BathHacked/energy-sparks

View on GitHub
app/views/admin/reports/transifex_loads/show.html.erb

Summary

Maintainability
Test Coverage
<div class="d-flex justify-content-between align-items-center">
  <h1>Transifex Load <%= nice_dates(@transifex_load.created_at) %></h1>
  <div>
    <%= link_to "View all loads", admin_reports_transifex_loads_path, class: "btn btn-outline-dark font-weight-bold" %>
  </div>
</div>

<p>
This load pulled <%= pluralize(@transifex_load.pulled, 'resource') %> with translations,
and pushed <%= pluralize(@transifex_load.pushed, 'resource') %> from our database.
</p>

<p>
<%= pluralize(@transifex_load.transifex_load_errors.count, 'error')%> occured.
</p>

<% if @transifex_load.errors? %>
  <table class="table table-sm table-striped">
    <thead>
      <tr>
        <th>Timestamp</th>
        <th>Record Type</th>
        <th>Record ID</th>
        <th>Error Message</th>
      </tr>
    </thead>
    <tbody>
      <% @transifex_load.transifex_load_errors.each do |error| %>
        <tr>
          <td><%= nice_date_times(error.created_at) %>
          <td><%= error.record_type %></td>
          <td><%= error.record_id %></td>
          <td><%= error.error %></td>
        </tr>
      <% end %>
    </tbody>
  </table>
<% end %>