From 682252007e441f5eb6f12c3e2a97565217da963d Mon Sep 17 00:00:00 2001 From: Andrew White Date: Wed, 20 Nov 2024 05:37:49 +0000 Subject: [PATCH] Change Twitter sharing references fully to X --- .../images/icons/icon_share-twitter-2x.png | Bin 570 -> 0 bytes .../images/icons/icon_share-twitter.png | Bin 326 -> 0 bytes app/assets/images/icons/icon_share-x-2x.png | Bin 0 -> 1035 bytes app/assets/images/icons/icon_share-x.png | Bin 0 -> 590 bytes app/assets/stylesheets/petitions/_icons.scss | 8 +++---- app/helpers/sharing_helper.rb | 10 ++++----- app/helpers/social_meta_helper.rb | 4 ++-- .../application/_share_petition.html.erb | 2 +- app/views/application/_social_meta.html.erb | 20 +++++++++--------- ...fy_creator_of_closing_date_change.html.erb | 2 +- ...fy_creator_of_closing_date_change.text.erb | 2 +- ..._sponsored_petition_being_stopped.html.erb | 2 +- ..._sponsored_petition_being_stopped.text.erb | 2 +- ..._validated_petition_being_stopped.html.erb | 2 +- ..._validated_petition_being_stopped.text.erb | 2 +- ...ify_signer_of_closing_date_change.html.erb | 2 +- ...ify_signer_of_closing_date_change.text.erb | 2 +- config/locales/metadata.en-GB.yml | 2 +- config/locales/petitions.en-GB.yml | 4 ++-- features/step_definitions/petition_steps.rb | 4 ++-- features/suzie_views_a_petition.feature | 2 +- spec/helpers/sharing_helper_spec.rb | 8 +++---- spec/helpers/social_meta_helper_spec.rb | 10 ++++----- 23 files changed, 45 insertions(+), 45 deletions(-) delete mode 100644 app/assets/images/icons/icon_share-twitter-2x.png delete mode 100644 app/assets/images/icons/icon_share-twitter.png create mode 100644 app/assets/images/icons/icon_share-x-2x.png create mode 100644 app/assets/images/icons/icon_share-x.png diff --git a/app/assets/images/icons/icon_share-twitter-2x.png b/app/assets/images/icons/icon_share-twitter-2x.png deleted file mode 100644 index 6cbf8a82a7fe80f35470298c7217a5101d13c26d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 570 zcmV-A0>%A_P)1h6DHY4N&=6>z?JrMX|R}y>=E!79GQI19`-8Y6oeek zK4i~Hk%Uh@I{l_2kaJS?A>{!9N(z84`UpQ^Rk{d(1fr019Ek_@!-+gN9Si{e&PjP; z860aT-@DzH?i9!+IP1v!6>qhp-2&c*LQN8j<@a7Up=(C74hmAD^Il7U4I@69Hsnsd zj>+OS^!tEYu4!K6O*bsR0sMyax-0Ml0^F8y5~iBlZJXn^;JVV>jBwdtPi>XiM6Gsz ziATmL!J~ingMx24Q5$e=5>iBB-hwe}T}!RFixB2I6d%uzyW&2)*Ul5x5ukKF5%G_;I$3g`A=h%DNvB;mhy!cgX zz4!JXJa3ea9X?XFNUpc0R`=%pUkY(2ubfr+%b98X|5Go^dA)NGC$B`?Y?aEy~L zizwRn>g9v!s%s3c>LppfS#bXKfuF_)^}R2gE}xOSIc(4E2m6I4f5@%{rjq~vyQ9yn z0Y*V1CdojTOML4n&^TI@!} zPo^xfpecf>ijf+}Uca}$JNb6*yhUwQAHiqOW-7}y(`SAQs_BoF@{+)gM za?ux-6zznsyN^`4)^D=gHSfTYlI52hFYVc0?{kOaYr%`B;vL%C@~rX>w4FZhw&KO= z?Ym6FFE{Qlu8jS$;`IMhTLVhj)U@&sEoCWrr@!}?WVlJ&^@6Xjt1r49ohA3s?#JQn zk;nHQugi*yxv#uWJf%A!iv38HZK|%#YxNNG>2H7BJR@*x1NS4}8%<5q&kMQVGO|`v zsOS6UFMd-bCuhSq(?b#NB}y+e^)5Ru?h9QNlIWv%vX1Z2!GBS==3e^A78}IV9cF7f R379t+JYD@<);T3K0RXSOqV)g( literal 0 HcmV?d00001 diff --git a/app/assets/images/icons/icon_share-x.png b/app/assets/images/icons/icon_share-x.png new file mode 100644 index 0000000000000000000000000000000000000000..20cfa95ee2e5af9f88098dff1cfac7bdef462cc6 GIT binary patch literal 590 zcmeAS@N?(olHy`uVBq!ia0vp^0w6XA8<1SE`<)7qVk{1FcVbv~PUa<$Q;{0snda-u zpao=eFt9QTF))La03idT6ay=m&A{NrC=F)^F={~7FflN+XELxr)kFbl5bywEpl&G5 zw15e&LSO+ioXrbTDscUH0g&P>@Q5sCVBi)8VMc~ob0mO*GMO&^AwU{v2^g>gNev(d z(IC&(G!=QxI6S?$_ON7=>m)N-Q%p`8#dusn|)BO4* z(-+y-{+r?-s=ZHhllrV*>#u|yKW%%ZOXlAiQ4
  • - <%= share_via_twitter(petition, rel: 'external', target: '_blank') %> + <%= share_via_x(petition, rel: 'external', target: '_blank') %>
  • <%= share_via_whatsapp(petition, rel: 'external', target: '_blank') %> diff --git a/app/views/application/_social_meta.html.erb b/app/views/application/_social_meta.html.erb index 241e0dadf..f2be93062 100644 --- a/app/views/application/_social_meta.html.erb +++ b/app/views/application/_social_meta.html.erb @@ -19,17 +19,17 @@ <%= open_graph_tag 'type', 'website' %> <%= open_graph_tag 'title', page_title %> <% end %> - -<%= twitter_card_tag 'card', 'summary' %> -<%= twitter_card_tag 'site', '@hocpetitions' %> -<%= twitter_card_tag 'image', 'os-social/opengraph-image.png' %> + +<%= x_card_tag 'card', 'summary' %> +<%= x_card_tag 'site', '@hocpetitions' %> +<%= x_card_tag 'image', 'os-social/opengraph-image.png' %> <% if archived_petition_page? %> -<%= twitter_card_tag 'title', :title, petition: @petition.action %> -<%= twitter_card_tag 'description', @petition.background? ? @petition.background : @petition.additional_details %> +<%= x_card_tag 'title', :title, petition: @petition.action %> +<%= x_card_tag 'description', @petition.background? ? @petition.background : @petition.additional_details %> <% elsif defined?(@petition) %> -<%= twitter_card_tag 'title', :title, petition: @petition.action %> -<%= twitter_card_tag 'description', @petition.background %> +<%= x_card_tag 'title', :title, petition: @petition.action %> +<%= x_card_tag 'description', @petition.background %> <% else %> -<%= twitter_card_tag 'title', page_title %> -<%= twitter_card_tag 'description', 'Official online petitions in response to issues of the day, listing the number that got a Government response, and those that have been debated in the House of Parliament' %> +<%= x_card_tag 'title', page_title %> +<%= x_card_tag 'description', 'Official online petitions in response to issues of the day, listing the number that got a Government response, and those that have been debated in the House of Parliament' %> <% end %> diff --git a/app/views/petition_mailer/notify_creator_of_closing_date_change.html.erb b/app/views/petition_mailer/notify_creator_of_closing_date_change.html.erb index e99d2ed05..b718c7319 100644 --- a/app/views/petition_mailer/notify_creator_of_closing_date_change.html.erb +++ b/app/views/petition_mailer/notify_creator_of_closing_date_change.html.erb @@ -21,7 +21,7 @@

    The current Petitions Committee, the group of MPs who decide whether petitions are debated, won’t exist after <%= @closing_date %>. This means that if <%= @count > 1 ? "any of your petitions" : "your petition" %> has over <%= Site.formatted_threshold_for_debate %> signatures, <%= @count > 1 ? "they" : "it" %> can’t be scheduled for debate during this Parliament. After the election, a new Petitions Committee will be responsible for deciding which petitions are debated.

    -

    The petitions site will reopen when a new Petitions Committee is appointed, but at the moment we don’t know exactly when. You can follow us on X (formerly Twitter) @HoCPetitions for updates, or check back on the petitions site for news.

    +

    The petitions site will reopen when a new Petitions Committee is appointed, but at the moment we don’t know exactly when. You can follow us on X @HoCPetitions for updates, or check back on the petitions site for news.

    <% if Parliament.dissolution_faq_url? %>

    You can find out more about what the General Election means for your petitions on our website: <%= link_to(nil, Parliament.dissolution_faq_url) %>

    diff --git a/app/views/petition_mailer/notify_creator_of_closing_date_change.text.erb b/app/views/petition_mailer/notify_creator_of_closing_date_change.text.erb index c4d04cf53..0cab6436f 100644 --- a/app/views/petition_mailer/notify_creator_of_closing_date_change.text.erb +++ b/app/views/petition_mailer/notify_creator_of_closing_date_change.text.erb @@ -21,7 +21,7 @@ The Government can’t respond to petitions during the election period. This mea The Petitions Committee, the group of MPs who decide whether petitions are debated, won’t exist after <%= @closing_date %>. This means that if <%= @count > 1 ? "any of your petitions" : "your petition" %> has over <%= Site.formatted_threshold_for_debate %> signatures, <%= @count > 1 ? "they" : "it" %> can’t be scheduled for debate during this Parliament. After the election, a new Petitions Committee will be responsible for deciding which petitions are debated. -The petitions site will reopen when a new Petitions Committee is appointed, but at the moment we don’t know exactly when. You can follow us on X (formerly Twitter) @HoCPetitions for updates, or check back on the petitions site for news. +The petitions site will reopen when a new Petitions Committee is appointed, but at the moment we don’t know exactly when. You can follow us on X @HoCPetitions for updates, or check back on the petitions site for news. <% if Parliament.dissolution_faq_url? %> You can find out more about what the General Election means for your petitions on our website: <%= Parliament.dissolution_faq_url %> diff --git a/app/views/petition_mailer/notify_creator_of_sponsored_petition_being_stopped.html.erb b/app/views/petition_mailer/notify_creator_of_sponsored_petition_being_stopped.html.erb index a71ec5422..e7ac8f451 100644 --- a/app/views/petition_mailer/notify_creator_of_sponsored_petition_being_stopped.html.erb +++ b/app/views/petition_mailer/notify_creator_of_sponsored_petition_being_stopped.html.erb @@ -6,7 +6,7 @@

    Petitions started before the election won’t restart when the site opens again. You are very welcome to resubmit your petition once the site reopens, but you’ll need to collect your five sponsor signatures again.

    -

    The petitions site will reopen when a new Petitions Committee is appointed, but at the moment we don’t know exactly when. You can follow us on X (formerly Twitter) @HoCPetitions for updates, or check back on the petitions site for news.

    +

    The petitions site will reopen when a new Petitions Committee is appointed, but at the moment we don’t know exactly when. You can follow us on X @HoCPetitions for updates, or check back on the petitions site for news.

    <% if Parliament.dissolution_faq_url? %>

    You can find out more about what the General Election means for your petitions on our website: <%= link_to(nil, Parliament.dissolution_faq_url) %>

    diff --git a/app/views/petition_mailer/notify_creator_of_sponsored_petition_being_stopped.text.erb b/app/views/petition_mailer/notify_creator_of_sponsored_petition_being_stopped.text.erb index a1ba3e8c2..36a60d6fd 100644 --- a/app/views/petition_mailer/notify_creator_of_sponsored_petition_being_stopped.text.erb +++ b/app/views/petition_mailer/notify_creator_of_sponsored_petition_being_stopped.text.erb @@ -6,7 +6,7 @@ We’re very sorry that we didn’t have time to check your petition before this Petitions started before the election won’t restart when the site opens again. You are very welcome to resubmit your petition once the site reopens, but you’ll need to collect your five sponsor signatures again. -The petitions site will reopen when a new Petitions Committee is appointed, but at the moment we don’t know exactly when. You can follow us on X (formerly Twitter) @HoCPetitions for updates, or check back on the petitions site for news. +The petitions site will reopen when a new Petitions Committee is appointed, but at the moment we don’t know exactly when. You can follow us on X @HoCPetitions for updates, or check back on the petitions site for news. <% if Parliament.dissolution_faq_url? %> You can find out more about what the General Election means for your petitions on our website: <%= Parliament.dissolution_faq_url %> diff --git a/app/views/petition_mailer/notify_creator_of_validated_petition_being_stopped.html.erb b/app/views/petition_mailer/notify_creator_of_validated_petition_being_stopped.html.erb index a95c02eb2..0346b360b 100644 --- a/app/views/petition_mailer/notify_creator_of_validated_petition_being_stopped.html.erb +++ b/app/views/petition_mailer/notify_creator_of_validated_petition_being_stopped.html.erb @@ -6,7 +6,7 @@

    Petitions started before the election won’t restart when the site opens again. You are very welcome to resubmit your petition once the site reopens, but you’ll need to collect your sponsor signatures again.

    -

    The petitions site will reopen when a new Petitions Committee is appointed, but at the moment we don’t know exactly when. You can follow us on X (formerly Twitter) @HoCPetitions for updates, or check back on the petitions site for news.

    +

    The petitions site will reopen when a new Petitions Committee is appointed, but at the moment we don’t know exactly when. You can follow us on X @HoCPetitions for updates, or check back on the petitions site for news.

    <% if Parliament.dissolution_faq_url? %>

    You can find out more about what the General Election means for your petitions on our website: <%= link_to(nil, Parliament.dissolution_faq_url) %>

    diff --git a/app/views/petition_mailer/notify_creator_of_validated_petition_being_stopped.text.erb b/app/views/petition_mailer/notify_creator_of_validated_petition_being_stopped.text.erb index 898acb8b4..1d89452ae 100644 --- a/app/views/petition_mailer/notify_creator_of_validated_petition_being_stopped.text.erb +++ b/app/views/petition_mailer/notify_creator_of_validated_petition_being_stopped.text.erb @@ -6,7 +6,7 @@ We’re very sorry that you didn’t have time to collect your five signatures b Petitions started before the election won’t restart when the site opens again. You are very welcome to resubmit your petition once the site reopens, but you’ll need to collect your sponsor signatures again. -The petitions site will reopen when a new Petitions Committee is appointed, but at the moment we don’t know exactly when. You can follow us on X (formerly Twitter) @HoCPetitions for updates, or check back on the petitions site for news. +The petitions site will reopen when a new Petitions Committee is appointed, but at the moment we don’t know exactly when. You can follow us on X @HoCPetitions for updates, or check back on the petitions site for news. <% if Parliament.dissolution_faq_url? %> You can find out more about what the General Election means for your petitions on our website: <%= Parliament.dissolution_faq_url %> diff --git a/app/views/petition_mailer/notify_signer_of_closing_date_change.html.erb b/app/views/petition_mailer/notify_signer_of_closing_date_change.html.erb index 6f4870269..73be63225 100644 --- a/app/views/petition_mailer/notify_signer_of_closing_date_change.html.erb +++ b/app/views/petition_mailer/notify_signer_of_closing_date_change.html.erb @@ -21,7 +21,7 @@

    The current Petitions Committee, the group of MPs who decide whether petitions are debated, won’t exist after <%= @closing_date %>. This means that if <%= @count > 1 ? "any of the petitions" : "the petition" %> has over <%= Site.formatted_threshold_for_debate %> signatures, <%= @count > 1 ? "they" : "it" %> can’t be scheduled for debate during this Parliament. After the election, a new Petitions Committee will be responsible for deciding which petitions are debated.

    -

    The petitions site will reopen when a new Petitions Committee is appointed, but at the moment we don’t know exactly when. You can follow us on X (formerly Twitter) @HoCPetitions for updates, or check back on the petitions site for news.

    +

    The petitions site will reopen when a new Petitions Committee is appointed, but at the moment we don’t know exactly when. You can follow us on X @HoCPetitions for updates, or check back on the petitions site for news.

    <% if Parliament.dissolution_faq_url? %>

    You can find out more about what the General Election means for your petitions on our website: <%= link_to(nil, Parliament.dissolution_faq_url) %>

    diff --git a/app/views/petition_mailer/notify_signer_of_closing_date_change.text.erb b/app/views/petition_mailer/notify_signer_of_closing_date_change.text.erb index ff7dde97d..edc67ab92 100644 --- a/app/views/petition_mailer/notify_signer_of_closing_date_change.text.erb +++ b/app/views/petition_mailer/notify_signer_of_closing_date_change.text.erb @@ -21,7 +21,7 @@ The Government can’t respond to petitions during the election period. This mea The Petitions Committee, the group of MPs who decide whether petitions are debated, won’t exist after <%= @closing_date %>. This means that if <%= @count > 1 ? "any of the petitions" : "the petition" %> has over <%= Site.formatted_threshold_for_debate %> signatures, <%= @count > 1 ? "they" : "it" %> can’t be scheduled for debate during this Parliament. After the election, a new Petitions Committee will be responsible for deciding which petitions are debated. -The petitions site will reopen when a new Petitions Committee is appointed, but at the moment we don’t know exactly when. You can follow us on X (formerly Twitter) @HoCPetitions for updates, or check back on the petitions site for news. +The petitions site will reopen when a new Petitions Committee is appointed, but at the moment we don’t know exactly when. You can follow us on X @HoCPetitions for updates, or check back on the petitions site for news. <% if Parliament.dissolution_faq_url? %> You can find out more about what the General Election means for your petitions on our website: <%= Parliament.dissolution_faq_url %> diff --git a/config/locales/metadata.en-GB.yml b/config/locales/metadata.en-GB.yml index 35a3466f6..b5a36a828 100644 --- a/config/locales/metadata.en-GB.yml +++ b/config/locales/metadata.en-GB.yml @@ -6,7 +6,7 @@ en-GB: title: "Petition: %{petition}" archived_title: "Archived Petition: %{petition}" - twitter: + x: default_title: "Petitions - UK Government and Parliament" title: "Petition: %{petition}" archived_title: "Archived Petition: %{petition}" diff --git a/config/locales/petitions.en-GB.yml b/config/locales/petitions.en-GB.yml index aca62bdad..3c72d7e5c 100644 --- a/config/locales/petitions.en-GB.yml +++ b/config/locales/petitions.en-GB.yml @@ -27,8 +27,8 @@ en-GB: html: Facebook email: html: Email - twitter: - html: Twitter + x: + html: X whatsapp: html: Whatsapp diff --git a/features/step_definitions/petition_steps.rb b/features/step_definitions/petition_steps.rb index 5b94fe813..d6260e31c 100644 --- a/features/step_definitions/petition_steps.rb +++ b/features/step_definitions/petition_steps.rb @@ -323,9 +323,9 @@ within(:css, '.petition-share') do expect(page).to have_link('Facebook', href: %r[\Ahttps://www\.facebook\.com/sharer/sharer\.php\?ref=responsive&u=#{ERB::Util.url_encode(petition_url(@petition))}\z]) end - when 'Twitter' + when 'X' within(:css, '.petition-share') do - expect(page).to have_link('Twitter', href: %r[\Ahttps://twitter\.com/intent/tweet\?text=Petition%3A%20#{ERB::Util.url_encode(@petition.action)}&url=#{ERB::Util.url_encode(petition_url(@petition))}\z]) + expect(page).to have_link('X', href: %r[\Ahttps://x\.com/intent/post\?text=Petition%3A%20#{ERB::Util.url_encode(@petition.action)}&url=#{ERB::Util.url_encode(petition_url(@petition))}\z]) end when 'Whatsapp' within(:css, '.petition-share') do diff --git a/features/suzie_views_a_petition.feature b/features/suzie_views_a_petition.feature index e48601176..ca899fba4 100644 --- a/features/suzie_views_a_petition.feature +++ b/features/suzie_views_a_petition.feature @@ -56,7 +56,7 @@ Feature: Suzie views a petition And I should not see "This petition is closed" And I can share it via Email And I can share it via Facebook - And I can share it via Twitter + And I can share it via X And I can share it via Whatsapp Scenario: Suzie views a petition containing urls, email addresses and html tags diff --git a/spec/helpers/sharing_helper_spec.rb b/spec/helpers/sharing_helper_spec.rb index a62fccd9f..68b33190c 100644 --- a/spec/helpers/sharing_helper_spec.rb +++ b/spec/helpers/sharing_helper_spec.rb @@ -26,10 +26,10 @@ end end - describe "#share_via_twitter_url" do - it "generates a share via Twitter url" do - expect(helper.share_via_twitter_url(petition)).to eq <<-URL.strip - https://twitter.com/intent/tweet?text=Petition%3A%20Do%20something&url=https%3A%2F%2Fpetition.parliament.uk%2Fpetitions%2F100000 + describe "#share_via_x_url" do + it "generates a share via X url" do + expect(helper.share_via_x_url(petition)).to eq <<-URL.strip + https://x.com/intent/post?text=Petition%3A%20Do%20something&url=https%3A%2F%2Fpetition.parliament.uk%2Fpetitions%2F100000 URL end end diff --git a/spec/helpers/social_meta_helper_spec.rb b/spec/helpers/social_meta_helper_spec.rb index 91388aece..ef36ba903 100644 --- a/spec/helpers/social_meta_helper_spec.rb +++ b/spec/helpers/social_meta_helper_spec.rb @@ -51,10 +51,10 @@ end end - describe "#twitter_card_tag" do + describe "#x_card_tag" do context "when using a string for content" do subject do - helper.twitter_card_tag("site", "@hocpetitions") + helper.x_card_tag("site", "@hocpetitions") end it "generates a meta tag with the content" do @@ -64,7 +64,7 @@ context "when using a symbol for content" do subject do - helper.twitter_card_tag("title", :default_title) + helper.x_card_tag("title", :default_title) end it "generates a meta tag with the i18n content" do @@ -74,7 +74,7 @@ context "when using a symbol for content with interpolation" do subject do - helper.twitter_card_tag("title", :title, petition: "Show us the money") + helper.x_card_tag("title", :title, petition: "Show us the money") end it "generates a meta tag with the i18n content" do @@ -90,7 +90,7 @@ end subject do - helper.twitter_card_tag("image", "os-social/opengraph-image.png") + helper.x_card_tag("image", "os-social/opengraph-image.png") end it "generates a meta tag with the correct asset image url" do