You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
2.7 KiB
69 lines
2.7 KiB
<% content_for :title, "Create a new supported housing scheme" %> |
|
|
|
<% content_for :before_content do %> |
|
<%= govuk_back_link( |
|
text: "Back", |
|
href: :back, |
|
) %> |
|
<% end %> |
|
|
|
<%= render partial: "organisations/headings", locals: { main: "Create a new supported housing scheme", sub: nil } %> |
|
|
|
<%= form_for(@scheme, method: :patch, url: @path) do |f| %> |
|
<div class="govuk-grid-row"> |
|
<div class="govuk-grid-column-two-thirds"> |
|
<%= f.govuk_error_summary %> |
|
|
|
<%= f.govuk_text_field :service_name, |
|
label: { text: "Scheme name", size: "m" }, |
|
hint: { text: "This is how you’ll refer to this supported housing scheme within your organisation. For example, the name could relate to the address or location. You’ll be able to see the client group when selecting it." } %> |
|
|
|
<%= f.govuk_check_box :sensitive, |
|
1, |
|
0, |
|
checked: @scheme.sensitive?, |
|
multiple: false, |
|
label: { text: "This scheme contains confidential information" } %> |
|
|
|
<% if current_user.support? %> |
|
<% answer_options = Organisation.all.map { |org| OpenStruct.new(id: org.id, name: org.name) } %> |
|
|
|
<%= f.govuk_collection_select :organisation_id, |
|
answer_options, |
|
:id, |
|
:name, |
|
label: { text: "Which organisation manages this scheme", size: "m" }, |
|
hint: { text: "Enter organisation name" }, |
|
options: { required: true }, |
|
"data-controller": %w[accessible-autocomplete conditional-filter] %> |
|
<% end %> |
|
|
|
<% if current_user.data_coordinator? %> |
|
<%= f.hidden_field :organisation_id, value: current_user.organisation.id %> |
|
<% end %> |
|
|
|
<% scheme_types_selection = Scheme.scheme_types.keys.excluding("Missing").map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize) } %> |
|
|
|
<%= f.govuk_collection_radio_buttons :scheme_type, |
|
scheme_types_selection, |
|
:id, |
|
:name, |
|
legend: { text: "What is this type of scheme?", size: "m" } %> |
|
|
|
<% care_acts_selection = Scheme.registered_under_care_acts.keys.reverse.map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize) } %> |
|
|
|
<%= f.govuk_collection_radio_buttons :registered_under_care_act, |
|
care_acts_selection, |
|
:id, |
|
:name, |
|
legend: { text: "Is this scheme registered under the Care Standards Act 2000?", size: "m" } %> |
|
|
|
<%= f.govuk_number_field :total_units, |
|
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> |
|
</div> |
|
<% end %>
|
|
|