BathHacked/energy-sparks

View on GitHub
app/views/schools/advice/gas_costs/_tariff_note.html.erb

Summary

Maintainability
Test Coverage
<% if complete_tariff_coverage %>
  <%= component 'notice', status: :neutral, classes: 'mb-2' do |c| %>
    <%= advice_t('gas_costs.analysis.tariff_note.good_estimate') %>
  <% end %>
<% else %>
  <%= component 'notice', status: :negative, classes: 'mb-2' do |c| %>
    <% c.with_link { link_to advice_t('gas_costs.analysis.tariff_note.manage_tariffs'), school_energy_tariffs_path(school) } %>
    <p>
      <%= advice_t('gas_costs.analysis.tariff_note.poor_estimate', period_start_and_end: @periods_with_missing_tariffs.map{|range| [range[0].to_fs(:es_short), range[1].to_fs(:es_short)].to_sentence }.join(",")) %>
    </p>
  <% end %>
<% end %>