diff --git a/app/assets/images/feed-icon-black.png b/app/assets/images/feed-icon-black.png deleted file mode 100644 index 643830f58..000000000 Binary files a/app/assets/images/feed-icon-black.png and /dev/null differ diff --git a/app/assets/images/mail-icon-x2.png b/app/assets/images/mail-icon-x2.png deleted file mode 100644 index 4625eceb9..000000000 Binary files a/app/assets/images/mail-icon-x2.png and /dev/null differ diff --git a/app/assets/images/mail-icon.png b/app/assets/images/mail-icon.png deleted file mode 100644 index 5f63ddea4..000000000 Binary files a/app/assets/images/mail-icon.png and /dev/null differ diff --git a/app/assets/stylesheets/components/_subscription-links.scss b/app/assets/stylesheets/components/_subscription-links.scss deleted file mode 100644 index c8106d07a..000000000 --- a/app/assets/stylesheets/components/_subscription-links.scss +++ /dev/null @@ -1,40 +0,0 @@ -.app-c-subscription-links { - @include bold-19; - - .app-c-subscription-links__list { - list-style: none; - margin-left: -$gutter-half / 2; - margin-right: -$gutter-half / 2; - } - - .app-c-subscription-links__list-item { - display: inline-block; - margin-left: $gutter-half / 2; - margin-right: $gutter-half / 2; - margin-bottom: $gutter / 2; - } - - .app-c-subscription-links__link { - text-decoration: none; - padding-left: 28px; - background-repeat: no-repeat; - background-position: 0 20%; - - @include media(tablet) { - background-position: 0 35%; - } - } - - .app-c-subscription-links__link--feed { - background-image: image-url("feed-icon-black.png"); - } - - .app-c-subscription-links__link--email-alerts { - background-image: image-url("mail-icon.png"); - - @include device-pixel-ratio() { - background-image: image-url("mail-icon-x2.png"); - background-size: 20px 14px; - } - } -} diff --git a/app/views/components/_subscription-links.html.erb b/app/views/components/_subscription-links.html.erb deleted file mode 100644 index 5708d93c1..000000000 --- a/app/views/components/_subscription-links.html.erb +++ /dev/null @@ -1,21 +0,0 @@ -<% - email_signup_link ||= false - feed_link ||= false -%> -<% if email_signup_link || feed_link %> - -<% end %> diff --git a/app/views/components/docs/subscription-links.yml b/app/views/components/docs/subscription-links.yml deleted file mode 100644 index 95b409f0b..000000000 --- a/app/views/components/docs/subscription-links.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Subscription links -description: Links to ‘Get email alerts’ and ‘Subscribe to feed’ -accessibility_criteria: | - Icons in subscription links must be presentational and ignored by screen readers. -shared_accessibility_criteria: - - link -examples: - default: - data: - email_signup_link: '/foreign-travel-advice/singapore/email-signup' - feed_link: '/foreign-travel-advice/singapore.atom' - with_only_email_signup_link: - data: - email_signup_link: '/foreign-travel-advice/singapore/email-signup' - with_only_feed_link: - data: - feed_link: '/foreign-travel-advice/singapore.atom' diff --git a/app/views/content_items/travel_advice.html.erb b/app/views/content_items/travel_advice.html.erb index 862f349c6..d4742c527 100644 --- a/app/views/content_items/travel_advice.html.erb +++ b/app/views/content_items/travel_advice.html.erb @@ -27,7 +27,7 @@ - <%= render 'components/subscription-links', email_signup_link: @content_item.email_signup_link, feed_link: @content_item.feed_link %> + <%= render 'govuk_publishing_components/components/subscription-links', email_signup_link: @content_item.email_signup_link, feed_link: @content_item.feed_link %> diff --git a/test/components/subscription_links_test.rb b/test/components/subscription_links_test.rb deleted file mode 100644 index ad4f96fc0..000000000 --- a/test/components/subscription_links_test.rb +++ /dev/null @@ -1,27 +0,0 @@ -require 'component_test_helper' - -class SubscriptionLinksTest < ComponentTestCase - def component_name - "subscription-links" - end - - test "renders nothing when no parameters are given" do - assert_empty render_component({}) - end - - test "renders an email signup link" do - render_component(email_signup_link: '/email-signup') - assert_select ".app-c-subscription-links__link--email-alerts[href=\"/email-signup\"]", text: "Get email alerts" - end - - test "renders a feed link" do - render_component(feed_link: 'singapore.atom') - assert_select ".app-c-subscription-links__link--feed[href=\"singapore.atom\"]", text: "Subscribe to feed" - end - - test "renders both email signup and feed links" do - render_component(email_signup_link: 'email-signup', feed_link: 'singapore.atom') - assert_select ".app-c-subscription-links__link--email-alerts[href=\"email-signup\"]", text: "Get email alerts" - assert_select ".app-c-subscription-links__link--feed[href=\"singapore.atom\"]", text: "Subscribe to feed" - end -end diff --git a/test/controllers/content_items_controller_test.rb b/test/controllers/content_items_controller_test.rb index ccc5e6cab..96b24e448 100644 --- a/test/controllers/content_items_controller_test.rb +++ b/test/controllers/content_items_controller_test.rb @@ -83,6 +83,7 @@ class ContentItemsControllerTest < ActionController::TestCase assert_response :redirect assert_redirected_to content_item['base_path'] end + test "returns HTML when an unspecific accepts header is requested (eg by IE8 and below)" do request.headers["Accept"] = "*/*" content_item = content_store_has_schema_example('travel_advice', 'full-country')