diff --git a/app/models/form/question.rb b/app/models/form/question.rb index 63795f8cf..e4e843c0e 100644 --- a/app/models/form/question.rb +++ b/app/models/form/question.rb @@ -2,12 +2,14 @@ class Form::Question attr_accessor :id, :header, :hint_text, :description, :questions, :type, :min, :max, :step, :width, :fields_to_add, :result_field, :conditional_for, :readonly, :answer_options, :page, :check_answer_label, - :inferred_answers, :hidden_in_check_answers, :inferred_check_answers_value + :inferred_answers, :hidden_in_check_answers, :inferred_check_answers_value, + :guidance_partial def initialize(id, hsh, page) @id = id @check_answer_label = hsh["check_answer_label"] @header = hsh["header"] + @guidance_partial = hsh["guidance_partial"] @hint_text = hsh["hint_text"] @type = hsh["type"] @min = hsh["min"] diff --git a/app/views/form/_checkbox_question.html.erb b/app/views/form/_checkbox_question.html.erb index 053d4499e..d351be1d1 100644 --- a/app/views/form/_checkbox_question.html.erb +++ b/app/views/form/_checkbox_question.html.erb @@ -1,3 +1,5 @@ +<%= render partial: "form/guidance/#{question.guidance_partial}" if question.guidance_partial %> + <%= f.govuk_check_boxes_fieldset question.id.to_sym, caption: caption && !page_header.present? ? { text: caption.html_safe, size: "l" } : nil, legend: { text: question.header.html_safe, size: !page_header.present? ? "l" : "m", tag: !page_header.present? ? "h1" : "h2" }, diff --git a/app/views/form/_date_question.html.erb b/app/views/form/_date_question.html.erb index b4f107cf6..3a1ddafa8 100644 --- a/app/views/form/_date_question.html.erb +++ b/app/views/form/_date_question.html.erb @@ -1,3 +1,5 @@ +<%= render partial: "form/guidance/#{question.guidance_partial}" if question.guidance_partial %> + <%= f.govuk_date_field question.id.to_sym, caption: caption && !page_header.present? ? { text: caption.html_safe, size: "l" } : nil, legend: { text: question.header.html_safe, size: !page_header.present? ? "l" : "m", tag: !page_header.present? ? "h1" : "h2" }, diff --git a/app/views/form/_numeric_question.html.erb b/app/views/form/_numeric_question.html.erb index 905477169..49872e8ee 100644 --- a/app/views/form/_numeric_question.html.erb +++ b/app/views/form/_numeric_question.html.erb @@ -1,3 +1,5 @@ +<%= render partial: "form/guidance/#{question.guidance_partial}" if question.guidance_partial %> + <%= f.govuk_number_field question.id.to_sym, caption: caption && !page_header.present? ? { text: caption.html_safe, size: "l" } : nil, label: { text: question.header.html_safe, size: !page_header.present? ? "l" : "m", tag: !page_header.present? ? "h1" : "h2" }, diff --git a/app/views/form/_radio_question.html.erb b/app/views/form/_radio_question.html.erb index aef21a90d..d7f94a8e9 100644 --- a/app/views/form/_radio_question.html.erb +++ b/app/views/form/_radio_question.html.erb @@ -1,3 +1,5 @@ +<%= render partial: "form/guidance/#{question.guidance_partial}" if question.guidance_partial %> + <%= f.govuk_radio_buttons_fieldset question.id.to_sym, caption: caption && !page_header.present? ? { text: caption.html_safe, size: "l" } : nil, legend: { text: question.header.html_safe, size: !page_header.present? ? "l" : "m", tag: !page_header.present? ? "h1" : "h2" }, diff --git a/app/views/form/_select_question.html.erb b/app/views/form/_select_question.html.erb index f3a07ae4c..6909d8470 100644 --- a/app/views/form/_select_question.html.erb +++ b/app/views/form/_select_question.html.erb @@ -1,3 +1,5 @@ +<%= render partial: "form/guidance/#{question.guidance_partial}" if question.guidance_partial %> + <% selected = CaseLog::UK_LA[@case_log.public_send(question.id)] || "" %> <%= answers = question.answer_options.map { |key, value| OpenStruct.new(id: key, name: value) } f.govuk_collection_select question.id.to_sym, diff --git a/app/views/form/_text_question.html.erb b/app/views/form/_text_question.html.erb index 76c690787..dbf1cd92e 100644 --- a/app/views/form/_text_question.html.erb +++ b/app/views/form/_text_question.html.erb @@ -1,3 +1,5 @@ +<%= render partial: "form/guidance/#{question.guidance_partial}" if question.guidance_partial %> + <%= f.govuk_text_field question.id.to_sym, caption: caption && !page_header.present? ? { text: caption.html_safe, size: "l" } : nil, label: { text: question.header.html_safe, size: !page_header.present? ? "l" : "m", tag: !page_header.present? ? "h1" : "h2" }, diff --git a/app/views/form/_textarea_question.html.erb b/app/views/form/_textarea_question.html.erb index 1f062eb9f..3623d32c7 100644 --- a/app/views/form/_textarea_question.html.erb +++ b/app/views/form/_textarea_question.html.erb @@ -1,3 +1,5 @@ +<%= render partial: "form/guidance/#{question.guidance_partial}" if question.guidance_partial %> + <%= f.govuk_text_area question.id.to_sym, caption: caption && !page_header.present? ? { text: caption.html_safe, size: "l" } : nil, label: { text: question.header.html_safe, size: !page_header.present? ? "l" : "m", tag: !page_header.present? ? "h1" : "h2" }, diff --git a/app/views/form/guidance/_what_counts_as_income.html.erb b/app/views/form/guidance/_what_counts_as_income.html.erb new file mode 100644 index 000000000..078a1db20 --- /dev/null +++ b/app/views/form/guidance/_what_counts_as_income.html.erb @@ -0,0 +1,25 @@ +
+ + + What counts as income? + + +
+ +

You should include any income from:

+ + +

Don’t include:

+ + +
+
diff --git a/config/forms/2021_2022.json b/config/forms/2021_2022.json index a270b8df4..d6552218e 100644 --- a/config/forms/2021_2022.json +++ b/config/forms/2021_2022.json @@ -1796,18 +1796,21 @@ "depends_on": { "about_this_log": "completed" }, "pages": { "net_income": { - "header": "", + "header": "Household’s combined income", "description": "", "questions": { "net_income_known": { "check_answer_label": "Income known", - "header": "Do you know the tenant and their partner’s net income?", + "header": "Do you know the household’s combined income after tax?", + "guidance_partial": "what_counts_as_income", "hint_text": "", "type": "radio", "answer_options": { - "0": "Yes", - "1": "No", - "2": "Tenant prefers not to say" + "0": "Yes – the household has a weekly income", + "1": "Yes – the household has a monthly income", + "2": "Yes – the household has a yearly income", + "divider_a": true, + "3": "Tenant prefers not to say" }, "conditional_for": { "earnings": ["Yes"],