Browse Source

checking for stock owning org selection

pull/671/head
JG 3 years ago
parent
commit
c0abcea457
  1. 12
      app/views/schemes/new.html.erb

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

@ -18,7 +18,7 @@
<%= 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." } %>
hint: { text: "This is how you 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,
"Yes",
@ -26,17 +26,23 @@
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 %>
<%= f.govuk_collection_select :stock_owning_organisation_id,
answer_options,
:id,
:name,
label: { text: "Which organisation owns the housing stock for this scheme?", size: "m" },
"data-controller": %w[accessible-autocomplete conditional-filter] %>
<% if current_user.support? %>
<%= f.govuk_collection_select :organisation_id,
answer_options,
:id,
:name,
label: { text: "Which organisation manages this scheme", size: "m" },
hint: { text: "Enter organisation name" },
"data-controller": %w[accessible-autocomplete conditional-filter] %>
<% end %>

Loading…
Cancel
Save