3 changed files with 125 additions and 0 deletions
@ -0,0 +1,14 @@ |
|||||||
|
<% content_for :title, "Check your answers before creating this scheme" %> |
||||||
|
|
||||||
|
<% content_for :before_content do %> |
||||||
|
<%= govuk_back_link( |
||||||
|
text: "Back", |
||||||
|
href: :back, |
||||||
|
) %> |
||||||
|
<% end %> |
||||||
|
|
||||||
|
<div class=class="govuk-tabs"> |
||||||
|
<ul class="govuk-tabs__list"> |
||||||
|
<li class="govuk-tabs__list-item"><li> |
||||||
|
</ul> |
||||||
|
</div> |
@ -0,0 +1,72 @@ |
|||||||
|
<% content_for :title, "Create a new supported housing scheme" %> |
||||||
|
|
||||||
|
<% content_for :before_content do %> |
||||||
|
<%= govuk_back_link( |
||||||
|
text: "Back", |
||||||
|
href: :back, |
||||||
|
) %> |
||||||
|
<% end %> |
||||||
|
|
||||||
|
<%= form_for(@scheme, method: :patch, url: scheme_details_path(scheme_id: @scheme.id)) do |f| %> |
||||||
|
<div class="govuk-grid-row"> |
||||||
|
<div class="govuk-grid-column-two-thirds"> |
||||||
|
<%= f.govuk_error_summary %> |
||||||
|
|
||||||
|
<h1 class="govuk-heading-l"> |
||||||
|
<%= content_for(:title) %> |
||||||
|
</h1> |
||||||
|
|
||||||
|
<%= 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, |
||||||
|
0, |
||||||
|
1, |
||||||
|
multiple: false, |
||||||
|
label: { text: "This scheme contains confidential information" } %> |
||||||
|
|
||||||
|
<% if current_user.support? %> |
||||||
|
<% null_option = [OpenStruct.new(id: "", name: "Select an option")] %> |
||||||
|
<% organisations = Organisation.all.map { |org| OpenStruct.new(id: org.id, name: org.name) } %> |
||||||
|
<% answer_options = null_option + organisations %> |
||||||
|
<% if @organisation_id %> |
||||||
|
<% organisation = Organisation.find(@organisation_id) %> |
||||||
|
<% answer_options = [OpenStruct.new(id: organisation.id, name: organisation.name)] %> |
||||||
|
<% end %> |
||||||
|
|
||||||
|
<%= 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: { disabled: [""], selected: selected_option(answer_options) }, |
||||||
|
"data-controller": %w[accessible-autocomplete conditional-filter] %> |
||||||
|
<% 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 %> |
@ -0,0 +1,39 @@ |
|||||||
|
<% content_for :before_content do %> |
||||||
|
<%= govuk_back_link( |
||||||
|
text: "Back", |
||||||
|
href: :back, |
||||||
|
) %> |
||||||
|
<% end %> |
||||||
|
|
||||||
|
<%= render partial: "organisations/headings", locals: { main: "What support does this scheme provide?", sub: @scheme.service_name } %> |
||||||
|
|
||||||
|
<%= form_for(@scheme, method: :patch, url: scheme_support_path(scheme_id: @scheme.id)) do |f| %> |
||||||
|
<div class="govuk-grid-row"> |
||||||
|
<div class="govuk-grid-column-two-thirds"> |
||||||
|
<%= f.govuk_error_summary %> |
||||||
|
|
||||||
|
<h1 class="govuk-heading-l"> |
||||||
|
<%= content_for(:title) %> |
||||||
|
</h1> |
||||||
|
|
||||||
|
<legend class="govuk-fieldset__legend"> |
||||||
|
</legend> |
||||||
|
|
||||||
|
<% support_type_selection = Scheme.support_types.keys.excluding("Missing").map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize) } %> |
||||||
|
<%= f.govuk_collection_radio_buttons :support_type, |
||||||
|
support_type_selection, |
||||||
|
:id, |
||||||
|
:name, |
||||||
|
legend: { text: "Level of support given", size: "m" } %> |
||||||
|
|
||||||
|
<% intended_stay_selection = Scheme.intended_stays.keys.excluding("Missing").map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize) } %> |
||||||
|
<%= f.govuk_collection_radio_buttons :intended_stay, |
||||||
|
intended_stay_selection, |
||||||
|
:id, |
||||||
|
:name, |
||||||
|
legend: { text: "Intended length of stay", size: "m" } %> |
||||||
|
|
||||||
|
<%= f.govuk_submit "Save and continue" %> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<% end %> |
Loading…
Reference in new issue