Browse Source

CLDC-4157: Remove redundant scheme hint functions

CLDC-4157-remove-nursing-care-from-scheme-support
samyou-softwire 1 week ago
parent
commit
eb2c96adde
  1. 4
      app/models/scheme.rb
  2. 12
      app/views/schemes/support.html.erb

4
app/models/scheme.rb

@ -264,7 +264,7 @@ class Scheme < ApplicationRecord
Scheme.registered_under_care_acts.keys.map { |key, _| OpenStruct.new(id: key, name: key.to_s) }
end
def support_level_options_with_hints
def self.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.",
@ -273,7 +273,7 @@ class Scheme < ApplicationRecord
Scheme.support_types.keys.excluding("Missing").excluding("Floating support").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
def self.intended_length_of_stay_options_with_hints
hints = {
"Very short stay": "Up to one month.",
"Short stay": "Up to one year.",

12
app/views/schemes/support.html.erb

@ -12,23 +12,15 @@
<%= render partial: "organisations/headings", locals: { main: "What support does this scheme provide?", sub: @scheme.service_name } %>
<%= govuk_inset_text(text: "Only update a scheme if you’re fixing an error. If the scheme is changing, create a new scheme.") if @scheme.confirmed? %>
<% 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").excluding("Floating support").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,
support_level_options_with_hints,
Scheme.support_level_options_with_hints,
:id,
:name,
:description,
legend: { text: "Level of support given", size: "m" } %>
<% 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,
intended_length_of_stay_options_with_hints,
Scheme.intended_length_of_stay_options_with_hints,
:id,
:name,
:description,

Loading…
Cancel
Save