Skip to content

Commit

Permalink
Use ERB templates for Qs in benefits-cap-calculator
Browse files Browse the repository at this point in the history
I ran the following command:

    $ rails r script/convert-question-i18-yaml-to-erb-templates.rb lib/smart_answer_flows/benefits-cap-calculator

    Writing template: receive_housing_benefit.govspeak.erb
    Writing template: working_tax_credit.govspeak.erb
    Writing template: receiving_exemption_benefits.govspeak.erb
    Writing template: receiving_non_exemption_benefits.govspeak.erb
    Writing template: bereavement_amount.govspeak.erb
    Writing template: carers_amount.govspeak.erb
    Writing template: child_benefit_amount.govspeak.erb
    Writing template: child_tax_amount.govspeak.erb
    Writing template: esa_amount.govspeak.erb
    Writing template: guardian_amount.govspeak.erb
    Writing template: incapacity_amount.govspeak.erb
    Writing template: income_support_amount.govspeak.erb
    Writing template: jsa_amount.govspeak.erb
    Writing template: maternity_amount.govspeak.erb
    Writing template: sda_amount.govspeak.erb
    Writing template: widowed_mother_amount.govspeak.erb
    Writing template: widowed_parent_amount.govspeak.erb
    Writing template: widow_pension_amount.govspeak.erb
    Writing template: widows_aged_amount.govspeak.erb
    Writing template: housing_benefit_amount.govspeak.erb
    Writing template: single_couple_lone_parent.govspeak.erb

    Deleting i18n YAML: benefit-cap-calculator.yml

    Now insert `use_erb_templates_for_questions` at top of flow: benefit-cap-calculator.rb
  • Loading branch information
floehopper committed Nov 18, 2015
1 parent cbe0479 commit b087e61
Show file tree
Hide file tree
Showing 23 changed files with 189 additions and 144 deletions.
2 changes: 2 additions & 0 deletions lib/smart_answer_flows/benefit-cap-calculator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ def define
status :published
satisfies_need "100696"

use_erb_templates_for_questions

# Q1
multiple_choice :receive_housing_benefit? do
option :yes
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<% content_for :title do %>
How much do you or someone in your household get for Bereavement Allowance?
<% end %>

<% content_for :hint do %>
You need the whole amount before anything is taken off (eg utility bills or loan repayments) per week. You must enter the full amount you get for each benefit.
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<% content_for :title do %>
How much do you or someone in your household get for Carer's Allowance?
<% end %>

<% content_for :hint do %>
You need the whole amount before anything is taken off (eg utility bills or loan repayments) per week. You must enter the full amount you get for each benefit.
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<% content_for :title do %>
How much do you or someone in your household get for Child Benefits?
<% end %>

<% content_for :hint do %>
You need the whole amount before anything is taken off (eg utility bills or loan repayments) per week. You must enter the full amount you get for each benefit.
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<% content_for :title do %>
How much do you or someone in your household get for Child Tax Credits?
<% end %>

<% content_for :hint do %>
You need the whole amount before anything is taken off (eg utility bills or loan repayments) per week. You must enter the full amount you get for each benefit.
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<% content_for :title do %>
How much do you or someone in your household get for Employment and Support Allowance?
<% end %>

<% content_for :hint do %>
You need the whole amount before anything is taken off (eg utility bills or loan repayments) per week. You must enter the full amount you get for each benefit.
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<% content_for :title do %>
How much do you or someone in your household get for Guardian's Allowance?
<% end %>

<% content_for :hint do %>
You need the whole amount before anything is taken off (eg utility bills or loan repayments) per week. You must enter the full amount you get for each benefit.
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<% content_for :title do %>
How much do you or someone in your household get for Housing Benefit?
<% end %>

<% content_for :hint do %>
You need the whole amount before anything is taken off (eg utility bills or loan repayments) per week. You must enter the full amount you get for each benefit.
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<% content_for :title do %>
How much do you or someone in your household get for Incapacity Benefit?
<% end %>

<% content_for :hint do %>
You need the whole amount before anything is taken off (eg utility bills or loan repayments) per week. You must enter the full amount you get for each benefit.
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<% content_for :title do %>
How much do you or someone in your household get for Income Support?
<% end %>

<% content_for :hint do %>
You need the whole amount before anything is taken off (eg utility bills or loan repayments) per week. You must enter the full amount you get for each benefit.
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<% content_for :title do %>
How much do you or someone in your household get for Jobseeker’s Allowance?
<% end %>

<% content_for :hint do %>
You need the whole amount before anything is taken off (eg utility bills or loan repayments) per week. You must enter the full amount you get for each benefit.
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<% content_for :title do %>
How much do you or someone in your household get for Maternity Allowance?
<% end %>

<% content_for :hint do %>
You need the whole amount before anything is taken off (eg utility bills or loan repayments) per week. You must enter the full amount you get for each benefit.
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<% content_for :title do %>
Do you receive Housing Benefit?
<% end %>

<% options(
"yes": "Yes",
"no": "No"
) %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<% content_for :title do %>
Do you or someone in your household get any of the following benefits:
<% end %>

<% options(
"yes": "Yes",
"no": "No"
) %>

<% content_for :body do %>
- Attendance Allowance
- Disability Living Allowance
- Industrial Injuries Benefit
- Personal Independence Payment
- Employment and Support Allowance (support component)
- War Widow’s or War Widower’s Pension
- Armed Forces Compensation Scheme
- Armed Forces Independence Payment

<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<% content_for :title do %>
Do you or someone in your household get any of the following benefits:
<% end %>

<% options(
"bereavement": "Bereavement Allowance",
"carers": "Carer's Allowance",
"child_benefit": "Child Benefit",
"child_tax": "Child Tax Credit",
"esa": "Employment and Support Allowance",
"guardian": "Guardian's Allowance",
"incapacity": "Incapacity Benefit",
"income_support": "Income Support",
"jsa": "Jobseeker’s Allowance",
"maternity": "Maternity Allowance",
"sda": "Severe Disablement Allowance",
"widowed_mother": "Widowed Mother's Allowance",
"widowed_parent": "Widowed Parent's Allowance",
"widow_pension": "Widow's Pension",
"widows_aged": "Widow's Pension (age related)",
"none_above": "None of the above"
) %>

<% content_for :hint do %>
If you do not receive any of these click Next step.
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<% content_for :title do %>
How much do you or someone in your household get for Severe Disability Allowance?
<% end %>

<% content_for :hint do %>
You need the whole amount before anything is taken off (eg utility bills or loan repayments) per week. You must enter the full amount you get for each benefit.
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<% content_for :title do %>
Are you:
<% end %>

<% options(
"single": "Single",
"couple": "Living as a couple (with or without children)",
"parent": "A lone parent with 1 or more dependent children"
) %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<% content_for :title do %>
How much do you or someone in your household get for Widow's Pension?
<% end %>

<% content_for :hint do %>
You need the whole amount before anything is taken off (eg utility bills or loan repayments) per week. You must enter the full amount you get for each benefit.
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<% content_for :title do %>
How much do you or someone in your household get for Widowed Mother's Allowance?
<% end %>

<% content_for :hint do %>
You need the whole amount before anything is taken off (eg utility bills or loan repayments) per week. You must enter the full amount you get for each benefit.
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<% content_for :title do %>
How much do you or someone in your household get for Widowed Parent's Allowance?
<% end %>

<% content_for :hint do %>
You need the whole amount before anything is taken off (eg utility bills or loan repayments) per week. You must enter the full amount you get for each benefit.
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<% content_for :title do %>
How much do you or someone in your household get for Widow's Pension (age related)?
<% end %>

<% content_for :hint do %>
You need the whole amount before anything is taken off (eg utility bills or loan repayments) per week. You must enter the full amount you get for each benefit.
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<% content_for :title do %>
Do you qualify for Working Tax Credit?
<% end %>

<% options(
"yes": "Yes",
"no": "No"
) %>

<% content_for :hint do %>
You don't need to be getting Working Tax Credit, only qualify for it.
<% end %>
144 changes: 0 additions & 144 deletions lib/smart_answer_flows/locales/en/benefit-cap-calculator.yml

This file was deleted.

0 comments on commit b087e61

Please sign in to comment.