diff --git a/app/controllers/schemes_controller.rb b/app/controllers/schemes_controller.rb index 400318c2c..9c5e4dcc5 100644 --- a/app/controllers/schemes_controller.rb +++ b/app/controllers/schemes_controller.rb @@ -102,7 +102,7 @@ private when "details" scheme_primary_client_group_path(@scheme) when "edit-name" - schemes_path(@scheme) + scheme_path(@scheme) end end diff --git a/app/views/schemes/details.html.erb b/app/views/schemes/details.html.erb index 229165fd4..cd0ce1234 100644 --- a/app/views/schemes/details.html.erb +++ b/app/views/schemes/details.html.erb @@ -18,12 +18,15 @@ 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" } %> + <%= f.govuk_check_boxes_fieldset :sensitive, + legend: { text: "This scheme contains confidential information" } do %> + <%= f.govuk_check_box :sensitive, + 1, + 0, + multiple: false, + checked: @scheme.sensitive == "Yes", + label: { text: "This scheme contains confidential information" } %> + <% end %> <% null_option = [OpenStruct.new(id: "", name: "Select an option")] %> <% organisations = Organisation.all.map { |org| OpenStruct.new(id: org.id, name: org.name) } %> diff --git a/app/views/schemes/edit_name.html.erb b/app/views/schemes/edit_name.html.erb index d74b64bac..4c4e64ef3 100644 --- a/app/views/schemes/edit_name.html.erb +++ b/app/views/schemes/edit_name.html.erb @@ -18,24 +18,19 @@ 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" } %> - - <% null_option = [OpenStruct.new(id: "", name: "Select an option")] %> + + + <%= f.govuk_check_boxes_fieldset :sensitive, + legend: { text: "This scheme contains confidential information" } do %> + <%= f.govuk_check_box :sensitive, + 1, + 0, + multiple: false, + checked: @scheme.sensitive == "Yes", + label: { text: "This scheme contains confidential information" } %> + <% end %> + <% organisations = Organisation.all.map { |org| OpenStruct.new(id: org.id, name: org.name) } %> - <% managing_org_answer_options = null_option + organisations %> - - <%= f.govuk_collection_select :managing_organisation_id, - managing_org_answer_options, - :id, - :name, - label: { text: "Which organisation manages this scheme?", size: "m" }, - options: { required: true }, - "data-controller": %w[accessible-autocomplete conditional-filter] %> <% if current_user.support? %> <%= f.govuk_collection_select :owning_organisation_id, diff --git a/app/views/schemes/new.html.erb b/app/views/schemes/new.html.erb index f4cbc2827..63e60ae63 100644 --- a/app/views/schemes/new.html.erb +++ b/app/views/schemes/new.html.erb @@ -20,11 +20,14 @@ label: { text: "Scheme name", size: "m" }, 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", - checked: @scheme.sensitive?, - multiple: false, - label: { text: "This scheme contains confidential information" } %> + <%= f.govuk_check_boxes_fieldset :sensitive, + legend: { text: "This scheme contains confidential information" } do %> + <%= f.govuk_check_box :sensitive, + 1, + 0, + multiple: false, + label: { text: "This scheme contains confidential information" } %> + <% end %> <% null_option = [OpenStruct.new(id: "", name: "Select an option")] %> <% organisations = Organisation.all.map { |org| OpenStruct.new(id: org.id, name: org.name) } %> diff --git a/app/views/schemes/show.html.erb b/app/views/schemes/show.html.erb index ecc0dd27c..dab90cd8a 100644 --- a/app/views/schemes/show.html.erb +++ b/app/views/schemes/show.html.erb @@ -16,6 +16,7 @@
<%= govuk_summary_list do |summary_list| %> <% @scheme.display_attributes.each do |attr| %> + <% next if current_user.data_coordinator? && attr[:name] == ("Housing stock owned by") %> <%= summary_list.row do |row| %> <% row.key { attr[:name].eql?("Registered under Care Standards Act 2000") ? "Registered under Care Standards Act 2000" : attr[:name].to_s.humanize } %> <% row.value { details_html(attr) } %>