From 19bf5e8c9da1a21c02ef756b8de35d0d27fde87e Mon Sep 17 00:00:00 2001 From: JG Date: Thu, 7 Jul 2022 14:15:05 +0100 Subject: [PATCH] edit-name controller action - leftovers --- app/views/schemes/edit_name.html.erb | 54 ++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 app/views/schemes/edit_name.html.erb diff --git a/app/views/schemes/edit_name.html.erb b/app/views/schemes/edit_name.html.erb new file mode 100644 index 000000000..d74b64bac --- /dev/null +++ b/app/views/schemes/edit_name.html.erb @@ -0,0 +1,54 @@ +<% content_for :title, "Scheme details" %> + + <% content_for :before_content do %> + <%= govuk_back_link( + text: "Back", + href: :back, + ) %> + <% end %> + + <%= render partial: "organisations/headings", locals: { main: "Scheme details", sub: @scheme.service_name } %> + + <%= form_for(@scheme, method: :patch) do |f| %> +
+
+ <%= f.govuk_error_summary %> + + <%= 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, + 1, + 0, + checked: @scheme.sensitive?, + multiple: false, + label: { text: "This scheme contains confidential information" } %> + + <% null_option = [OpenStruct.new(id: "", name: "Select an option")] %> + <% 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, + organisations, + :id, + :name, + label: { text: "Which organisation owns the housing stock for this scheme?", size: "m" }, + "data-controller": %w[accessible-autocomplete conditional-filter] %> + <% end %> + + <%= f.hidden_field :page, value: "edit-name" %> + + <%= f.govuk_submit "Save and continue" %> +
+
+ <% end %>