diff --git a/app/controllers/locations_controller.rb b/app/controllers/locations_controller.rb index 83e90c373..b84185b51 100644 --- a/app/controllers/locations_controller.rb +++ b/app/controllers/locations_controller.rb @@ -40,6 +40,8 @@ class LocationsController < ApplicationController redirect_to scheme_location_local_authority_path(@scheme, @location, route: params[:route], referrer: params[:referrer]) elsif return_to_check_your_answers? redirect_to scheme_location_check_answers_path(@scheme, @location, route: params[:route]) + elsif params[:referrer] == "details" + redirect_to scheme_location_path(@scheme, @location) else redirect_to scheme_location_name_path(@scheme, @location, route: params[:route]) end @@ -88,6 +90,8 @@ class LocationsController < ApplicationController if @location.save(context: :units) if return_to_check_your_answers? redirect_to scheme_location_check_answers_path(@scheme, @location, route: params[:route]) + elsif params[:referrer] == "details" + redirect_to scheme_location_path(@scheme, @location) else redirect_to scheme_location_type_of_unit_path(@scheme, @location, route: params[:route]) end @@ -103,6 +107,8 @@ class LocationsController < ApplicationController if @location.save(context: :type_of_unit) if return_to_check_your_answers? redirect_to scheme_location_check_answers_path(@scheme, @location, route: params[:route]) + elsif params[:referrer] == "details" + redirect_to scheme_location_path(@scheme, @location) else redirect_to scheme_location_mobility_standards_path(@scheme, @location, route: params[:route]) end @@ -118,6 +124,8 @@ class LocationsController < ApplicationController if @location.save(context: :mobility_type) if return_to_check_your_answers? redirect_to scheme_location_check_answers_path(@scheme, @location, route: params[:route]) + elsif params[:referrer] == "details" + redirect_to scheme_location_path(@scheme, @location) else redirect_to scheme_location_availability_path(@scheme, @location, route: params[:route]) end diff --git a/app/models/scheme.rb b/app/models/scheme.rb index 1598b31d3..1a75aae8b 100644 --- a/app/models/scheme.rb +++ b/app/models/scheme.rb @@ -188,6 +188,7 @@ class Scheme < ApplicationRecord [ { name: "Scheme code", value: id_to_display, id: "id" }, { name: "Name", value: service_name, id: "service_name", edit: true }, + { name: "Status", value: status, id: "status" }, { name: "Confidential information", value: sensitive, id: "sensitive", edit: true }, { name: "Type of scheme", value: scheme_type, id: "scheme_type", edit: true }, { name: "Registered under Care Standards Act 2000", value: registered_under_care_act, id: "registered_under_care_act", edit: true }, diff --git a/app/views/locations/mobility_standards.html.erb b/app/views/locations/mobility_standards.html.erb index da08f8bfa..a5ed77f49 100644 --- a/app/views/locations/mobility_standards.html.erb +++ b/app/views/locations/mobility_standards.html.erb @@ -24,6 +24,9 @@ <% if params[:referrer] == "check_answers" %> <%= f.govuk_submit "Save changes" %> <%= govuk_link_to "Cancel", scheme_location_check_answers_path(@scheme, @location, route: params[:route]), secondary: true %> + <% elsif params[:referrer] == "details" %> + <%= f.govuk_submit "Save changes" %> + <%= govuk_link_to "Cancel", scheme_location_path(@scheme, @location), secondary: true %> <% else %> <%= f.govuk_submit "Save and continue" %> <%= govuk_link_to "Skip for now", scheme_location_availability_path(@scheme, @location), secondary: true %> diff --git a/app/views/locations/postcode.html.erb b/app/views/locations/postcode.html.erb index fe0505926..5e17c17d5 100644 --- a/app/views/locations/postcode.html.erb +++ b/app/views/locations/postcode.html.erb @@ -26,6 +26,9 @@ <% if params[:referrer] == "check_answers" %> <%= f.govuk_submit "Save changes" %> <%= govuk_link_to "Cancel", scheme_location_check_answers_path(@scheme, @location, route: params[:route]), secondary: true %> + <% elsif params[:referrer] == "details" %> + <%= f.govuk_submit "Save changes" %> + <%= govuk_link_to "Cancel", scheme_location_path(@scheme, @location), secondary: true %> <% else %> <%= f.govuk_submit "Save and continue" %> <%= govuk_link_to "Skip for now", scheme_location_name_path(@scheme, @location), secondary: true %> diff --git a/app/views/locations/show.html.erb b/app/views/locations/show.html.erb index 5d6044f06..f4371213c 100644 --- a/app/views/locations/show.html.erb +++ b/app/views/locations/show.html.erb @@ -19,7 +19,11 @@ <% row.key { attr[:name] } %> <% row.value { attr[:attribute].eql?("status") ? status_tag_from_resource(@location) : details_html(attr) } %> <% if LocationPolicy.new(current_user, @location).update? %> + <% row.action(text: "Change", href: scheme_location_postcode_path(@scheme, @location, referrer: "details")) if attr[:attribute] == "postcode" && current_user.support? %> <% row.action(text: "Change", href: scheme_location_name_path(@scheme, @location, referrer: "details")) if attr[:attribute] == "name" %> + <% row.action(text: "Change", href: scheme_location_units_path(@scheme, @location, referrer: "details")) if attr[:attribute] == "units" && current_user.support? %> + <% row.action(text: "Change", href: scheme_location_type_of_unit_path(@scheme, @location, referrer: "details")) if attr[:attribute] == "type_of_unit" && current_user.support? %> + <% row.action(text: "Change", href: scheme_location_mobility_standards_path(@scheme, @location, referrer: "details")) if attr[:attribute] == "mobility_standards" && current_user.support? %> <% end %> <% end %> <% end %> diff --git a/app/views/locations/type_of_unit.html.erb b/app/views/locations/type_of_unit.html.erb index 45b76ef67..cb7b3db41 100644 --- a/app/views/locations/type_of_unit.html.erb +++ b/app/views/locations/type_of_unit.html.erb @@ -23,6 +23,9 @@ <% if params[:referrer] == "check_answers" %> <%= f.govuk_submit "Save changes" %> <%= govuk_link_to "Cancel", scheme_location_check_answers_path(@scheme, @location, route: params[:route]), secondary: true %> + <% elsif params[:referrer] == "details" %> + <%= f.govuk_submit "Save changes" %> + <%= govuk_link_to "Cancel", scheme_location_path(@scheme, @location), secondary: true %> <% else %> <%= f.govuk_submit "Save and continue" %> <%= govuk_link_to "Skip for now", scheme_location_mobility_standards_path(@scheme, @location), secondary: true %> diff --git a/app/views/locations/units.html.erb b/app/views/locations/units.html.erb index 12365adbb..cf71ef11a 100644 --- a/app/views/locations/units.html.erb +++ b/app/views/locations/units.html.erb @@ -23,6 +23,9 @@ <% if params[:referrer] == "check_answers" %> <%= f.govuk_submit "Save changes" %> <%= govuk_link_to "Cancel", scheme_location_check_answers_path(@scheme, @location, route: params[:route]), secondary: true %> + <% elsif params[:referrer] == "details" %> + <%= f.govuk_submit "Save changes" %> + <%= govuk_link_to "Cancel", scheme_location_path(@scheme, @location), secondary: true %> <% else %> <%= f.govuk_submit "Save and continue" %> <%= govuk_link_to "Skip for now", scheme_location_type_of_unit_path(@scheme, @location), secondary: true %> diff --git a/app/views/schemes/check_answers.html.erb b/app/views/schemes/check_answers.html.erb index 25a7fd221..1020f5d62 100644 --- a/app/views/schemes/check_answers.html.erb +++ b/app/views/schemes/check_answers.html.erb @@ -9,7 +9,7 @@