Browse Source

Extract lettings household needs copy (#2729)

pull/2736/head
kosiakkatrina 3 months ago committed by GitHub
parent
commit
83877dae69
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      app/models/form/lettings/pages/type_of_access_needs.rb
  2. 3
      app/models/form/lettings/questions/armedforces.rb
  3. 3
      app/models/form/lettings/questions/condition_effects.rb
  4. 3
      app/models/form/lettings/questions/housingneeds.rb
  5. 4
      app/models/form/lettings/questions/housingneeds_other.rb
  6. 4
      app/models/form/lettings/questions/housingneeds_type.rb
  7. 3
      app/models/form/lettings/questions/illness.rb
  8. 3
      app/models/form/lettings/questions/leftreg.rb
  9. 3
      app/models/form/lettings/questions/preg_occ.rb
  10. 3
      app/models/form/lettings/questions/reservist.rb
  11. 1
      app/models/form/lettings/subsections/household_needs.rb
  12. 58
      config/locales/forms/2023/lettings/household_needs.en.yml
  13. 58
      config/locales/forms/2024/lettings/household_needs.en.yml

2
app/models/form/lettings/pages/type_of_access_needs.rb

@ -2,7 +2,7 @@ class Form::Lettings::Pages::TypeOfAccessNeeds < ::Form::Page
def initialize(id, hsh, subsection)
super
@id = "type_of_access_needs"
@header = "Disabled access needs"
@copy_key = "lettings.household_needs.housingneeds_type"
@depends_on = [{ "housingneeds" => 1 }]
end

3
app/models/form/lettings/questions/armedforces.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Armedforces < ::Form::Question
def initialize(id, hsh, page)
super
@id = "armedforces"
@check_answer_label = "Household links to UK armed forces"
@header = "Does anybody in the household have any links to the UK armed forces?"
@type = "radio"
@check_answers_card_number = 0
@hint_text = "This excludes national service.<br><br>If there are several people in the household with links to the UK armed forces, you should answer for the regular. If there’s no regular, answer for the reserve. If there’s no reserve, answer for the spouse or civil partner."
@answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

3
app/models/form/lettings/questions/condition_effects.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::ConditionEffects < ::Form::Question
def initialize(id, hsh, page)
super
@id = "condition_effects"
@check_answer_label = "How is person affected by condition or illness"
@header = "How is the person affected by their condition or illness?"
@type = "checkbox"
@check_answers_card_number = 0
@hint_text = "Select all that apply."
@answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

3
app/models/form/lettings/questions/housingneeds.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Housingneeds < ::Form::Question
def initialize(id, hsh, page)
super
@id = "housingneeds"
@check_answer_label = "Anybody with disabled access needs"
@header = "Does anybody in the household have any disabled access needs?"
@type = "radio"
@check_answers_card_number = 0
@hint_text = ""
@answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

4
app/models/form/lettings/questions/housingneeds_other.rb

@ -2,11 +2,9 @@ class Form::Lettings::Questions::HousingneedsOther < ::Form::Question
def initialize(id, hsh, page)
super
@id = "housingneeds_other"
@check_answer_label = "Other disabled access needs"
@header = "Do they have any other disabled access needs?"
@copy_key = "lettings.household_needs.housingneeds_type.housingneeds_other"
@type = "radio"
@check_answers_card_number = 0
@hint_text = ""
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

4
app/models/form/lettings/questions/housingneeds_type.rb

@ -2,11 +2,9 @@ class Form::Lettings::Questions::HousingneedsType < ::Form::Question
def initialize(id, hsh, page)
super
@id = "housingneeds_type"
@check_answer_label = "Disabled access needs"
@header = "What type of access needs do they have?"
@copy_key = "lettings.household_needs.housingneeds_type.housingneeds_type"
@type = "radio"
@check_answers_card_number = 0
@hint_text = ""
@answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

3
app/models/form/lettings/questions/illness.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Illness < ::Form::Question
def initialize(id, hsh, page)
super
@id = "illness"
@check_answer_label = "Anybody in household with physical or mental health condition"
@header = "Does anybody in the household have a physical or mental health condition (or other illness) expected to last 12 months or more?"
@type = "radio"
@check_answers_card_number = 0
@hint_text = ""
@answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

3
app/models/form/lettings/questions/leftreg.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Leftreg < ::Form::Question
def initialize(id, hsh, page)
super
@id = "leftreg"
@check_answer_label = "Person still serving in UK armed forces"
@header = "Is the person still serving in the UK armed forces?"
@type = "radio"
@check_answers_card_number = 0
@hint_text = ""
@answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

3
app/models/form/lettings/questions/preg_occ.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::PregOcc < ::Form::Question
def initialize(id, hsh, page)
super
@id = "preg_occ"
@check_answer_label = "Anybody in household pregnant"
@header = "Is anybody in the household pregnant?"
@type = "radio"
@check_answers_card_number = 0
@hint_text = ""
@answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

3
app/models/form/lettings/questions/reservist.rb

@ -2,11 +2,8 @@ class Form::Lettings::Questions::Reservist < ::Form::Question
def initialize(id, hsh, page)
super
@id = "reservist"
@check_answer_label = "Person seriously injured or ill as result of serving in UK armed forces"
@header = "Was the person seriously injured or ill as a result of serving in the UK armed forces?"
@type = "radio"
@check_answers_card_number = 0
@hint_text = ""
@answer_options = ANSWER_OPTIONS
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end

1
app/models/form/lettings/subsections/household_needs.rb

@ -2,6 +2,7 @@ class Form::Lettings::Subsections::HouseholdNeeds < ::Form::Subsection
def initialize(id, hsh, section)
super
@id = "household_needs"
@copy_key = "lettings.household_needs.housingneeds_type"
@label = "Household needs"
@depends_on = [{ "non_location_setup_questions_completed?" => true }]
end

58
config/locales/forms/2023/lettings/household_needs.en.yml

@ -0,0 +1,58 @@
en:
forms:
2023:
lettings:
household_needs:
armedforces:
page_header: ""
check_answer_label: "Household links to UK armed forces"
hint_text: "This excludes national service.<br><br>If there are several people in the household with links to the UK armed forces, you should answer for the regular. If there’s no regular, answer for the reserve. If there’s no reserve, answer for the spouse or civil partner."
question_text: "Does anybody in the household have any links to the UK armed forces?"
leftreg:
page_header: ""
check_answer_label: "Person still serving in UK armed forces"
hint_text: ""
question_text: "Is the person still serving in the UK armed forces?"
reservist:
page_header: ""
check_answer_label: "Person seriously injured or ill as result of serving in UK armed forces"
hint_text: ""
question_text: "Was the person seriously injured or ill as a result of serving in the UK armed forces?"
preg_occ:
page_header: ""
check_answer_label: "Anybody in household pregnant"
hint_text: ""
question_text: "Is anybody in the household pregnant?"
housingneeds:
page_header: ""
check_answer_label: "Anybody with disabled access needs"
hint_text: ""
question_text: "Does anybody in the household have any disabled access needs?"
housingneeds_type:
page_header: "Disabled access needs"
housingneeds_type:
check_answer_label: "Disabled access needs"
hint_text: ""
question_text: "What type of access needs do they have?"
housingneeds_other:
check_answer_label: "Other disabled access needs"
hint_text: ""
question_text: "Do they have any other disabled access needs?"
illness:
page_header: ""
check_answer_label: "Anybody in household with physical or mental health condition"
hint_text: ""
question_text: "Does anybody in the household have a physical or mental health condition (or other illness) expected to last 12 months or more?"
condition_effects:
page_header: ""
check_answer_label: "How is person affected by condition or illness"
hint_text: "Select all that apply."
question_text: "How is the person affected by their condition or illness?"

58
config/locales/forms/2024/lettings/household_needs.en.yml

@ -0,0 +1,58 @@
en:
forms:
2024:
lettings:
household_needs:
armedforces:
page_header: ""
check_answer_label: "Household links to UK armed forces"
hint_text: "This excludes national service.<br><br>If there are several people in the household with links to the UK armed forces, you should answer for the regular. If there’s no regular, answer for the reserve. If there’s no reserve, answer for the spouse or civil partner."
question_text: "Does anybody in the household have any links to the UK armed forces?"
leftreg:
page_header: ""
check_answer_label: "Person still serving in UK armed forces"
hint_text: ""
question_text: "Is the person still serving in the UK armed forces?"
reservist:
page_header: ""
check_answer_label: "Person seriously injured or ill as result of serving in UK armed forces"
hint_text: ""
question_text: "Was the person seriously injured or ill as a result of serving in the UK armed forces?"
preg_occ:
page_header: ""
check_answer_label: "Anybody in household pregnant"
hint_text: ""
question_text: "Is anybody in the household pregnant?"
housingneeds:
page_header: ""
check_answer_label: "Anybody with disabled access needs"
hint_text: ""
question_text: "Does anybody in the household have any disabled access needs?"
housingneeds_type:
page_header: "Disabled access needs"
housingneeds_type:
check_answer_label: "Disabled access needs"
hint_text: ""
question_text: "What type of access needs do they have?"
housingneeds_other:
check_answer_label: "Other disabled access needs"
hint_text: ""
question_text: "Do they have any other disabled access needs?"
illness:
page_header: ""
check_answer_label: "Anybody in household with physical or mental health condition"
hint_text: ""
question_text: "Does anybody in the household have a physical or mental health condition (or other illness) expected to last 12 months or more?"
condition_effects:
page_header: ""
check_answer_label: "How is person affected by condition or illness"
hint_text: "Select all that apply."
question_text: "How is the person affected by their condition or illness?"
Loading…
Cancel
Save