diff --git a/app/controllers/organisation_relationships_controller.rb b/app/controllers/organisation_relationships_controller.rb index 224f435d5..d15d904e6 100644 --- a/app/controllers/organisation_relationships_controller.rb +++ b/app/controllers/organisation_relationships_controller.rb @@ -19,11 +19,7 @@ class OrganisationRelationshipsController < ApplicationController @pagy, @housing_providers = pagy(unpaginated_filtered_housing_providers) @searched = search_term.presence @total_count = housing_providers.size - if current_user.support? - render "organisations/housing_providers", layout: "application" - else - render "organisation_relationships/housing_providers" - end + render "organisation_relationships/housing_providers", layout: "application" end end end diff --git a/app/views/organisation_relationships/housing_providers.erb b/app/views/organisation_relationships/housing_providers.erb deleted file mode 100644 index dbda19d50..000000000 --- a/app/views/organisation_relationships/housing_providers.erb +++ /dev/null @@ -1,19 +0,0 @@ -<% item_label = format_label(@pagy.count, "housing provider") %> -<% title = "Housing Providers" %> -<% content_for :title, title %> -<%= render partial: "organisations/headings", locals: { main: "Your housing providers", sub: nil } %> - -
Your organisation can submit logs for its housing providers.
- -<% if @total_count == 0 %> -You do not currently have any housing providers.
-<% end %> -<% if current_user.data_coordinator? || current_user.support? %> - <%= govuk_button_link_to "Add a housing provider", housing_providers_organisation_path, html: { method: :get } %> -<% end %> -<% if @total_count != 0 %> - <%= render SearchComponent.new(current_user:, search_label: "Search for a housing provider", value: @searched) %> - <%= govuk_section_break(visible: true, size: "m") %> - <%= render partial: "organisation_relationships/housing_provider_list", locals: { index: @housing_providers, title: "Housing providers", pagy: @pagy, searched: @searched, item_label:, total_count: @total_count } %> - <%== render partial: "pagy/nav", locals: { pagy: @pagy, item_name: "housing providers" } %> -<% end %> diff --git a/app/views/organisations/housing_providers.html.erb b/app/views/organisation_relationships/housing_providers.html.erb similarity index 75% rename from app/views/organisations/housing_providers.html.erb rename to app/views/organisation_relationships/housing_providers.html.erb index e3f0e7339..3c23fad8f 100644 --- a/app/views/organisations/housing_providers.html.erb +++ b/app/views/organisation_relationships/housing_providers.html.erb @@ -1,15 +1,19 @@ <% item_label = format_label(@pagy.count, "housing provider") %> <% title = "Housing Providers" %> <% content_for :title, title %> -<%= render partial: "organisations/headings", locals: { main: @organisation.name, sub: nil } %> <% if current_user.support? %> + <%= render partial: "organisations/headings", locals: { main: @organisation.name, sub: nil } %> <%= render SubNavigationComponent.new( items: secondary_items(request.path, @organisation.id), ) %>This organisation can submit logs for its housing providers.
+<% else %> + <%= render partial: "organisations/headings", locals: { main: "Your housing providers", sub: nil } %> + +Your organisation can submit logs for its housing providers.
<% end %> -This organisation can submit logs for its housing providers.
<% if @total_count == 0 %>This organisation does not currently have any housing providers.