BathHacked/energy-sparks

View on GitHub
app/views/comparisons/weekday_baseload_variation/_table.html.erb

Summary

Maintainability
Test Coverage
<%= component 'comparison_table',
              report: report, advice_page: advice_page, table_name: table_name, index_params: index_params,
              headers: headers, colgroups: colgroups, advice_page_tab: advice_page_tab do |component| %>
  <% results.each do |result| %>
    <% component.with_row do |row| %>
      <% row.with_school school: result.school %>
      <% row.with_reference key: 'tariff_changed_last_year',
                            if: result.electricity_economic_tariff_changed_this_year %>
      <% row.with_var change: true, val: result.percent_intraday_variation, unit: :relative_percent %>
      <% row.with_var val: result.min_day_kw, unit: :kw %>
      <% row.with_var val: result.max_day_kw, unit: :kw %>
      <% row.with_var { t('date.day_names')[result.min_day] } %>
      <% row.with_var { t('date.day_names')[result.max_day] } %>
      <% row.with_var val: result.annual_cost_gbpcurrent, unit: :£ %>
    <% end %>
  <% end %>
<% end %>