BathHacked/energy-sparks

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

Summary

Maintainability
Test Coverage
<% content_for :page_title, 'Funder allocation report' %>

<h1>Funder school count</h1>

<h2>Funded schools</h2>

<p>
  This table summarises the number of visible and data enabled schools for each funder, along with a count of
  schools which have no funder assigned.
</p>
<p>
  Visible schools have finished onboarding, but do not yet have their data enabled. Funders are either directly linked
  to schools or via their school group.
</p>
<table class="table">
  <thead>
    <tr>
      <th scope="col">Funder</th>
      <th scope="col">Visible not data enabled</th>
      <th scope="col">Visible and data enabled</th>
    </tr>
  </thead>
  <tbody>
    <% @funders_visible.each do |funder, school_count| %>
      <tr>
        <td><%= funder %></td>
        <td><%= school_count %></td>
        <td><%= @funders_visible_and_enabled[funder] %></td>
      </tr>
    <% end %>
    <tr>
      <td>No funder</td>
      <td><%= @unfunded_visible %></td>
      <td><%= @unfunded_visible_and_enabled %></td>
    </tr>
  </tbody>
<table>

<h1>Funder allocation report</h1>

<p>
  Generates a report designed to support allocating schools across potential funders. The report includes all
  active schools as well as those that have been archived.
</p>

<p>
  Active schools includes all schools that are either still in the process of onboarding, or have completed onboarding.
  So this report will include more schools than are shown in the above table.
</p>

<%= form_tag deliver_admin_reports_funder_allocations_path, method: :post do %>
  <%= button_tag(type: 'submit', class: 'btn btn-sm') do %>
    <%= fa_icon('envelope') %> Email funder report
  <% end %>
<% end %>

<p>
  Summary of column headings:
</p>

<ul>
  <li>School group</li>
  <li>School name</li>
  <li>School type</li>
  <li>Data visible? - true or false depending on whether school is data visible</li>
  <li>Onboarding date - date school onboarding was completed. Will be empty for some older schools, or any created manually</li>
  <li>Date enabled date - date school was first made data enabled. Consistent with the "recently onboarded" report. Will be empty if school not yet visible</li>
  <li>Funder - the funder either directly linked to the school or to its school group</li>
  <li>Funding status</li>
  <li>Postcode</li>
  <li>Country</li>
  <li>Pupils</li>
  <li>% FSM</li>
  <li>Local Authority Name - Local Authority District name. Based on matching school geographic location against latest local authority district boundaries</li>
  <li>Region name - Government office region. Based on maping geographic location against latest boundaries. Regions only exist for England, so will be empty for Welsh and Scottish schools</li>
  <li>Activities this year - Number of activities recorded for this academic year. Uses dates from the school's calendar</li>
  <li>Actions this year - Adult actions recorded for this academic year. Uses dates from the school's calendar</li>
  <li>Electricity Data Source 1 - Data sources for active electricity meters. Data source names have been sorted alphabetically for consistency. This will be the first</li>
  <li>Electricity Data Source 2 - Optional</li>
  <li>Electricity Data Source 3 - Optional</li>
  <li>Electricity Procurement Route 1 - Procurement routes for active electricity meters. Route names have been sorted alphabetically for consistency. This will be the first</li>
  <li>Electricity Procurement Route 2 - Optional</li>
  <li>Electricity Procurement Route 3 - Optional</li>
  <li>Gas Data Source 1 - Data sources for active gas meters. Data source names have been sorted alphabetically for consistency. This will be the first</li>
  <li>Gas Data Source 2 - Optional</li>
  <li>Gas Data Source 3 - Optional</li>
  <li>Gas Procurement Route 1 - Procurement routes for active gas meters. Route names have been sorted alphabetically for consistency. This will be the first</li>
  <li>Gas Procurement Route 2 - Optional</li>
  <li>Gas Procurement Route 3 - Optional</li>
  <li>Solar Data Source 1 - Data sources for active solar pv or exported solar pv meters. Data source names have been sorted alphabetically for consistency. This will be the first</li>
  <li>Solar Data Source 2 - Optional</li>
  <li>Solar Data Source 3 - Optional</li>
  <li>Solar Procurement Route 1 - Procurement routes for active solar pv or exported solar pv meters. Route names have been sorted alphabetically for consistency. This will be the first</li>
  <li>Solar Procurement Route 2 - Optional</li>
  <li>Solar Procurement Route 3 - Optional</li>
</ul>