diff --git a/app/views/publish/courses/_basic_details_tab.html.erb b/app/views/publish/courses/_basic_details_tab.html.erb index 18900b33b3..9f0dbda4cf 100644 --- a/app/views/publish/courses/_basic_details_tab.html.erb +++ b/app/views/publish/courses/_basic_details_tab.html.erb @@ -152,22 +152,41 @@ end end + if Settings.features.provider_partnerships + heading = "Ratifying provider" + partners = @provider.accredited_partners + add_provider_text = "Add at least one accredited partner" + add_provider_link = publish_provider_recruitment_cycle_provider_partnerships_path(@course.provider_code, @course.recruitment_cycle_year) + select_partner_text = 'Select an accredited partner' + select_partner_link = ratifying_provider_publish_provider_recruitment_cycle_course_path(@course.provider_code, @course.recruitment_cycle_year, @course.course_code) + change_partner_link = ratifying_provider_publish_provider_recruitment_cycle_course_path(@provider.provider_code, course.recruitment_cycle_year, course.course_code) + # select_partner_link = ratifying_provider_publish_provider_recruitment_cycle_course_path(@course.provider_code, @course.recruitment_cycle_year, @course.course_code) + else + heading = "Accredited provider" + partners = @provider.accredited_providers + add_provider_text = "Add at least one accredited provider" + add_provider_link = publish_provider_recruitment_cycle_accredited_providers_path(@course.provider_code, @course.recruitment_cycle_year) + select_partner_text = 'Select an accredited provider' + select_partner_link = accredited_provider_publish_provider_recruitment_cycle_course_path(@course.provider_code, @course.recruitment_cycle_year, @course.course_code) + change_partner_link = accredited_provider_publish_provider_recruitment_cycle_course_path(@provider.provider_code, course.recruitment_cycle_year, course.course_code) + end + unless @provider.accredited_provider? summary_list.with_row(html_attributes: { data: { qa: "course__accredited_provider" } }) do |row| - row.with_key { "Accredited provider" } + row.with_key { heading } row.with_value { course.accrediting_provider&.provider_name } if course.is_published? || course.is_withdrawn? row.with_action elsif !course.accrediting_provider.nil? - row.with_action(href: accredited_provider_publish_provider_recruitment_cycle_course_path(@provider.provider_code, course.recruitment_cycle_year, course.course_code), + row.with_action(href: change_partner_link, visually_hidden_text: "accredited provider") - elsif @provider.accredited_providers.any? + elsif partners.any? row.with_value do - "
#{govuk_link_to('Select an accredited provider', accredited_provider_publish_provider_recruitment_cycle_course_path(@course.provider_code, @course.recruitment_cycle_year, @course.course_code))}
".html_safe + "
#{govuk_link_to(select_partner_text, select_partner_link)}
".html_safe end else row.with_value do - "
#{govuk_link_to('Add at least one accredited provider', publish_provider_recruitment_cycle_accredited_providers_path(@course.provider_code, @course.recruitment_cycle_year))}
".html_safe + "
#{govuk_link_to(add_provider_text, add_provider_link)}
".html_safe end end end