From: Dan Stowell Date: Sun, 23 Nov 2014 22:21:57 +0000 (+0000) Subject: Page titles: put specific page title at the start not the end X-Git-Tag: live~3351^2 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/da7ed512a89013d97e1b1f87d7ef6136c16864dd Page titles: put specific page title at the start not the end --- diff --git a/app/helpers/title_helper.rb b/app/helpers/title_helper.rb index a1a2125a1..e72069ff0 100644 --- a/app/helpers/title_helper.rb +++ b/app/helpers/title_helper.rb @@ -6,7 +6,7 @@ module TitleHelper def set_title(title = false) if title @title = @@coder.decode(title.gsub("", "\u202a").gsub("", "\u202c")) - response.headers["X-Page-Title"] = t('layouts.project_name.title') + ' | ' + @title + response.headers["X-Page-Title"] = @title + ' | ' + t('layouts.project_name.title') else @title = title response.headers["X-Page-Title"] = t('layouts.project_name.title') diff --git a/test/helpers/title_helper_test.rb b/test/helpers/title_helper_test.rb index 11578cc11..97ccd7537 100644 --- a/test/helpers/title_helper_test.rb +++ b/test/helpers/title_helper_test.rb @@ -7,11 +7,11 @@ class TitleHelperTest < ActionView::TestCase assert_nil @title set_title("Test Title") - assert_equal "OpenStreetMap | Test Title", response.header["X-Page-Title"] + assert_equal "Test Title | OpenStreetMap", response.header["X-Page-Title"] assert_equal "Test Title", @title set_title("Test & Title") - assert_equal "OpenStreetMap | Test & Title", response.header["X-Page-Title"] + assert_equal "Test & Title | OpenStreetMap", response.header["X-Page-Title"] assert_equal "Test & Title", @title end end