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.
 
 
 
 

47 lines
2.0 KiB

<% title = @location.name %>
<% content_for :title, title %>
<% content_for :before_content do %>
<%= govuk_back_link(
text: "Back",
href: case params[:route]
when "locations"
scheme_locations_path(@scheme)
else
:back
end,
) %>
<% end %>
<%= form_for(@location, method: :patch, url: scheme_location_check_answers_path(@scheme, @location, route: params[:route])) do |f| %>
<%= render partial: "organisations/headings", locals: { main: "Check your answers", sub: "Add a location to #{@scheme.service_name}" } %>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds-from-desktop">
<%= govuk_summary_list do |summary_list| %>
<% display_location_attributes(@location).each do |attr| %>
<% next if %w[location_code status].include? attr[:attribute] %>
<%= summary_list.row do |row| %>
<% row.key { attr[:name] } %>
<%= row.value do %>
<% case attr[:attribute]
when "status"
status_tag(attr[:value])
when "availability"
details_html(name: "Availability", value: @location.startdate.present? ? @location.startdate.to_formatted_s(:govuk_date) : nil, attribute: "startdate")
else
details_html(attr)
end %>
<% end %>
<% row.action(text: attr[:value].blank? || (attr[:attribute] == "availability" && @location.startdate.blank?) ? "Answer" : "Change", href: location_edit_path(@location, attr[:attribute])) unless attr[:attribute] == "status" %>
<% end %>
<% end %>
<% end %>
</div>
</div>
<%= f.hidden_field :confirmed %>
<div class="govuk-button-group">
<%= f.govuk_submit "Add this location", disabled: @location.incomplete? %>
<%= govuk_button_link_to "Cancel", scheme_locations_path(@scheme), secondary: true %>
</div>
<% end %>