diff --git a/app/helpers/tab_nav_helper.rb b/app/helpers/tab_nav_helper.rb index 1d2cf4063..1d42332f9 100644 --- a/app/helpers/tab_nav_helper.rb +++ b/app/helpers/tab_nav_helper.rb @@ -7,7 +7,7 @@ module TabNavHelper end def location_cell_postcode(location, link) - link_text = location.postcode + link_text = location.postcode || "Add postcode" [govuk_link_to(link_text, link, method: :patch), "Location #{location.name}"].join("\n") end diff --git a/app/views/locations/check_answers.html.erb b/app/views/locations/check_answers.html.erb index a0999290d..cba0d51fe 100644 --- a/app/views/locations/check_answers.html.erb +++ b/app/views/locations/check_answers.html.erb @@ -18,7 +18,14 @@ <% next if %w[location_code status].include? attr[:attribute] %> <%= summary_list.row do |row| %> <% row.key { attr[:name] } %> - <% row.value { attr[:attribute].eql?("status") ? status_tag(attr[:value]) : details_html(attr) } %> + <% row.value { + if attr[:attribute].eql?("status") + status_tag(attr[:value]) + elsif attr[:attribute].eql?("availability") + details_html(name: "Availability", value: @location.startdate.to_formatted_s(:govuk_date), attribute: "startdate") + else + details_html(attr) + end } %> <% row.action(text: "Change", href: location_edit_path(@location, attr[:attribute])) unless attr[:name] == "Status" %> <% end %> <% end %> @@ -27,7 +34,7 @@ <%= f.hidden_field :confirmed %>
<% end %> diff --git a/app/views/locations/index.html.erb b/app/views/locations/index.html.erb index 5b2cbae47..d6673233d 100644 --- a/app/views/locations/index.html.erb +++ b/app/views/locations/index.html.erb @@ -52,7 +52,7 @@ <%= table.body do |body| %> <%= body.row do |row| %> <% row.cell(text: location.id) %> - <% row.cell(text: simple_format(location_cell_postcode(location, "/schemes/#{@scheme.id}/locations/#{location.id}"), { class: "govuk-!-font-weight-bold" }, wrapper_tag: "div")) %> + <% row.cell(text: simple_format(location_cell_postcode(location, "/schemes/#{@scheme.id}/locations/#{location.id}/check-answers"), { class: "govuk-!-font-weight-bold" }, wrapper_tag: "div")) %> <% row.cell(text: location.units) %> <% row.cell(text: simple_format("#{location.type_of_unit}")) %> <% row.cell(text: location.mobility_type) %>