Browse Source

Adjust when to hide org field in scheme creation

pull/2764/head
Rachael Booth 8 months ago
parent
commit
be3e131757
  1. 6
      app/views/schemes/details.html.erb

6
app/views/schemes/details.html.erb

@ -49,11 +49,13 @@
:description, :description,
legend: { text: "Is this scheme registered under the Care Standards Act 2000?", size: "m" } %> legend: { text: "Is this scheme registered under the Care Standards Act 2000?", size: "m" } %>
<% if current_user.data_coordinator? && current_user.organisation.stock_owners.count.zero? && !current_user.organisation.has_recent_absorbed_organisations? %> <% scheme_owning_organisation_options = owning_organisation_options(current_user) %>
<% if scheme_owning_organisation_options.count == 1 %>
<%= f.hidden_field :owning_organisation_id, value: current_user.organisation.id %> <%= f.hidden_field :owning_organisation_id, value: current_user.organisation.id %>
<% else %> <% else %>
<%= f.govuk_collection_select :owning_organisation_id, <%= f.govuk_collection_select :owning_organisation_id,
owning_organisation_options(current_user), scheme_owning_organisation_options,
:id, :id,
:name, :name,
label: { text: "Which organisation owns the housing stock for this scheme?", size: "m" }, label: { text: "Which organisation owns the housing stock for this scheme?", size: "m" },

Loading…
Cancel
Save