BathHacked/energy-sparks

View on GitHub
app/views/admin/school_groups/_removed_schools.html.erb

Summary

Maintainability
Test Coverage
<table class="table table-sorted" style="width:100%">
  <thead>
    <tr>
      <th>Name</th>
      <th>Funder</th>
      <th>Archived?</th>
      <th>Archived date</th>
      <th>Removal date</th>
      <th class="no-sort"></th>
    </tr>
  </thead>
  <tbody>
    <% school_group.schools.inactive.by_name.each do |school| %>
      <tr class="bg-light">
        <td><%= link_to school.name, school_path(school) %></td>
        <td><%= school.funder&.name || school&.school_group&.funder&.name %></td>
        <td><%= y_n(school.archived?) %></td>
        <td><%= nice_dates(school.archived_date) %></td>
        <td><%= nice_dates(school.removal_date) %></td>
        <td class="nowrap text-right">
          <%= link_to issue_type_icons(school.issues, label: 'Issues'),
                      admin_school_issues_path(school), class: 'btn btn-sm' %>
          <%= link_to 'Meters', school_meters_path(school), class: 'btn btn-sm' %>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>