diff --git a/app/models/scheme.rb b/app/models/scheme.rb index 42cf2e79b..6be227e83 100644 --- a/app/models/scheme.rb +++ b/app/models/scheme.rb @@ -151,30 +151,4 @@ class Scheme < ApplicationRecord { name: "Intended length of stay", value: intended_stay }, ] end - - def care_acts_options_with_hints - hints = { "Yes – part registered as a care home": "A proportion of units are registered as being a care home." } - - Scheme.registered_under_care_acts.keys.map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize, description: hints[key.to_sym]) } - end - - def support_level_options_with_hints - hints = { - "Low level": "Staff visiting once a week, fortnightly or less.", - "Medium level": "Staff on site daily or making frequent visits with some out-of-hours cover.", - "High level": "Intensive level of staffing provided on a 24-hour basis.", - } - Scheme.support_types.keys.excluding("Missing").map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize, description: hints[key.to_sym]) } - end - - def intended_length_of_stay_options_with_hints - hints = { - "Very short stay": "Up to one month.", - "Short stay": "Up to one year.", - "Medium stay": "More than one year but with an expectation to move on.", - "Permanent": "Provides a home for life with no requirement for the tenant to move.", - - } - Scheme.intended_stays.keys.excluding("Missing").map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize, description: hints[key.to_sym]) } - end end diff --git a/app/views/schemes/details.html.erb b/app/views/schemes/details.html.erb index 71e2e5df9..788c36ce6 100644 --- a/app/views/schemes/details.html.erb +++ b/app/views/schemes/details.html.erb @@ -40,8 +40,12 @@ :name, legend: { text: "What is this type of scheme?", size: "m" } %> + <% care_acts_options_hints = { "Yes – part registered as a care home": "A proportion of units are registered as being a care home." } %> + + <% care_acts_options_with_hints = Scheme.registered_under_care_acts.keys.map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize, description: care_acts_options_hints[key.to_sym]) } %> + <%= f.govuk_collection_radio_buttons :registered_under_care_act, - @scheme.care_acts_options_with_hints, + care_acts_options_with_hints, :id, :name, :description, diff --git a/app/views/schemes/new.html.erb b/app/views/schemes/new.html.erb index 9da4d1d95..eca8de2a3 100644 --- a/app/views/schemes/new.html.erb +++ b/app/views/schemes/new.html.erb @@ -44,8 +44,12 @@ :name, legend: { text: "What is this type of scheme?", size: "m" } %> + <% care_acts_options_hints = { "Yes – part registered as a care home": "A proportion of units are registered as being a care home." } %> + + <% care_acts_options_with_hints = Scheme.registered_under_care_acts.keys.map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize, description: care_acts_options_hints[key.to_sym]) } %> + <%= f.govuk_collection_radio_buttons :registered_under_care_act, - @scheme.care_acts_options_with_hints, + care_acts_options_with_hints, :id, :name, :description, diff --git a/app/views/schemes/support.html.erb b/app/views/schemes/support.html.erb index 5ecf2529c..dd2758cfd 100644 --- a/app/views/schemes/support.html.erb +++ b/app/views/schemes/support.html.erb @@ -14,17 +14,24 @@
<%= f.govuk_error_summary %> + <% support_level_options_hints = { "Low level": "Staff visiting once a week, fortnightly or less.", "Medium level": "Staff on site daily or making frequent visits with some out-of-hours cover.", "High level": "Intensive level of staffing provided on a 24-hour basis." } %> + + <% support_level_options_with_hints = Scheme.support_types.keys.excluding("Missing").map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize, description: support_level_options_hints[key.to_sym]) } %> + <%= f.govuk_collection_radio_buttons :support_type, - @scheme.support_level_options_with_hints, + support_level_options_with_hints, :id, :name, :description, legend: { text: "Level of support given", size: "m" }, bold_labels: false %> - <% intended_stay_selection = Scheme.intended_stays.keys.excluding("Missing").map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize) } %> + <% intended_length_of_stay_options_hints = { "Very short stay": "Up to one month.", "Short stay": "Up to one year.", "Medium stay": "More than one year but with an expectation to move on.", "Permanent": "Provides a home for life with no requirement for the tenant to move." } %> + + <% intended_length_of_stay_options_with_hints = Scheme.intended_stays.keys.excluding("Missing").map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize, description: intended_length_of_stay_options_hints[key.to_sym]) } %> + <%= f.govuk_collection_radio_buttons :intended_stay, - @scheme.intended_length_of_stay_options_with_hints, + intended_length_of_stay_options_with_hints, :id, :name, :description,