BathHacked/energy-sparks

View on GitHub
app/views/schools/school_targets/progress/_footnotes.html.erb

Summary

Maintainability
Test Coverage
<h5 class="font-weight-bold"><%= t('schools.school_targets.progress.footnotes.title') %></h5>

<div class="ml-2">
  <% if show_storage_heater_notes %>
    <p>
      <%= t('schools.school_targets.progress.footnotes.this_report_only_shows_message_html', storage_heater_path: storage_heater_school_school_target_progress_index_path(school_target.school, school_target)) %>.
    </p>
  <% end %>

  <p>
    <%= t('schools.school_targets.progress.footnotes.we_use_colour_coding_message_html') %>.
  </p>

  <% if progress.partial_consumption_data? %>
    <%= t('schools.school_targets.progress.footnotes.consumption_data_message_html') %>
  <% end %>

  <% if progress.reporting_period_before_consumption_data? %>
    <% if school_target.school.configuration.meter_start_date(fuel_type).present? %>
      <p><%= t('schools.school_targets.progress.footnotes.reporting_period_before_consumption_data_start_date_message', fuel_type: human_fuel_type(fuel_type, include_storage_heaters: true), meter_start_date: I18n.l(school_target.school.configuration.meter_start_date(fuel_type), format: '%b %Y')) %>.</p>
    <% else %>
      <p><%= t('schools.school_targets.progress.footnotes.reporting_period_before_consumption_data_no_start_date_message', fuel_type: human_fuel_type(fuel_type, include_storage_heaters: true)) %>.</p>
    <% end %>
  <% end %>

  <% if progress.targets_derived_from_synthetic_data? %>
    <p>
      <%= t('schools.school_targets.progress.footnotes.targets_derived_from_synthetic_data_message_html', school_estimated_annual_consumptions_path: school_estimated_annual_consumptions_path(school_target.school)) %>.
    </p>
  <% end %>

  <% if progress.partial_target_data? %>
    <p>
      <%= t('schools.school_targets.progress.footnotes.partial_target_data_message_html', estimated_annual_consumptions_path: school_estimated_annual_consumptions_path(school_target.school)) %>.
    </p>
  <% end %>

  <% if school_target.expired? %>
    <p>
      <%= t('schools.school_targets.progress.footnotes.expired_message_html', report_last_generated_date: nice_dates(school_target.report_last_generated)) %>.
    </p>
  <% end %>

</div>