Browse Source

edit-name controller action - leftovers

pull/717/head
JG 3 years ago
parent
commit
19bf5e8c9d
  1. 54
      app/views/schemes/edit_name.html.erb

54
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| %>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<%= 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" %>
</div>
</div>
<% end %>
Loading…
Cancel
Save