Submit social housing lettings and sales data (CORE)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

82 lines
3.2 KiB

<% content_for :title, "Change #{@organisation.name}’s details" %>
<% content_for :before_content do %>
<%= govuk_back_link(href: :back) %>
<% end %>
<%= form_for(@organisation, as: :organisation, html: { method: :patch }) do |f| %>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-l">
<%= content_for(:title) %>
</h1>
<% if current_user.support? %>
<%= f.govuk_text_field :name, autocomplete: "name", label: { size: "m" } %>
<% end %>
<%= f.govuk_text_field :address_line1,
label: { text: "Address line 1", size: "m" },
autocomplete: "address-line1" %>
<%= f.govuk_text_field :address_line2,
label: { text: "Address line 2", size: "m" },
autocomplete: "address-line2" %>
<%= f.govuk_text_field :postcode,
label: { size: "m" },
autocomplete: "postal-code",
width: 10 %>
<%= f.govuk_phone_field :phone,
label: { text: "Telephone number", size: "m" },
autocomplete: "tel",
width: 20 %>
<% if current_user.support? %>
<%= f.govuk_radio_buttons_fieldset :group_member,
legend: { text: "Is this organisation part of a housing provider group structure?", size: "m" } do %>
<%= f.govuk_radio_button :group_member, true,
label: { text: "Yes" },
"data-controller": "conditional-question",
"data-action": "click->conditional-question#displayConditional",
"data-info": { conditional_questions: { group: [true] }, type: "organisation" }.to_json do %>
<%= f.govuk_collection_select :group,
group_organisation_options,
:id,
:name,
label: { text: "Search for an organisation that is part of the same group as this organisation", size: "m" },
options: { disabled: [""], selected: @organisation.group || "" },
"data-controller": %w[accessible-autocomplete conditional-filter] %>
<% end %>
<%= f.govuk_radio_button :group_member, false, label: { text: "No" } %>
<% end %>
<%= f.govuk_collection_select :profit_status,
profit_status_options(@organisation.provider_type),
:id,
:name,
label: { text: "Is the organisation for-profit?", size: "m" },
options: { disabled: [""], selected: @organisation.profit_status || "" } %>
<% end %>
<%= f.govuk_check_boxes_fieldset :rent_periods,
legend: { text: "What are the rent periods for the organisation?" },
hint: { text: "It is not possible to deselect rent periods that are used in logs" } do %>
<% @rent_periods.map do |key, period| %>
<%= f.govuk_check_box :rent_periods,
key,
label: { text: period["value"] },
checked: period[:checked],
disabled: @used_rent_periods.include?(key) %>
<% end %>
<% end %>
<% @rent_periods.keys.each do |period_key| %>
<%= f.hidden_field :all_rent_periods, value: period_key, multiple: true %>
<% end %>
<%= f.govuk_submit "Save changes" %>
</div>
</div>
<% end %>