Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add callout to green deal in the energy grants calculator. #2369

Merged
merged 13 commits into from
Apr 1, 2016
Merged
9 changes: 9 additions & 0 deletions lib/smart_answer_flows/energy-grants-calculator.rb
Original file line number Diff line number Diff line change
@@ -421,6 +421,9 @@ def define
precalculate :flat_type do
flat_type
end
precalculate :under_green_deal do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this under_green_deal returns a boolean.. is there a case against not using a question mark at the end of this definition under_green_deal? For me this reads a lot more nicer.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ikennaokpala: I agree about being more readable. Unfortunately this isn't possible when using precalculate or other similar blocks. This is because the result is assigned to the state using an attribute writer derived from the block's key. In this case that would mean state.under_green_deal? = true which gives a SyntaxError. We could look at fixing this, but I think the better solution is to extract a calculator/policy object as per the refactoring docs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ikennaokpala: It's probably worth adding a sentence or two to explain this in the storing data docs. I've added a Trello card to capture this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@floehopper I don't have access to /that/this Trello board

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@floehopper @erikse @ikennaokpala Happy to give a try to the calculator/policy object. It feels like a better approach. Not sure, though, if including it in this PR as we would have two different styles for precalculated values?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think a separate PR would be sensible. 👍

both_help && !circumstances.include?('benefits')
end
end

outcome :outcome_bills_and_measures_on_benefits_eco_eligible do
@@ -433,6 +436,9 @@ def define
precalculate :flat_type do
flat_type
end
precalculate :under_green_deal do
!((both_help && circumstances.include?('property')) || (circumstances.include?('permission') && circumstances.include?('pension_credit')) || incomesupp_jobseekers_1 || incomesupp_jobseekers_2 || (benefits_claimed & %w(esa child_tax_credit working_tax_credit)).any?)
end
end

outcome :outcome_bills_and_measures_on_benefits_not_eco_eligible do
@@ -445,6 +451,9 @@ def define
precalculate :flat_type do
flat_type
end
precalculate :under_green_deal do
both_help && age_variant == :over_60 && (benefits_claimed & %w(esa child_tax_credit working_tax_credit) || incomesupp_jobseekers_1 || incomesupp_jobseekers_2)
end
end

outcome :outcome_no_green_deal_no_energy_measures
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
^The government has stopped funding the Green Deal Finance Company, which was set up to lend money to Green Deal providers. [Find out how this affects you](/green-deal-energy-saving-measures/changes).^
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront:
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront.
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
<% content_for :title do %>
<% if both_help && !circumstances.include?('benefits') %>
<% if under_green_deal %>
<% render partial: 'title_under_green_deal.govspeak.erb' %>
<% else %>
<% render partial: 'title_energy_supplier.govspeak.erb' %>
<% end %>
<% end %>

<% content_for :body do %>
<% if under_green_deal %>
<%= render partial: 'callout_under_green_deal.govspeak.erb' %>
<% end %>
<% if both_help %>
<% if age_variant == :winter_fuel_payment %>
<%= render partial: 'winter_fuel_payments.govspeak.erb' %>
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
<% content_for :title do %>
<% if (both_help && circumstances.include?('property')) || (circumstances.include?('permission') && circumstances.include?('pension_credit')) || incomesupp_jobseekers_1 || incomesupp_jobseekers_2 || (benefits_claimed & %w(esa child_tax_credit working_tax_credit)).any? %>
<% render partial: 'title_energy_supplier.govspeak.erb' %>
<% else %>
<% if under_green_deal %>
<% render partial: 'title_under_green_deal.govspeak.erb' %>
<% else %>
<% render partial: 'title_energy_supplier.govspeak.erb' %>
<% end %>
<% end %>

<% content_for :body do %>
<% if under_green_deal %>
<%= render partial: 'callout_under_green_deal.govspeak.erb' %>
<% end %>
<% if both_help %>
<% if age_variant == :winter_fuel_payment %>
<%= render partial: 'winter_fuel_payments.govspeak.erb' %>
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
<% content_for :title do %>
<% unless both_help && age_variant == :over_60 && (benefits_claimed & %w(esa child_tax_credit working_tax_credit) || incomesupp_jobseekers_1 || incomesupp_jobseekers_2) %>
<% render partial: 'title_energy_supplier.govspeak.erb' %>
<% else %>
<% if under_green_deal %>
<% render partial: 'title_under_green_deal.govspeak.erb' %>
<% else %>
<% render partial: 'title_energy_supplier.govspeak.erb' %>
<% end %>
<% end %>

<% content_for :body do %>
<% if under_green_deal %>
<%= render partial: 'callout_under_green_deal.govspeak.erb' %>
<% end %>
<% if both_help %>
<% if age_variant == :winter_fuel_payment %>
<%= render partial: 'winter_fuel_payments.govspeak.erb' %>
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<% content_for :title do %>
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront:
<%= render partial: 'title_under_green_deal.govspeak.erb' %>
<% end %>

<% content_for :body do %>
<%= render partial: 'callout_under_green_deal.govspeak.erb' %>
<%= render partial: 'header_boilers_and_insulation.govspeak.erb' %>

<% unless (features & %w(modern_boiler)).any? %>
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront:
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront.

^The government has stopped funding the Green Deal Finance Company, which was set up to lend money to Green Deal providers. [Find out how this affects you](/green-deal-energy-saving-measures/changes).^

- [Winter Fuel Payments](/winter-fuel-payment/eligibility) - between £100 and £300 towards your heating bills

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront:
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront.

^The government has stopped funding the Green Deal Finance Company, which was set up to lend money to Green Deal providers. [Find out how this affects you](/green-deal-energy-saving-measures/changes).^

- [Winter Fuel Payments](/winter-fuel-payment/eligibility) - between £100 and £300 towards your heating bills

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront:
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront.

^The government has stopped funding the Green Deal Finance Company, which was set up to lend money to Green Deal providers. [Find out how this affects you](/green-deal-energy-saving-measures/changes).^

- [Winter Fuel Payments](/winter-fuel-payment/eligibility) - between £100 and £300 towards your heating bills

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront:
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront.

^The government has stopped funding the Green Deal Finance Company, which was set up to lend money to Green Deal providers. [Find out how this affects you](/green-deal-energy-saving-measures/changes).^

- [Winter Fuel Payments](/winter-fuel-payment/eligibility) - between £100 and £300 towards your heating bills

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront:
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront.

^The government has stopped funding the Green Deal Finance Company, which was set up to lend money to Green Deal providers. [Find out how this affects you](/green-deal-energy-saving-measures/changes).^

- [Winter Fuel Payments](/winter-fuel-payment/eligibility) - between £100 and £300 towards your heating bills

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront:
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront.

^The government has stopped funding the Green Deal Finance Company, which was set up to lend money to Green Deal providers. [Find out how this affects you](/green-deal-energy-saving-measures/changes).^

- [Winter Fuel Payments](/winter-fuel-payment/eligibility) - between £100 and £300 towards your heating bills

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront:
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront.

^The government has stopped funding the Green Deal Finance Company, which was set up to lend money to Green Deal providers. [Find out how this affects you](/green-deal-energy-saving-measures/changes).^

- [Winter Fuel Payments](/winter-fuel-payment/eligibility) - between £100 and £300 towards your heating bills

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront:
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront.

^The government has stopped funding the Green Deal Finance Company, which was set up to lend money to Green Deal providers. [Find out how this affects you](/green-deal-energy-saving-measures/changes).^

- [Winter Fuel Payments](/winter-fuel-payment/eligibility) - between £100 and £300 towards your heating bills

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront:
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront.

^The government has stopped funding the Green Deal Finance Company, which was set up to lend money to Green Deal providers. [Find out how this affects you](/green-deal-energy-saving-measures/changes).^

- [Winter Fuel Payments](/winter-fuel-payment/eligibility) - between £100 and £300 towards your heating bills

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront:
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront.

^The government has stopped funding the Green Deal Finance Company, which was set up to lend money to Green Deal providers. [Find out how this affects you](/green-deal-energy-saving-measures/changes).^

###Boilers and insulation

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront:
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront.

^The government has stopped funding the Green Deal Finance Company, which was set up to lend money to Green Deal providers. [Find out how this affects you](/green-deal-energy-saving-measures/changes).^

###Boilers and insulation

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront:
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront.

^The government has stopped funding the Green Deal Finance Company, which was set up to lend money to Green Deal providers. [Find out how this affects you](/green-deal-energy-saving-measures/changes).^

###Boilers and insulation

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront:
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront.

^The government has stopped funding the Green Deal Finance Company, which was set up to lend money to Green Deal providers. [Find out how this affects you](/green-deal-energy-saving-measures/changes).^

###Boilers and insulation

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront:
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront.

^The government has stopped funding the Green Deal Finance Company, which was set up to lend money to Green Deal providers. [Find out how this affects you](/green-deal-energy-saving-measures/changes).^

###Boilers and insulation

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront:
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront.

^The government has stopped funding the Green Deal Finance Company, which was set up to lend money to Green Deal providers. [Find out how this affects you](/green-deal-energy-saving-measures/changes).^

###Boilers and insulation

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront:
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront.

^The government has stopped funding the Green Deal Finance Company, which was set up to lend money to Green Deal providers. [Find out how this affects you](/green-deal-energy-saving-measures/changes).^

###Boilers and insulation

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront:
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront.

^The government has stopped funding the Green Deal Finance Company, which was set up to lend money to Green Deal providers. [Find out how this affects you](/green-deal-energy-saving-measures/changes).^

###Boilers and insulation

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront:
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront.

^The government has stopped funding the Green Deal Finance Company, which was set up to lend money to Green Deal providers. [Find out how this affects you](/green-deal-energy-saving-measures/changes).^

###Boilers and insulation

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront:
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront.

^The government has stopped funding the Green Deal Finance Company, which was set up to lend money to Green Deal providers. [Find out how this affects you](/green-deal-energy-saving-measures/changes).^

- [Warm Home Discount scheme](/the-warm-home-discount-scheme) - £ discount on your energy bills

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront:
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront.

^The government has stopped funding the Green Deal Finance Company, which was set up to lend money to Green Deal providers. [Find out how this affects you](/green-deal-energy-saving-measures/changes).^

- [Warm Home Discount scheme](/the-warm-home-discount-scheme) - £ discount on your energy bills

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront:
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront.

^The government has stopped funding the Green Deal Finance Company, which was set up to lend money to Green Deal providers. [Find out how this affects you](/green-deal-energy-saving-measures/changes).^

- [Warm Home Discount scheme](/the-warm-home-discount-scheme) - £ discount on your energy bills

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront:
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront.

^The government has stopped funding the Green Deal Finance Company, which was set up to lend money to Green Deal providers. [Find out how this affects you](/green-deal-energy-saving-measures/changes).^

- [Warm Home Discount scheme](/the-warm-home-discount-scheme) - £ discount on your energy bills

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront:
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront.

^The government has stopped funding the Green Deal Finance Company, which was set up to lend money to Green Deal providers. [Find out how this affects you](/green-deal-energy-saving-measures/changes).^

- [Warm Home Discount scheme](/the-warm-home-discount-scheme) - £ discount on your energy bills

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront:
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront.

^The government has stopped funding the Green Deal Finance Company, which was set up to lend money to Green Deal providers. [Find out how this affects you](/green-deal-energy-saving-measures/changes).^

- [Warm Home Discount scheme](/the-warm-home-discount-scheme) - £ discount on your energy bills

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront:
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront.

^The government has stopped funding the Green Deal Finance Company, which was set up to lend money to Green Deal providers. [Find out how this affects you](/green-deal-energy-saving-measures/changes).^

- [Warm Home Discount scheme](/the-warm-home-discount-scheme) - £ discount on your energy bills

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront:
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront.

^The government has stopped funding the Green Deal Finance Company, which was set up to lend money to Green Deal providers. [Find out how this affects you](/green-deal-energy-saving-measures/changes).^

- [Warm Home Discount scheme](/the-warm-home-discount-scheme) - £ discount on your energy bills

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront:
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront.

^The government has stopped funding the Green Deal Finance Company, which was set up to lend money to Green Deal providers. [Find out how this affects you](/green-deal-energy-saving-measures/changes).^

- [Warm Home Discount scheme](/the-warm-home-discount-scheme) - £ discount on your energy bills

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront:
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront.

^The government has stopped funding the Green Deal Finance Company, which was set up to lend money to Green Deal providers. [Find out how this affects you](/green-deal-energy-saving-measures/changes).^

###Boilers and insulation

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront:
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront.

^The government has stopped funding the Green Deal Finance Company, which was set up to lend money to Green Deal providers. [Find out how this affects you](/green-deal-energy-saving-measures/changes).^

###Boilers and insulation

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront:
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront.

^The government has stopped funding the Green Deal Finance Company, which was set up to lend money to Green Deal providers. [Find out how this affects you](/green-deal-energy-saving-measures/changes).^

###Boilers and insulation

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront:
Under the Green Deal you could get some of these improvements without having to pay all the cost upfront.

^The government has stopped funding the Green Deal Finance Company, which was set up to lend money to Green Deal providers. [Find out how this affects you](/green-deal-energy-saving-measures/changes).^

###Boilers and insulation

Loading