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 %>