Browse Source

Update guidance content, add scheme changes page

CLDC-2640-location-guidance
Kat 1 year ago
parent
commit
da38896a72
  1. 4
      app/controllers/organisations_controller.rb
  2. 6
      app/controllers/schemes_controller.rb
  3. 1
      app/models/form/lettings/pages/scheme.rb
  4. 1
      app/models/form/lettings/questions/scheme_id.rb
  5. 4
      app/policies/scheme_policy.rb
  6. 3
      app/views/form/_select_question.html.erb
  7. 5
      app/views/form/guidance/_finding_scheme.erb
  8. 2
      app/views/form/guidance/_scheme_selection.html.erb
  9. 29
      app/views/schemes/changes.html.erb
  10. 1
      config/routes.rb

4
app/controllers/organisations_controller.rb

@ -200,6 +200,10 @@ class OrganisationsController < ApplicationController
redirect_to details_organisation_path(@organisation)
end
def changes
render "schemes/changes"
end
private
def filter_type

6
app/controllers/schemes_controller.rb

@ -3,7 +3,7 @@ class SchemesController < ApplicationController
include Modules::SearchFilter
before_action :authenticate_user!
before_action :find_resource, except: %i[index create new]
before_action :find_resource, except: %i[index create new changes]
before_action :redirect_if_scheme_confirmed, only: %i[primary_client_group confirm_secondary_client_group secondary_client_group support details]
before_action :authorize_user
before_action :session_filters, if: :current_user, only: %i[index]
@ -201,6 +201,10 @@ class SchemesController < ApplicationController
render "schemes/edit_name"
end
def changes
render "schemes/changes"
end
private
def authorize_user

1
app/models/form/lettings/pages/scheme.rb

@ -6,6 +6,7 @@ class Form::Lettings::Pages::Scheme < ::Form::Page
"needstype" => 2,
},
]
@header = "Scheme"
@next_unresolved_page_id = "location"
end

1
app/models/form/lettings/questions/scheme_id.rb

@ -6,6 +6,7 @@ class Form::Lettings::Questions::SchemeId < ::Form::Question
@hint_text = "Enter scheme name or postcode"
@type = "select"
@answer_options = answer_options
@top_guidance_partial = "finding_scheme"
@bottom_guidance_partial = "scheme_selection"
@question_number = 9
@inferred_answers = {

4
app/policies/scheme_policy.rb

@ -30,6 +30,10 @@ class SchemePolicy
user.data_coordinator? && (scheme&.owning_organisation == user.organisation)
end
def changes?
true
end
%w[
show?
check_answers?

3
app/views/form/_select_question.html.erb

@ -1,7 +1,8 @@
<%= render partial: "form/guidance/#{question.top_guidance_partial}" if question.top_guidance? %>
<% selected = @log.public_send(question.id) || "" %>
<% answers = question.displayed_answer_options(@log, current_user).map { |key, value| OpenStruct.new(id: key, name: value.respond_to?(:service_name) ? value.service_name : nil, resource: value) } %>
<%= render partial: "form/guidance/#{question.top_guidance_partial}" if question.top_guidance? %>
<%= f.govuk_select(question.id.to_sym,
label: legend(question, page_header, conditional),
"data-controller": "accessible-autocomplete",

5
app/views/form/guidance/_finding_scheme.erb

@ -0,0 +1,5 @@
<%= govuk_details(summary_text: "Can’t find your scheme?") do %>
<p class="govuk-body">If your organisation’s schemes were migrated from old CORE, they may have new names and codes. Search by postcode to find your scheme.</p>
<p class="govuk-body"><%= govuk_link_to("View your organisation’s schemes.", schemes_path) %></p>
<p class="govuk-body"><%= govuk_link_to("Read more about how schemes have changed", scheme_changes_path) %></p>
<% end %>

2
app/views/form/guidance/_scheme_selection.html.erb

@ -1,5 +1,5 @@
<% if current_user.data_provider? %>
<p class="govuk-body">If you can’t find the supported housing service you’re looking for or not sure which to choose, contact a data coordinator at <%= current_user.organisation.name %>.</p>
<% elsif current_user.data_coordinator? %>
<p class="govuk-body">or <%= govuk_link_to "create a new supported housing service", new_scheme_path %></p>
<p class="govuk-body"><%= govuk_link_to "Create a new supported housing scheme", new_scheme_path %></p>
<% end %>

29
app/views/schemes/changes.html.erb

@ -0,0 +1,29 @@
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds-from-desktop">
<h1 class="govuk-heading-l">Schemes and locations</h1>
<h2 class="govuk-heading-m">What is a scheme?</h2>
<p class="govuk-body">A supported housing scheme (also known as a ‘supported housing service’) provides shared or self-contained housing for a particular client group, for example younger or vulnerable people.</p>
<h2 class="govuk-heading-m">What is a location?</h2>
<p class="govuk-body">A location is a postcode where supported housing is provided under a scheme. A scheme can have multiple locations, and a location can have multiple units at the same postcode.</p>
<h2 class="govuk-heading-m">How schemes have changed</h2>
<p class="govuk-body">We have restructured the way we group supported housing scheme data.</p>
<p class="govuk-body">On old CORE, a scheme’s data was split into management group and scheme. On new CORE, the data is split into scheme and location.</p>
<p class="govuk-body">These are the main changes:</p>
<ul class="govuk-list govuk-list--bullet">
<li>Schemes now store data about the stock owner and support provider. This was previously stored in management group.</li>
<li>Schemes still store data about the type of support, as they did in old CORE.</li>
<li>Schemes no longer store data about postcodes where support is provided. These are now in locations.</li>
</ul>
<p class="govuk-body">This new structure means data coordinators only needs to fill in support details once.</p>
<h2 class="govuk-heading-m">How schemes are migrated from old CORE</h2>
<p class="govuk-body">If your organisation has migrated from old CORE to new CORE, your existing schemes are on the <%= govuk_link_to("schemes page", schemes_path) %>, with the same details.</p>
<p class="govuk-body">Your migrated schemes have been restructured to match the new structure described above. Schemes with the same support details have been combined to prevent duplicates.</p>
<p class="govuk-body">All migrated schemes have new names and codes. The new scheme names were created automatically based on their support details. Some of these auto-generated names are quite long, so we recommend data coordinators rename them.</p>
<p class="govuk-body">If you upload logs in bulk, you can use either the new or old scheme codes in your template.</p>
<h2 class="govuk-heading-m">If you can’t find a scheme</h2>
<p class="govuk-body">You should be able to recognise a scheme migrated from old CORE by viewing its details or locations. Try searching for it by postcode.</p>
<p class="govuk-body">If you still can’t find a scheme that was migrated from old CORE, either create a new one if you know the details, or <%= govuk_link_to("contact the service desk", "https://dluhcdigital.atlassian.net/servicedesk/customer/portal/6/group/11", rel: "noreferrer noopener", target: "_blank") %> to report the problem. Only data coordinators can create and edit schemes.</p>
</div>
</div>

1
config/routes.rb

@ -104,6 +104,7 @@ Rails.application.routes.draw do
patch "reactivate", to: "locations#reactivate"
end
end
get "scheme-changes", to: "schemes#changes"
resources :duplicate_logs, only: [:index], path: "/duplicate-logs"

Loading…
Cancel
Save