Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename partnership concepts #4788

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/components/accredited_provider_component.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<%= govuk_summary_card(title: provider_name) do |card|
card.with_action { govuk_link_to("Remove", remove_path, class: "app-link--destructive govuk-!-font-weight-regular", data: { qa: "remove-link" }) }
card.with_summary_list(rows: [{ key: { text: "About the accredited provider" },
card.with_summary_list(rows: [{ key: { text: "About the accredited partner" },
value: { text: markdown(about_accredited_provider) },
actions: [{ href: change_about_accredited_provider_path }] }])
end %>
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def update
if update_params[:accredited_provider_code] == 'other'
redirect_to_provider_search
elsif @course.update(update_params)
course_updated_message('Accredited provider')
course_updated_message('Ratifying partner')
redirect_to_update_successful
else
@errors = @course.errors.messages
Expand Down Expand Up @@ -127,7 +127,7 @@ def errors_for_search_query(code, query)
if other_selected_with_no_autocompleted_code?(code) && query.length < 2
errors = { accredited_provider: ['Accredited provider search too short, enter 2 or more characters'] }
elsif code.blank?
errors = { accredited_provider_code: ['Select an accredited provider'] }
errors = { accredited_provider_code: ['Select a ratifying partner'] }
end

errors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def show

def update
accredited_provider_form.save!
redirect_to publish_provider_recruitment_cycle_accredited_providers_path(@provider.provider_code, @provider.recruitment_cycle_year), flash: { success: 'Accredited provider added' }
redirect_to publish_provider_recruitment_cycle_accredited_providers_path(@provider.provider_code, @provider.recruitment_cycle_year), flash: { success: 'Accredited partner added' }
end

private
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def update

redirect_to support_recruitment_cycle_provider_accredited_providers_path(
recruitment_cycle.year, provider.id
), flash: { success: 'Accredited provider added' }
), flash: { success: 'Accredited partner added' }
end

private
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/navigation_bar_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def navigation_items(provider)
{ name: t('navigation_bar.study_sites'), url: publish_provider_recruitment_cycle_study_sites_path(provider.provider_code, provider.recruitment_cycle_year) },
{ name: t('navigation_bar.users'), url: publish_provider_users_path(provider_code: provider.provider_code), additional_url: request_access_publish_provider_path(provider.provider_code) },
*([name: t('navigation_bar.training_partners'), url: publish_provider_recruitment_cycle_training_providers_path(provider.provider_code, provider.recruitment_cycle_year)] if provider.accredited_provider?),
*([name: t('navigation_bar.accredited_provider'), url: publish_provider_recruitment_cycle_accredited_providers_path(provider.provider_code, provider.recruitment_cycle_year)] unless provider.accredited_provider?),
*([name: t('navigation_bar.accredited_partnerships'), url: publish_provider_recruitment_cycle_accredited_providers_path(provider.provider_code, provider.recruitment_cycle_year)] unless provider.accredited_provider?),
{ name: t('navigation_bar.organisation_details'), url: details_publish_provider_recruitment_cycle_path(provider.provider_code, provider.recruitment_cycle_year) }
]
end
Expand Down
10 changes: 5 additions & 5 deletions app/views/publish/courses/_basic_details_tab.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -153,21 +153,21 @@
end

unless @provider.accredited_provider?
summary_list.with_row(html_attributes: { data: { qa: "course__accredited_provider" } }) do |row|
row.with_key { "Accredited provider" }
summary_list.with_row(html_attributes: { data: { qa: "course__ratifying_partner" } }) do |row|
row.with_key { "Ratifying partner" }
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),
visually_hidden_text: "accredited provider")
visually_hidden_text: "ratifying partner")
elsif @provider.accredited_providers.any?
row.with_value do
"<div class=\"govuk-inset-text app-inset-text--narrow-border app-inset-text--important\">#{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))}</div>".html_safe
"<div class=\"govuk-inset-text app-inset-text--narrow-border app-inset-text--important\">#{govuk_link_to('Select an accredited partner', accredited_provider_publish_provider_recruitment_cycle_course_path(@course.provider_code, @course.recruitment_cycle_year, @course.course_code))}</div>".html_safe
end
else
row.with_value do
"<div class=\"govuk-inset-text app-inset-text--narrow-border app-inset-text--important\">#{govuk_link_to('Add at least one accredited provider', publish_provider_recruitment_cycle_accredited_providers_path(@course.provider_code, @course.recruitment_cycle_year))}</div>".html_safe
"<div class=\"govuk-inset-text app-inset-text--narrow-border app-inset-text--important\">#{govuk_link_to('Add at least one accredited partner', publish_provider_recruitment_cycle_accredited_providers_path(@course.provider_code, @course.recruitment_cycle_year))}</div>".html_safe
end
end
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="govuk-radios__item" data-qa="course__accredited_provider_option">
<div class="govuk-radios__item" data-qa="course__ratifying_partner_option">
<%= form.radio_button :accredited_provider_code,
provider_suggestion[:provider_code],
checked: provider_suggestion[:provider_code] == @course.accrediting_provider&.provider_code,
Expand Down
10 changes: 5 additions & 5 deletions app/views/publish/courses/accredited_provider/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% content_for :page_title, title_with_error_prefix("Accredited provider – #{course.name_and_code}", course.errors.any?) %>
<% content_for :page_title, title_with_error_prefix("Ratifying partner – #{course.name_and_code}", course.errors.any?) %>

<% content_for :before_content do %>
<%= govuk_back_link_to(details_publish_provider_recruitment_cycle_course_path(course.provider_code, course.recruitment_cycle_year, course.course_code)) %>
Expand All @@ -10,7 +10,7 @@
<legend class="govuk-fieldset__legend govuk-fieldset__legend--l">
<h1 class="govuk-fieldset__heading">
<%= render CaptionText.new(text: course.name_and_code) %>
Accredited provider
Ratifying partner
</h1>
</legend>

Expand All @@ -20,14 +20,14 @@
url: accredited_provider_publish_provider_recruitment_cycle_course_path(@course.provider_code, @course.recruitment_cycle_year, @course.course_code),
method: :put do |form| %>

<div class="govuk-radios govuk-!-margin-top-2" data-module="govuk-radios" data-qa="course__accredited_provider">
<div class="govuk-radios govuk-!-margin-top-2" data-module="govuk-radios" data-qa="course__ratifying_partner">
<%= render partial: "provider_suggestion", collection: @provider.accredited_bodies, locals: { form: } %>
</div>

<div class="govuk-button-group">
<%= form.submit "Update accredited provider", class: "govuk-button govuk-!-margin-top-5", data: { qa: "course__save" } %>
<%= form.submit "Update ratifying partner", class: "govuk-button govuk-!-margin-top-5", data: { qa: "course__save" } %>
<%= govuk_link_to(
"Add accredited provider",
"Add accredited partner",
search_publish_provider_recruitment_cycle_accredited_providers_path(course.provider_code, course.recruitment_cycle_year),
class: "govuk-!-margin-bottom-6 govuk-!-margin-top-5",
data: { qa: "course__add" }
Expand Down
8 changes: 4 additions & 4 deletions app/views/publish/courses/accredited_provider/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% content_for :page_title, title_with_error_prefix("Accredited provider – #{course.name_and_code}", @errors && @errors.any?) %>
<% content_for :page_title, title_with_error_prefix("Ratifying partner – #{course.name_and_code}", @errors && @errors.any?) %>

<% content_for :before_content do %>
<%= govuk_back_link_to(@back_link_path) %>
Expand All @@ -9,17 +9,17 @@
<div class="govuk-grid-column-full">
<%= form_with url: continue_publish_provider_recruitment_cycle_courses_accredited_provider_path(@provider.provider_code, @provider.recruitment_cycle_year), method: :get do |form| %>
<%= render "publish/courses/new_fields_holder", form:, except_keys: [:accredited_provider_code] do |fields| %>
<%= render "publish/shared/error_wrapper", error_keys: [:accredited_provider_code], data_qa: "course__accredited_provider" do %>
<%= render "publish/shared/error_wrapper", error_keys: [:accredited_provider_code], data_qa: "course__ratifying_partner" do %>
<fieldset class="govuk-fieldset">
<legend class="govuk-fieldset__legend govuk-fieldset__legend--l">
<h1 class="govuk-fieldset__heading">
<%= render CaptionText.new(text: t("course.add_course")) %>
Accredited provider
Ratifying partner
</h1>
</legend>
<%= render "publish/shared/error_messages", error_keys: [:accredited_provider_code] %>

<div class="govuk-radios" data-module="govuk-radios" data-qa="course__accredited_provider">
<div class="govuk-radios" data-module="govuk-radios" data-qa="course__ratifying_partner">
<% if @provider.accredited_bodies.length > 0 %>
<%= render partial: "provider_suggestion", collection: @provider.accredited_bodies.sort_by { |k| k[:provider_name] }, locals: { form: fields } %>
<% else %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-l">
Pick an accredited provider
Pick an accredited partner
</h1>

<p class="govuk-body">You searched for ‘<%= @query %>’.</p>
Expand All @@ -21,7 +21,7 @@
<% if @provider_suggestions.any? %>
<p class="govuk-body">We found these providers which matched your search:</p>

<div class="govuk-radios" data-module="govuk-radios" data-qa="course__accredited_provider">
<div class="govuk-radios" data-module="govuk-radios" data-qa="course__ratifying_partner">
<%= render partial: "provider_suggestion", collection: @provider_suggestions, locals: { form: } %>
<div class="govuk-radios__divider">or</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-l">
Pick an accredited provider
Pick an accredited partner
</h1>

<p class="govuk-body">You searched for ‘<%= @query %>’.</p>
Expand All @@ -25,7 +25,7 @@
<% if @provider_suggestions.any? %>
<p class="govuk-body">We found these providers which matched your search:</p>

<div class="govuk-radios" data-module="govuk-radios" data-qa="course__accredited_provider">
<div class="govuk-radios" data-module="govuk-radios" data-qa="course__ratifying_partner">
<%= render partial: "provider_suggestion", collection: @provider_suggestions, locals: { form: } %>
<div class="govuk-radios__divider">or</div>

Expand Down
6 changes: 3 additions & 3 deletions app/views/publish/courses/confirmation.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,13 @@
<% end %>

<% unless @provider.accredited_provider? || course.is_further_education? %>
<% summary_list.with_row(html_attributes: { data: { qa: "course__accredited_provider" } }) do |row| %>
<% row.with_key { "Accredited provider" } %>
<% summary_list.with_row(html_attributes: { data: { qa: "course__ratifying_partner" } }) do |row| %>
<% row.with_key { "Ratifying partner" } %>
<% row.with_value { course.accrediting_provider.provider_name } %>
<% if @provider.accredited_bodies.length > 1 %>
<% row.with_action(
href: new_publish_provider_recruitment_cycle_courses_accredited_provider_path(course.provider.provider_code, course.recruitment_cycle.year, params.to_unsafe_h.merge(goto_confirmation: true)),
visually_hidden_text: "accredited provider"
visually_hidden_text: "ratifying partner"
) %>
<% else %>
<% row.with_action %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/publish/courses/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<% @courses_by_accrediting_provider.each do |accrediting_provider, courses| %>
<section data-qa="courses__table-section">
<h2 class="govuk-heading-m">
<span class="govuk-caption-m">Accredited provider</span>
<span class="govuk-caption-m">Ratifying partner</span>
<%= accrediting_provider %>
</h2>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<%= render search_result_title_component %>

<% unless @accredited_provider_search.providers.empty? %>
<%= f.govuk_radio_buttons_fieldset(:provider_id, legend: { text: "Accredited provider", size: "m" }) do %>
<%= f.govuk_radio_buttons_fieldset(:provider_id, legend: { text: "Accredited partner", size: "m" }) do %>
<% @accredited_provider_search.providers.each_with_index do |provider, index| %>
<%= f.govuk_radio_button :provider_id, provider.id, label: { text: provider.name_and_code }, link_errors: index.zero? %>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<%= t("publish.providers.accredited_providers.delete.title") %>
</h1>

<%= govuk_button_to "Remove accredited provider",
<%= govuk_button_to "Remove accredited partner",
delete_publish_provider_recruitment_cycle_accredited_provider_path,
method: :delete,
class: "govuk-button--warning" %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% content_for :page_title, "You cannot remove this accredited provider" %>
<% content_for :page_title, "You cannot remove this accredited partner" %>

<% content_for :before_content do %>
<%= govuk_back_link_to(publish_provider_recruitment_cycle_accredited_providers_path) %>
Expand All @@ -8,17 +8,17 @@
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-l">
<span class="govuk-caption-l"><%= @accredited_provider.provider_name %></span>
You cannot remove this accredited provider
You cannot remove this accredited partner
</h1>

<p class="govuk-body">
<%= @accredited_provider.provider_name %> is an
accredited provider for courses run by <%= @provider.provider_name %>. At least one of these courses is
ratifying partner for courses run by <%= @provider.provider_name %>. At least one of these courses is
currently published on Find.
</p>

<p class="govuk-body">
If you need to change an accredited provider for a course which is published, please contact us at
If you need to change an ratifying partner for a course which is published, please contact us at
<%= bat_contact_mail_to %>.
</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@

<%= render GovukComponent::SummaryListComponent.new do |component|
component.with_row do |row|
row.with_key { "Accredited provider" }
row.with_key { "Accredited partner" }
row.with_value { @accredited_provider_form.provider_name }
row.with_action(text: "Change", href: search_publish_provider_recruitment_cycle_accredited_providers_path(goto_confirmation: true), visually_hidden_text: "accredited provider name")
row.with_action(text: "Change", href: search_publish_provider_recruitment_cycle_accredited_providers_path(goto_confirmation: true), visually_hidden_text: "accredited partner name")
end

component.with_row do |row|
row.with_key { "About the accredited provider" }
row.with_key { "About the accredited partner" }
row.with_value { markdown @accredited_provider_form.description }
row.with_action(text: "Change", href: new_publish_provider_recruitment_cycle_accredited_provider_path(goto_confirmation: true), visually_hidden_text: "accredited provider description")
row.with_action(text: "Change", href: new_publish_provider_recruitment_cycle_accredited_provider_path(goto_confirmation: true), visually_hidden_text: "accredited partner description")
end
end %>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% content_for :page_title, title_with_error_prefix("About the accredited provider - #{@accredited_provider.provider_name}", @accredited_provider_form.errors.present?) %>
<% content_for :page_title, title_with_error_prefix("About the accredited partnership - #{@accredited_provider.provider_name}", @accredited_provider_form.errors.present?) %>

<%= form_with(
model: @accredited_provider_form,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<% content_for :page_title, title_with_error_prefix("Accredited providers", nil) %>
<% content_for :page_title, title_with_error_prefix("Accredited partners", nil) %>

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-l">
Accredited providers
Accredited partners
</h1>

<%= govuk_button_link_to("Add accredited provider", search_publish_provider_recruitment_cycle_accredited_providers_path(
<%= govuk_button_link_to("Add accredited partner", search_publish_provider_recruitment_cycle_accredited_providers_path(
provider_code: @provider.provider_code,
recruitment_cycle_year: @provider.recruitment_cycle_year
)) %>
Expand All @@ -16,7 +16,7 @@
<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<% if @provider.accredited_bodies.none? %>
<p class="govuk-body">There are no accredited providers for <%= @provider.provider_name %>.</p>
<p class="govuk-body">There are no accredited partners for <%= @provider.provider_name %>.</p>
<% else %>
<% @provider.accredited_bodies.each do |accredited_body| %>
<%= render AccreditedProviderComponent.new(provider_name: accredited_body[:provider_name], remove_path: delete_publish_provider_recruitment_cycle_accredited_provider_path(accredited_provider_code: accredited_body[:provider_code]), about_accredited_provider: accredited_body[:description], change_about_accredited_provider_path: edit_publish_provider_recruitment_cycle_accredited_provider_path(accredited_provider_code: accredited_body[:provider_code])) %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% content_for :page_title, title_with_error_prefix("About the accredited provider - Add accredited provider - #{@provider.name_and_code}", @accredited_provider_form.errors.present?) %>
<% content_for :page_title, title_with_error_prefix("About the accredited partnership - Add accredited partner - #{@provider.name_and_code}", @accredited_provider_form.errors.present?) %>

<%= form_with(
model: @accredited_provider_form,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<aside class="govuk-grid-column-one-third">
<div class="app-status-box" data-qa="download-section">
<h2 class="govuk-heading-m">Download</h2>
<p class="govuk-body">Export all the courses you’re the accredited provider for.</p>
<p class="govuk-body">Export all the courses you’re the ratifying partner for.</p>
<p class="govuk-body">
<%= govuk_link_to(
"Download as a CSV file",
Expand Down
2 changes: 1 addition & 1 deletion app/views/support/courses/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header">Course name and code</th>
<th scope="col" class="govuk-table__header">Status</th>
<th scope="col" class="govuk-table__header">Ratifying Provider</th>
<th scope="col" class="govuk-table__header">Ratifying partner</th>
<th scope="col" class="govuk-table__header"></th>
</tr>
</thead>
Expand Down
Loading
Loading