Browse Source

refactored name

pull/643/head
JG 3 years ago
parent
commit
05e4831f94
  1. 6
      app/helpers/title_helper.rb

6
app/helpers/title_helper.rb

@ -5,16 +5,16 @@ module TitleHelper
def format_title(searched, page_title, current_user, item_label, count, organisation_name) def format_title(searched, page_title, current_user, item_label, count, organisation_name)
if searched.present? if searched.present?
actual_title = support_user_sab_nav?(current_user, organisation_name) ? organisation_name : page_title actual_title = support_sab_nav?(current_user, organisation_name) ? organisation_name : page_title
"#{actual_title} (#{count} #{item_label} matching ‘#{searched}’)" "#{actual_title} (#{count} #{item_label} matching ‘#{searched}’)"
else else
support_user_sab_nav?(current_user, organisation_name) ? "#{organisation_name} (#{page_title})" : page_title support_sab_nav?(current_user, organisation_name) ? "#{organisation_name} (#{page_title})" : page_title
end end
end end
private private
def support_user_sab_nav?(current_user, organisation_name) def support_sab_nav?(current_user, organisation_name)
current_user.support? && organisation_name current_user.support? && organisation_name
end end
end end

Loading…
Cancel
Save