BathHacked/energy-sparks

View on GitHub
app/views/admin/schools/target_data/show.html.erb

Summary

Maintainability
Test Coverage
<% content_for :page_title, 'Target data report' %>

<h1>Target data report for <%= @school.name %></h1>

<p>
The following table summarises which fuel types have sufficient data for us to
generate targets for this school.
</p>

<p>
Where there is enough calendar and AMR data we should be able to generate both
their targets and a progress report.
</p>

Is the targets feature enabled for this school?: <strong><%= @school.enable_targets_feature? %></strong>

<% if @school.enable_targets_feature? && @school.has_current_target? %>
  <p>
    This school currently has a target set, you can <%= link_to "view their target and progress", school_school_targets_path(@school) %>
  </p>
<% end %>

<table class="table">
  <thead>
    <tr>
      <th>Fuel Type</th>
      <th>Enough holidays?</th>
      <th>Enough temperature data?</th>
      <th>Enough readings?</th>
      <th>Estimate required?</th>
      <th>Estimate set?</th>
    </tr>
  </thead>
  <tbody>
    <%= render 'row', fuel_type: 'Electricity', service: @electricity_service %>
    <%= render 'row', fuel_type: 'Gas', service: @gas_service %>
    <%= render 'row', fuel_type: 'Storage heaters', service: @storage_heater_service %>
  </tbody>
</table>