8 changed files with 214 additions and 101 deletions
@ -1,114 +1,129 @@ |
|||||||
<% content_for :before_content do %> |
<% content_for :before_content do %> |
||||||
<%= govuk_back_link href: schemes_organisation_path(@organisation) %> |
<%= govuk_back_link href: schemes_organisation_path(@organisation) %> |
||||||
<% end %> |
<% end %> |
||||||
|
<%= form_with model: @organisation, url: schemes_duplicates_organisation_path(@organisation), method: "post" do |f| %> |
||||||
|
<%= f.govuk_error_summary %> |
||||||
|
|
||||||
<% title = "Review these sets of schemes and locations" %> |
<% title = "Review these sets of schemes and locations" %> |
||||||
<% content_for :title, title %> |
<% content_for :title, title %> |
||||||
|
|
||||||
<% if current_user.support? %> |
<% if current_user.support? %> |
||||||
<%= render SubNavigationComponent.new( |
<%= render SubNavigationComponent.new( |
||||||
items: secondary_items(request.path, @organisation.id), |
items: secondary_items(request.path, @organisation.id), |
||||||
) %> |
) %> |
||||||
<% end %> |
<% end %> |
||||||
|
|
||||||
<div class="govuk-grid-row"> |
<div class="govuk-grid-row"> |
||||||
<div class="govuk-grid-column-two-thirds-from-desktop"> |
<div class="govuk-grid-column-two-thirds-from-desktop"> |
||||||
<h1 class="govuk-heading-xl"><%= title %></h1> |
<h1 class="govuk-heading-xl"><%= title %></h1> |
||||||
|
|
||||||
<p class="govuk-body">Since your organisation recently merged, we’ve reviewed your schemes for possible duplicates.</p> |
<p class="govuk-body">Since your organisation recently merged, we’ve reviewed your schemes for possible duplicates.</p> |
||||||
<p class="govuk-body">These sets of schemes and locations might be duplicates because they have the same answers for certain fields.</p> |
<p class="govuk-body">These sets of schemes and locations might be duplicates because they have the same answers for certain fields.</p> |
||||||
<h2 class="govuk-heading-m">What you need to do</h2> |
<h2 class="govuk-heading-m">What you need to do</h2> |
||||||
<ul class="govuk-list govuk-list--bullet"> |
<ul class="govuk-list govuk-list--bullet"> |
||||||
<li>Review each set of schemes or locations and decide if they are duplicates.</li> |
<li>Review each set of schemes or locations and decide if they are duplicates.</li> |
||||||
<li>If they are, choose one to keep and deactivate the others on the date your organisation merged.</li> |
<li>If they are, choose one to keep and deactivate the others on the date your organisation merged.</li> |
||||||
<li>When you have resolved all duplicates, confirm below.</li> |
<li>When you have resolved all duplicates, confirm below.</li> |
||||||
</ul> |
</ul> |
||||||
<p class="govuk-body">If you need help with this, <%= govuk_link_to "contact the helpdesk (opens in a new tab)", GlobalConstants::HELPDESK_URL, target: "#" %>.</p> |
<p class="govuk-body">If you need help with this, <%= govuk_link_to "contact the helpdesk (opens in a new tab)", GlobalConstants::HELPDESK_URL, target: "#" %>.</p> |
||||||
|
|
||||||
<% if @duplicate_schemes.any? %> |
<% if @duplicate_schemes.any? %> |
||||||
<h2 class="govuk-heading-m"><%= @duplicate_schemes.count == 1 ? "This set" : "These #{@duplicate_schemes.count} sets" %> of schemes might have duplicates</h2> |
<h2 class="govuk-heading-m"><%= @duplicate_schemes.count == 1 ? "This set" : "These #{@duplicate_schemes.count} sets" %> of schemes might have duplicates</h2> |
||||||
|
|
||||||
<%= govuk_details(summary_text: "Why are these schemes identified as duplicates?") do %> |
<%= govuk_details(summary_text: "Why are these schemes identified as duplicates?") do %> |
||||||
<p class="govuk-body"> |
<p class="govuk-body"> |
||||||
These schemes have the same answers for the following fields: |
These schemes have the same answers for the following fields: |
||||||
</p> |
</p> |
||||||
<ul class="govuk-list govuk-list--bullet"> |
<ul class="govuk-list govuk-list--bullet"> |
||||||
<li>Type of scheme</li> |
<li>Type of scheme</li> |
||||||
<li>Registered under Care Standards Act 2000</li> |
<li>Registered under Care Standards Act 2000</li> |
||||||
<li>Housing stock owned by</li> |
<li>Housing stock owned by</li> |
||||||
<li>Support services provided by</li> |
<li>Support services provided by</li> |
||||||
<li>Primary client group</li> |
<li>Primary client group</li> |
||||||
<li>Has another client group</li> |
<li>Has another client group</li> |
||||||
<li>Secondary client group</li> |
<li>Secondary client group</li> |
||||||
<li>Level of support given</li> |
<li>Level of support given</li> |
||||||
<li>Intended length of stay</li> |
<li>Intended length of stay</li> |
||||||
</ul> |
</ul> |
||||||
<% end %> |
<% end %> |
||||||
|
|
||||||
<%= govuk_table do |table| %> |
<%= govuk_table do |table| %> |
||||||
<%= table.with_head do |head| %> |
<%= table.with_head do |head| %> |
||||||
<% head.with_row do |row| %> |
<% head.with_row do |row| %> |
||||||
<% row.with_cell(header: true, text: "Schemes") %> |
<% row.with_cell(header: true, text: "Schemes") %> |
||||||
<% end %> |
<% end %> |
||||||
|
|
||||||
<%= table.with_body do |body| %> |
<%= table.with_body do |body| %> |
||||||
<% @duplicate_schemes.each do |duplicate_set| %> |
<% @duplicate_schemes.each do |duplicate_set| %> |
||||||
<% body.with_row do |row| %> |
<% body.with_row do |row| %> |
||||||
<% row.with_cell do %> |
<% row.with_cell do %> |
||||||
<ol class="govuk-list govuk-list--number"> |
<ol class="govuk-list govuk-list--number"> |
||||||
<% duplicate_set.each do |scheme| %> |
<% duplicate_set.each do |scheme| %> |
||||||
<li> |
<li> |
||||||
<%= govuk_link_to scheme.service_name, scheme %> |
<%= govuk_link_to scheme.service_name, scheme %> |
||||||
</li> |
</li> |
||||||
<% end %> |
<% end %> |
||||||
</ol> |
</ol> |
||||||
|
<% end %> |
||||||
<% end %> |
<% end %> |
||||||
<% end %> |
<% end %> |
||||||
<% end %> |
<% end %> |
||||||
<% end %> |
<% end %> |
||||||
<% end %> |
<% end %> |
||||||
<% end %> |
<% end %> |
||||||
<% end %> |
|
||||||
|
|
||||||
<% if @duplicate_locations.any? %> |
<% if @duplicate_locations.any? %> |
||||||
<h2 class="govuk-heading-m"><%= @duplicate_locations.count == 1 ? "This set" : "These #{@duplicate_locations.count} sets" %> of locations might have duplicates</h2> |
<h2 class="govuk-heading-m"><%= @duplicate_locations.count == 1 ? "This set" : "These #{@duplicate_locations.count} sets" %> of locations might have duplicates</h2> |
||||||
<%= govuk_details(summary_text: "Why are these locations identified as duplicates?") do %> |
<%= govuk_details(summary_text: "Why are these locations identified as duplicates?") do %> |
||||||
<p class="govuk-body"> |
<p class="govuk-body"> |
||||||
These locations belong to the same scheme and have the same answers for the following fields: |
These locations belong to the same scheme and have the same answers for the following fields: |
||||||
</p> |
</p> |
||||||
<ul class="govuk-list govuk-list--bullet"> |
<ul class="govuk-list govuk-list--bullet"> |
||||||
<li>Postcode</li> |
<li>Postcode</li> |
||||||
<li>Mobility standards</li> |
<li>Mobility standards</li> |
||||||
</ul> |
</ul> |
||||||
<% end %> |
<% end %> |
||||||
|
|
||||||
<%= govuk_table do |table| %> |
<%= govuk_table do |table| %> |
||||||
<%= table.with_head do |head| %> |
<%= table.with_head do |head| %> |
||||||
<% head.with_row do |row| %> |
<% head.with_row do |row| %> |
||||||
<% row.with_cell(header: true, text: "Locations") %> |
<% row.with_cell(header: true, text: "Locations") %> |
||||||
<% row.with_cell(header: true, text: "Scheme") %> |
<% row.with_cell(header: true, text: "Scheme") %> |
||||||
<% end %> |
<% end %> |
||||||
|
|
||||||
<%= table.with_body do |body| %> |
<%= table.with_body do |body| %> |
||||||
<% @duplicate_locations.each do |duplicate_set| %> |
<% @duplicate_locations.each do |duplicate_set| %> |
||||||
<% body.with_row do |row| %> |
<% body.with_row do |row| %> |
||||||
<% row.with_cell do %> |
<% row.with_cell do %> |
||||||
<ol class="govuk-list govuk-list--number"> |
<ol class="govuk-list govuk-list--number"> |
||||||
<% duplicate_set[:locations].each do |location| %> |
<% duplicate_set[:locations].each do |location| %> |
||||||
<li> |
<li> |
||||||
<%= govuk_link_to location.name, scheme_location_path(location) %> |
<%= govuk_link_to location.name, scheme_location_path(location) %> |
||||||
</li> |
</li> |
||||||
<% end %> |
<% end %> |
||||||
</ol> |
</ol> |
||||||
<% end %> |
<% end %> |
||||||
<% row.with_cell do %> |
<% row.with_cell do %> |
||||||
<%= govuk_link_to duplicate_set[:scheme].service_name, duplicate_set[:scheme] %> |
<%= govuk_link_to duplicate_set[:scheme].service_name, duplicate_set[:scheme] %> |
||||||
|
<% end %> |
||||||
<% end %> |
<% end %> |
||||||
<% end %> |
<% end %> |
||||||
<% end %> |
<% end %> |
||||||
<% end %> |
<% end %> |
||||||
<% end %> |
<% end %> |
||||||
<% end %> |
<% end %> |
||||||
<% end %> |
|
||||||
|
<%= f.govuk_check_boxes_fieldset :scheme_duplicates_checked, |
||||||
|
legend: { text: "Have you resolved all duplicates?" } do %> |
||||||
|
<%= f.govuk_check_box :scheme_duplicates_checked, |
||||||
|
true, |
||||||
|
false, |
||||||
|
multiple: false, |
||||||
|
checked: false, |
||||||
|
label: { text: "Yes, none of the schemes and locations above are duplicates" } %> |
||||||
|
<% end %> |
||||||
|
|
||||||
|
<%= f.govuk_submit "Confirm" %> |
||||||
|
</div> |
||||||
</div> |
</div> |
||||||
</div> |
<% end %> |
||||||
|
|||||||
@ -0,0 +1,5 @@ |
|||||||
|
class AddSchemesDeduplicatedAt < ActiveRecord::Migration[7.0] |
||||||
|
def change |
||||||
|
add_column :organisations, :schemes_deduplicated_at, :datetime |
||||||
|
end |
||||||
|
end |
||||||
Loading…
Reference in new issue