Browse Source

Fix apostrophes and ampersands in other organisation related pages

pull/2643/head
Manny Dinssa 2 years ago
parent
commit
aa9c6e1c51
  1. 2
      app/helpers/application_helper.rb
  2. 2
      app/views/organisations/_merged_organisation_details.html.erb
  3. 4
      app/views/organisations/edit.html.erb
  4. 2
      app/views/organisations/show.html.erb
  5. 2
      app/views/organisations/toggle_active.html.erb

2
app/helpers/application_helper.rb

@ -34,7 +34,7 @@ module ApplicationHelper
def sanitise_characters(string) def sanitise_characters(string)
return string unless string return string unless string
string.gsub("'", "").gsub("&", "and") string.gsub("'", "").gsub("&", "")
end end
private private

2
app/views/organisations/_merged_organisation_details.html.erb

@ -1,5 +1,5 @@
<% if @organisation.organisations_absorbed_during_displayed_collection_period_grouped_by_merge_date.present? %> <% if @organisation.organisations_absorbed_during_displayed_collection_period_grouped_by_merge_date.present? %>
<%= govuk_details(summary_text: "View all organisations that were merged into #{@organisation.name}") do %> <%= govuk_details(summary_text: "View all organisations that were merged into #{sanitise_characters(@organisation.name)}") do %>
<% @organisation.organisations_absorbed_during_displayed_collection_period_grouped_by_merge_date.each do |merge_date, organisations| %> <% @organisation.organisations_absorbed_during_displayed_collection_period_grouped_by_merge_date.each do |merge_date, organisations| %>
<p><strong>Merge date:</strong> <%= merge_date&.to_formatted_s(:govuk_date) %></p> <p><strong>Merge date:</strong> <%= merge_date&.to_formatted_s(:govuk_date) %></p>
<%= govuk_table do |table| %> <%= govuk_table do |table| %>

4
app/views/organisations/edit.html.erb

@ -1,4 +1,4 @@
<% content_for :title, "Change #{@organisation.name}’s details" %> <% content_for :title, "Change #{sanitise_characters(@organisation.name)}’s details" %>
<% content_for :before_content do %> <% content_for :before_content do %>
<%= govuk_back_link(href: :back) %> <%= govuk_back_link(href: :back) %>
@ -8,7 +8,7 @@
<div class="govuk-grid-row"> <div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds"> <div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-l"> <h1 class="govuk-heading-l">
<%= content_for(:title) %> <%= "Change #{@organisation.name}’s details" %>
</h1> </h1>
<% if current_user.support? %> <% if current_user.support? %>

2
app/views/organisations/show.html.erb

@ -1,4 +1,4 @@
<% title = current_user.support? ? "#{@organisation.name} (Organisation details)" : "Organisation details" %> <% title = current_user.support? ? "#{sanitise_characters(@organisation.name)} (Organisation details)" : "Organisation details" %>
<% title = format_title(nil, current_user.support? ? "About this organisation" : "Your organisation", current_user, nil, nil, @organisation.name) %> <% title = format_title(nil, current_user.support? ? "About this organisation" : "Your organisation", current_user, nil, nil, @organisation.name) %>
<% content_for :title, title %> <% content_for :title, title %>

2
app/views/organisations/toggle_active.html.erb

@ -1,4 +1,4 @@
<% title = "#{action.humanize} #{@organisation.name}" %> <% title = "#{action.humanize} #{sanitise_characters(@organisation.name)}" %>
<% content_for :title, title %> <% content_for :title, title %>
<% content_for :before_content do %> <% content_for :before_content do %>

Loading…
Cancel
Save