BathHacked/energy-sparks

View on GitHub
app/views/schools/advice/hot_water/_analysis_table.html.erb

Summary

Maintainability
Test Coverage
<table class="table table-sm">
  <thead class="thead-dark">
    <tr>
      <th></th>
      <th colspan="3"><%= t('advice_pages.hot_water.analysis.table.columns.annual') %></th>
      <th></th>
      <th colspan="4"><%= t('advice_pages.hot_water.analysis.table.columns.saving') %></th>
      <th class="text-right"><%= t('advice_pages.hot_water.analysis.table.columns.capital_cost') %></th>
      <th class="text-right"><%= t('advice_pages.hot_water.analysis.table.columns.payback') %></th>
    </tr>
    <tr>
      <th><%= t('advice_pages.hot_water.analysis.table.columns.choice') %></th>
      <th class="text-right"><%= t('advice_pages.hot_water.analysis.table.columns.annual_kwh') %></th>
      <th class="text-right"><%= t('advice_pages.hot_water.analysis.table.columns.annual_cost_gbp') %></th>
      <th class="text-right"><%= t('advice_pages.hot_water.analysis.table.columns.annual_co2_kg') %></th>
      <th class="text-right"><%= t('advice_pages.hot_water.analysis.table.columns.efficiency') %></th>
      <th class="text-right"><%= t('advice_pages.hot_water.analysis.table.columns.saving_gbp') %></th>
      <th class="text-right"><%= t('advice_pages.hot_water.analysis.table.columns.saving_gbp_percent') %></th>
      <th class="text-right"><%= t('advice_pages.hot_water.analysis.table.columns.saving_co2') %></th>
      <th class="text-right"><%= t('advice_pages.hot_water.analysis.table.columns.saving_co2_percent') %></th>
      <th class="text-right"><%= t('advice_pages.hot_water.analysis.table.columns.capital_cost_gbp') %></th>
      <th class="text-right"><%= t('advice_pages.hot_water.analysis.table.columns.payback_years') %></th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><%= t('advice_pages.hot_water.analysis.table.rows.current_setup') %></td>
      <td class="text-right"><%= format_unit(@gas_hot_water.investment_choices.existing_gas.annual_kwh, :kwh) %></td>
      <td class="text-right"><%= format_unit(@gas_hot_water.investment_choices.existing_gas.annual_£, :£) %></td>
      <td class="text-right"><%= format_unit(@gas_hot_water.investment_choices.existing_gas.annual_co2, :co2) %></td>
      <td class="text-right"><%= format_unit(@gas_hot_water.investment_choices.existing_gas.efficiency, :percent) %></td>
      <td class="text-right"></td>
      <td class="text-right"></td>
      <td class="text-right"></td>
      <td class="text-right"></td>
      <td class="text-right"><%= format_unit(@gas_hot_water.investment_choices.existing_gas.capex, :£) %></td>
      <td class="text-right"></td>
    </tr>
    <tr>
      <td><%= t('advice_pages.hot_water.analysis.table.rows.improved_boiler_control') %></td>
      <td class="text-right"><%= format_unit(@gas_hot_water.investment_choices.gas_better_control.annual_kwh, :kwh) %></td>
      <td class="text-right"><%= format_unit(@gas_hot_water.investment_choices.gas_better_control.annual_£, :£) %></td>
      <td class="text-right"><%= format_unit(@gas_hot_water.investment_choices.gas_better_control.annual_co2, :co2) %></td>
      <td class="text-right"><%= format_unit(@gas_hot_water.investment_choices.gas_better_control.efficiency, :percent) %></td>
      <td class="text-right"><%= format_unit(@gas_hot_water.investment_choices.gas_better_control.saving_£, :£) %></td>
      <td class="text-right"><%= format_unit(@gas_hot_water.investment_choices.gas_better_control.saving_£_percent, :percent) %></td>
      <td class="text-right"><%= format_unit(@gas_hot_water.investment_choices.gas_better_control.saving_co2, :co2) %></td>
      <td class="text-right"><%= format_unit(@gas_hot_water.investment_choices.gas_better_control.saving_co2_percent, :percent) %></td>
      <td class="text-right"><%= format_unit(@gas_hot_water.investment_choices.gas_better_control.capex, :£) %></td>
      <td class="text-right"><%= @gas_hot_water.investment_choices.gas_better_control.payback_years.round %></td>
    </tr>
    <tr>
      <td><%= t('advice_pages.hot_water.analysis.table.rows.point_of_use_electric_heaters') %></td>
      <td class="text-right"><%= format_unit(@gas_hot_water.investment_choices.point_of_use_electric.annual_kwh, :kwh) %></td>
      <td class="text-right"><%= format_unit(@gas_hot_water.investment_choices.point_of_use_electric.annual_£, :£) %></td>
      <td class="text-right"><%= format_unit(@gas_hot_water.investment_choices.point_of_use_electric.annual_co2, :co2) %></td>
      <td class="text-right"><%= format_unit(@gas_hot_water.investment_choices.point_of_use_electric.efficiency, :percent) %></td>
      <td class="text-right"><%= format_unit(@gas_hot_water.investment_choices.point_of_use_electric.saving_£, :£) %></td>
      <td class="text-right"><%= format_unit(@gas_hot_water.investment_choices.point_of_use_electric.saving_£_percent, :percent) %></td>
      <td class="text-right"><%= format_unit(@gas_hot_water.investment_choices.point_of_use_electric.saving_co2, :co2) %></td>
      <td class="text-right"><%= format_unit(@gas_hot_water.investment_choices.point_of_use_electric.saving_co2_percent, :percent) %></td>
      <td class="text-right"><%= format_unit(@gas_hot_water.investment_choices.point_of_use_electric.capex, :£) %></td>
      <td class="text-right"><%= @gas_hot_water.investment_choices.point_of_use_electric.payback_years.round %></td>
    </tr>
  </tbody>
</table>
<%= render 'schools/advice/how_have_we_analysed_your_data_table_caption', data_target: "how-have-we-analysed-your-data-footnotes" %>