BathHacked/energy-sparks

View on GitHub
app/views/schools/school_targets/progress/_row.html.erb

Summary

Maintainability
Test Coverage
<tr class="<%= 'target-final-row' if final_row %>">
  <td class="<%= 'target-final-row' if final_row %>">
    <%= title %>
  </td>
  <% keys.each do |key| %>
    <% if units == :relative_percent %>
      <td class="text-right <%= target_percent_cell_colour(data[key]) if @progress.monthly_targets_kwh[key].present? %><%= ' partial-month' if partial_months[key] %>">
        <% if @progress.monthly_targets_kwh[key].present? %>
          <%= format_target(data[key], units) %>
        <% else %>
        <% end %>
      </td>
    <% else %>
      <td class="text-right <%= ' partial-month' if partial_months[key] %><%= ' estimated-target-month' if percentage_synthetic[key].present? && percentage_synthetic[key] > 0.0 %>">
        <%= format_target(data[key], units) %>
      </td>
    <% end %>

  <% end %>
</tr>