Browse Source

first page complete

pull/671/head
JG 3 years ago
parent
commit
721f93a212
  1. 10
      app/models/scheme.rb
  2. 19
      app/views/schemes/new.html.erb

10
app/models/scheme.rb

@ -56,6 +56,8 @@ class Scheme < ApplicationRecord
REGISTERED_UNDER_CARE_ACT = {
0 => "No",
1 => "Yes – registered care home providing nursing care",
1 => "Yes – registered care home providing personal care",
1 => "Yes – part registered as a care home",
}.freeze
@ -64,6 +66,14 @@ class Scheme < ApplicationRecord
1 => "Yes",
}.freeze
def scheme_types
SCHEME_TYPE.values
end
def care_act_types
REGISTERED_UNDER_CARE_ACT.values
end
def display_attributes
[
{ name: "Service code", value: code },

19
app/views/schemes/new.html.erb

@ -45,13 +45,26 @@
"data-controller": %w[accessible-autocomplete conditional-filter] %>
<% end %>
<% roles = current_user.assignable_roles.map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize) } %>
<% scheme_types = @resource.scheme_types.map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize) } %>
<%= f.govuk_collection_radio_buttons :scheme_type,
roles,
scheme_types,
:id,
:name,
legend: { text: "Role", size: "m" } %>
legend: { text: "What is this type of scheme?", size: "m" } %>
<% care_act_types = @resource.care_act_types.map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize) } %>
<%= f.govuk_collection_radio_buttons :scheme_type,
care_act_types,
:id,
:name,
legend: { text: "Is this scheme registered under the Care Standards Act 2000?", size: "m" } %>
<%= f.govuk_number_field :service_name,
width: 2,
label: { text: "Total number of units", size: "m" },
hint: { text: "For example, a unit can be a bedroom in a shared house or flat, or a house with 4 bedrooms. Do not include bedrooms used for wardens, managers, volunteers or sleep-in staff." } %>
<%= f.govuk_submit "Save and continue" %>
</div>

Loading…
Cancel
Save