|
|
|
@ -26,10 +26,6 @@ |
|
|
|
label: { text: "This scheme contains confidential information" } %> |
|
|
|
label: { text: "This scheme contains confidential information" } %> |
|
|
|
<% end %> |
|
|
|
<% end %> |
|
|
|
|
|
|
|
|
|
|
|
<% 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 %> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<% scheme_types_selection = Scheme.scheme_types.keys.excluding("Missing").map { |key, _| OpenStruct.new(id: key, name: key.to_s.humanize) } %> |
|
|
|
<% 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, |
|
|
|
<%= f.govuk_collection_radio_buttons :scheme_type, |
|
|
|
scheme_types_selection, |
|
|
|
scheme_types_selection, |
|
|
|
@ -48,6 +44,12 @@ |
|
|
|
: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" } %> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<% null_option = [OpenStruct.new(id: "", name: "Select an option")] %> |
|
|
|
|
|
|
|
<% all_orgs = Organisation.all.map { |org| OpenStruct.new(id: org.id, name: org.name) } %> |
|
|
|
|
|
|
|
<% user_org = [OpenStruct.new(id: current_user.organisation_id, name: current_user.organisation.name)] %> |
|
|
|
|
|
|
|
<% stock_owners = current_user.organisation.stock_owners.map { |org| OpenStruct.new(id: org.id, name: org.name) } %> |
|
|
|
|
|
|
|
<% answer_options = current_user.support? ? null_option + all_orgs : null_option + user_org + stock_owners %> |
|
|
|
|
|
|
|
|
|
|
|
<% if current_user.data_coordinator? && current_user.organisation.stock_owners.nil? %> |
|
|
|
<% if current_user.data_coordinator? && current_user.organisation.stock_owners.nil? %> |
|
|
|
<%= f.hidden_field :owning_organisation_id, value: current_user.organisation.id %> |
|
|
|
<%= f.hidden_field :owning_organisation_id, value: current_user.organisation.id %> |
|
|
|
<% else %> |
|
|
|
<% else %> |
|
|
|
|