Skip to content

Commit

Permalink
Merge pull request #2383 from alphagov/success_alert_content_update
Browse files Browse the repository at this point in the history
Update email subscription banner content
  • Loading branch information
danacotoran authored Mar 10, 2022
2 parents 0baee95 + 2bbe914 commit 4d48572
Show file tree
Hide file tree
Showing 68 changed files with 88 additions and 89 deletions.
15 changes: 15 additions & 0 deletions app/helpers/content_items_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module ContentItemsHelper
def email_subscription_success_banner_heading(account_flash)
if account_flash.include?("email-subscription-success")
sanitize(t("email.subscribe_title"))
elsif account_flash.include?("email-unsubscribe-success")
sanitize(t("email.unsubscribe_title"))
elsif account_flash.include?("email-subscription-already-subscribed")
sanitize(t("email.already_subscribed_title"))
end
end

def show_email_subscription_success_banner?(account_flash)
account_flash.include?("email-subscription-success") || account_flash.include?("email-unsubscribe-success") || account_flash.include?("email-subscription-already-subscribed")
end
end
30 changes: 7 additions & 23 deletions app/views/shared/_email_subscribe_unsubscribe_flash.html.erb
Original file line number Diff line number Diff line change
@@ -1,29 +1,13 @@
<% if @account_flash.include?("email-subscription-success") %>
<% banner_description = capture do %>
<a class="govuk-link govuk-notification-banner__link" href="/email/manage"><%= t("email.description") %></a>
<% end %>

<% if show_email_subscription_success_banner?(@account_flash) %>
<div class="govuk-grid-row govuk-!-margin-top-3">
<div class="govuk-grid-column-two-thirds">
<%= render "govuk_publishing_components/components/success_alert", {
message: sanitize(t("email.subscribe_title")),
description: sanitize(t("email.description_html")),
margin_bottom: 0,
} %>
</div>
</div>
<% elsif @account_flash.include?("email-unsubscribe-success") %>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds govuk-!-margin-top-3">
<%= render "govuk_publishing_components/components/success_alert", {
message: sanitize(t("email.unsubscribe_title")),
description: sanitize(t("email.description_html")),
margin_bottom: 0,
} %>
</div>
</div>
<% elsif @account_flash.include?("email-subscription-already-subscribed") %>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds govuk-!-margin-top-3">
<%= render "govuk_publishing_components/components/success_alert", {
message: sanitize(t("email.already_subscribed_title")),
description: sanitize(t("email.description_html")),
message: email_subscription_success_banner_heading(@account_flash),
description: banner_description,
margin_bottom: 0,
} %>
</div>
Expand Down
2 changes: 1 addition & 1 deletion config/locales/ar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ ar:
welsh_language_scheme_html: تعرف على التزامنا بشأن %{link}.
email:
already_subscribed_title:
description_html:
description:
subscribe_title:
unsubscribe_title:
fatality_notice:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/az.yml
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ az:
welsh_language_scheme_html: "%{link} ilə bağlı öhdəliyimiz barədə öyrənin."
email:
already_subscribed_title:
description_html:
description:
subscribe_title:
unsubscribe_title:
fatality_notice:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/be.yml
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ be:
welsh_language_scheme_html: Даведайцеся аб нашых абавязках да публікацыі ў %{link}.
email:
already_subscribed_title:
description_html:
description:
subscribe_title:
unsubscribe_title:
fatality_notice:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/bg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ bg:
welsh_language_scheme_html: Научете повече за нашия ангажимент към %{link}.
email:
already_subscribed_title:
description_html:
description:
subscribe_title:
unsubscribe_title:
fatality_notice:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/bn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ bn:
welsh_language_scheme_html: "%{link}-এ আপনার আমাদের অঙ্গীকার সম্পর্কে জানুন।"
email:
already_subscribed_title:
description_html:
description:
subscribe_title:
unsubscribe_title:
fatality_notice:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ cs:
welsh_language_scheme_html: Přečtěte si o našem závazku k %{link}.
email:
already_subscribed_title:
description_html:
description:
subscribe_title:
unsubscribe_title:
fatality_notice:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/cy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ cy:
welsh_language_scheme_html: Dysgwch am ein hymrwymiad i %{link}.
email:
already_subscribed_title:
description_html:
description:
subscribe_title:
unsubscribe_title:
fatality_notice:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/da.yml
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ da:
welsh_language_scheme_html: Learn more about our commitment to% {link}.
email:
already_subscribed_title:
description_html:
description:
subscribe_title:
unsubscribe_title:
fatality_notice:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ de:
welsh_language_scheme_html: Informieren Sie sich über unser Engagement für %{link}.
email:
already_subscribed_title:
description_html:
description:
subscribe_title:
unsubscribe_title:
fatality_notice:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/dr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ dr:
welsh_language_scheme_html: از تعهد ما به %{link} مطلع شوید.
email:
already_subscribed_title:
description_html:
description:
subscribe_title:
unsubscribe_title:
fatality_notice:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/el.yml
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ el:
welsh_language_scheme_html: Μάθετε για τη δέσμευσή μας στο %{link}.
email:
already_subscribed_title:
description_html:
description:
subscribe_title:
unsubscribe_title:
fatality_notice:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ en:
welsh_language_scheme_html: Find out about our commitment to %{link}.
email:
already_subscribed_title: You’re already getting emails about this page
description_html: <p class="govuk-body">Go to your GOV.UK account to <a class="govuk-link govuk-notification-banner__link" href="/email/manage">see and manage all your GOV.UK email subscriptions</a>.</p>
description: See and manage all your GOV.UK email subscriptions
subscribe_title: You’ve subscribed to emails about this page
unsubscribe_title: You’ve unsubscribed from emails about this page
fatality_notice:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/es-419.yml
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ es-419:
welsh_language_scheme_html: Conozca nuestro compromiso con %{link}.
email:
already_subscribed_title:
description_html:
description:
subscribe_title:
unsubscribe_title:
fatality_notice:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ es:
welsh_language_scheme_html: Encuentre más sobre nuestro compromiso de publicar en %{link}.
email:
already_subscribed_title:
description_html:
description:
subscribe_title:
unsubscribe_title:
fatality_notice:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/et.yml
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ et:
welsh_language_scheme_html: Lisateave meie pühendumuse kohta %{link}.
email:
already_subscribed_title:
description_html:
description:
subscribe_title:
unsubscribe_title:
fatality_notice:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/fa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ fa:
welsh_language_scheme_html: درباره تعهد ما نسبت به %{link} اطلاعات کسب کنید.
email:
already_subscribed_title:
description_html:
description:
subscribe_title:
unsubscribe_title:
fatality_notice:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/fi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ fi:
welsh_language_scheme_html: Tutustu sitoumukseemme %{link}.
email:
already_subscribed_title:
description_html:
description:
subscribe_title:
unsubscribe_title:
fatality_notice:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ fr:
welsh_language_scheme_html: Découvrez comment nous nous engageons sur %{link}.
email:
already_subscribed_title:
description_html:
description:
subscribe_title:
unsubscribe_title:
fatality_notice:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/gd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ gd:
welsh_language_scheme_html: Faigh amach ár gcomhréiteach ar an %{link}.
email:
already_subscribed_title:
description_html:
description:
subscribe_title:
unsubscribe_title:
fatality_notice:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/gu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ gu:
welsh_language_scheme_html: "%{link} પ્રત્યે અમારી પ્રતિબદ્ધતા અંગે જાણો."
email:
already_subscribed_title:
description_html:
description:
subscribe_title:
unsubscribe_title:
fatality_notice:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/he.yml
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ he:
welsh_language_scheme_html: מידע נוסף על המחויבות שלנו לפרסום %{link}
email:
already_subscribed_title:
description_html:
description:
subscribe_title:
unsubscribe_title:
fatality_notice:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/hi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ hi:
welsh_language_scheme_html: हमारी प्रकाशन के प्रति वचनबद्धता के बारे में जानें %(link)।
email:
already_subscribed_title:
description_html:
description:
subscribe_title:
unsubscribe_title:
fatality_notice:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/hr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ hr:
welsh_language_scheme_html: Saznajte o našoj predanosti %{link}.
email:
already_subscribed_title:
description_html:
description:
subscribe_title:
unsubscribe_title:
fatality_notice:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/hu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ hu:
welsh_language_scheme_html: 'Tájékozódjon az információk közzétételével kapcsolatos elkötelezettségünkről: %{link}'
email:
already_subscribed_title:
description_html:
description:
subscribe_title:
unsubscribe_title:
fatality_notice:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/hy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ hy:
welsh_language_scheme_html: 'Տեղեկանալ մեր աշխատանքի մասին %{link} հղումով:'
email:
already_subscribed_title:
description_html:
description:
subscribe_title:
unsubscribe_title:
fatality_notice:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/id.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ id:
welsh_language_scheme_html: Cari tahu komitmen kami kepada %{link}.
email:
already_subscribed_title:
description_html:
description:
subscribe_title:
unsubscribe_title:
fatality_notice:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/is.yml
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ is:
welsh_language_scheme_html: Kynntu þér skuldbindingu okkar við %{link}.
email:
already_subscribed_title:
description_html:
description:
subscribe_title:
unsubscribe_title:
fatality_notice:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/it.yml
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ it:
welsh_language_scheme_html: Scopri il nostro impegno per %{link}.
email:
already_subscribed_title:
description_html:
description:
subscribe_title:
unsubscribe_title:
fatality_notice:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ ja:
welsh_language_scheme_html: 情報公開の詳細については %{link} をご覧下さい。
email:
already_subscribed_title:
description_html:
description:
subscribe_title:
unsubscribe_title:
fatality_notice:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/ka.yml
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ ka:
welsh_language_scheme_html: გაეცანით ჩვენს ვალდებულებას %{link}.
email:
already_subscribed_title:
description_html:
description:
subscribe_title:
unsubscribe_title:
fatality_notice:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/kk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ kk:
welsh_language_scheme_html: "%{link} қосқан үлесіміз туралы оқыңыз."
email:
already_subscribed_title:
description_html:
description:
subscribe_title:
unsubscribe_title:
fatality_notice:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/ko.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ ko:
welsh_language_scheme_html: "%{link} 에서 정보 공개에 대한 내용."
email:
already_subscribed_title:
description_html:
description:
subscribe_title:
unsubscribe_title:
fatality_notice:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/lt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ lt:
welsh_language_scheme_html: Sužinokite apie mūsų įsipareigojimą skelbti %{link}.
email:
already_subscribed_title:
description_html:
description:
subscribe_title:
unsubscribe_title:
fatality_notice:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/lv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ lv:
welsh_language_scheme_html: Vairāk par mūsu apņemšanos nodrošināt informācijas pieejamību %{link}.
email:
already_subscribed_title:
description_html:
description:
subscribe_title:
unsubscribe_title:
fatality_notice:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/ms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ ms:
welsh_language_scheme_html: Ketahui tentang komitmen kami kepada %{link}.
email:
already_subscribed_title:
description_html:
description:
subscribe_title:
unsubscribe_title:
fatality_notice:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/mt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ mt:
welsh_language_scheme_html: Kun af dwar l-impenn tagħna lejn %{link}.
email:
already_subscribed_title:
description_html:
description:
subscribe_title:
unsubscribe_title:
fatality_notice:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/ne.yml
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ ne:
welsh_language_scheme_html: "%{link} को हाम्रो प्रतिबद्धताको बारेमा जानकारी पाउनुहोस्।"
email:
already_subscribed_title:
description_html:
description:
subscribe_title:
unsubscribe_title:
fatality_notice:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/nl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ nl:
welsh_language_scheme_html: Lees meer over onze inzet voor %{link}.
email:
already_subscribed_title:
description_html:
description:
subscribe_title:
unsubscribe_title:
fatality_notice:
Expand Down
Loading

0 comments on commit 4d48572

Please sign in to comment.