BathHacked/energy-sparks

View on GitHub
app/views/schools/advice/gas_out_of_hours/_analysis.html.erb

Summary

Maintainability
Test Coverage
<p><%= t('advice_pages.gas_out_of_hours.analysis.summary') %></p>
<ul>
  <li>
    <a href='#last_twelve_months'>
      <% if @analysis_dates.one_years_data? %>
        <%= t('advice_pages.gas_out_of_hours.analysis.last_twelve_months.title') %>
      <% else %>
        <%= t('advice_pages.gas_long_term.analysis.recent_trend.title') %>
      <% end %>
    </a>
  </li>
  <li>
    <a href='#usage_by_day_of_week'>
      <%= t('advice_pages.gas_out_of_hours.analysis.usage_by_day_of_week.title') %>
    </a>
  </li>
  <% if show_holiday_usage_section?(@holiday_usage) %>
    <li>
      <a href='#holiday-usage'>
        <%= t('advice_pages.gas_out_of_hours.analysis.holiday_usage.title') %>
      </a>
    </li>
  <% end %>
</ul>

<%= render 'schools/advice/out_of_hours/last_year',
           analysis_dates: @analysis_dates,
           meter_selection: @meter_selection,
           usage_categories: @usage_categories,
           annual_usage_breakdown: @annual_usage_breakdown,
           fuel_type: :gas,
           chart: :daytype_breakdown_gas_tolerant %>

<%= render 'by_day',
           school: @school,
           analysis_dates: @analysis_dates,
           meter_selection: @meter_selection,
           annual_usage_breakdown: @annual_usage_breakdown %>

<% if show_holiday_usage_section?(@holiday_usage) %>
  <%= render 'schools/advice/out_of_hours/holidays',
             school: @school,
             analysis_dates: @analysis_dates,
             fuel_type: :gas,
             dashboard_alerts: @dashboard_alerts,
             alert_classes: [AlertGasHeatingHotWaterOnDuringHoliday, AlertPreviousHolidayComparisonGas,
                             AlertPreviousYearHolidayComparisonGas],
             full_chart: :alert_group_by_week_gas_14_months,
             limited_chart: :management_dashboard_group_by_week_gas,
             holiday_usage: @holiday_usage %>
<% end %>