Skip to content

Commit

Permalink
Add WNP 134 (fixes mozilla#15750)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgibson committed Dec 19, 2024
1 parent a2eb92c commit fb70a44
Show file tree
Hide file tree
Showing 40 changed files with 855 additions and 0 deletions.
10 changes: 10 additions & 0 deletions bedrock/firefox/redirects.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ def mobile_app(request, *args, **kwargs):
"fxshare7",
"DESKTOP_FEATURE_CALLOUT_SIGNED_INTO_ACCOUNT.treatment_a",
"DESKTOP_FEATURE_CALLOUT_SIGNED_INTO_ACCOUNT.treatment_b",
"wnp134-de-a",
"wnp134-de-b",
"wnp134-en-ca-a",
"wnp134-en-ca-b",
"wnp134-en-na-a",
"wnp134-en-na-b",
"wnp134-en-uk-a",
"wnp134-en-uk-b",
"wnp134-fr-a",
"wnp134-fr-b",
]

for p in product_options:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{#
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/.
#}

<div class="wnp-qr-code">
<figure>
<div class="wnp-qr-code-wrapper">
{{ resp_img(
url='img/firefox/whatsnew/whatsnew134/' + qrcode + '-200.png',
srcset={
'img/firefox/whatsnew/whatsnew134/' + qrcode + '-400.png': '2x'
},
optional_attributes={
'class': 'wnp-main-image',
'width': '200',
'height': '200'
}
) }}

{% if variant == '2' %}
<img class="wnp-sticker-v2-foxy animate-pop-in-v2-foxy" src="{{ static('img/firefox/whatsnew/whatsnew134/wnp-134-b-foxy.svg') }}" width="141" height="101" alt="">
<img class="wnp-sticker-v2-laptop animate-pop-in-v2-laptop" src="{{ static('img/firefox/whatsnew/whatsnew134/wnp-134-b-laptop.svg') }}" width="179" height="132" alt="">
<img class="wnp-sticker-v2-heart animate-pop-in-v2-heart" src="{{ static('img/firefox/whatsnew/whatsnew134/wnp-134-b-heart.svg') }}" width="86" height="77" alt="">
<img class="wnp-sticker-v2-phone animate-pop-in-v2-phone" src="{{ static('img/firefox/whatsnew/whatsnew134/wnp-134-b-phone.svg') }}" width="77" height="121" alt="">
<img class="wnp-sticker-v2-sync animate-pop-in-v2-sync" src="{{ static('img/firefox/whatsnew/whatsnew134/wnp-134-b-sync.svg') }}" width="82" height="81" alt="">
{% else %}
<img class="wnp-sticker-v1-foxy animate-pop-in-v1-foxy" src="{{ static('img/firefox/whatsnew/whatsnew134/wnp-134-a-foxy.svg') }}" width="132" height="112" alt="">
<img class="wnp-sticker-v1-eye animate-pop-in-v1-eye" src="{{ static('img/firefox/whatsnew/whatsnew134/wnp-134-a-eye.svg') }}" width="105" height="105" alt="">
<img class="wnp-sticker-v1-padlock animate-pop-in-v1-padlock" src="{{ static('img/firefox/whatsnew/whatsnew134/wnp-134-a-padlock.svg') }}" width="119" height="115" alt="">
{% endif %}
</div>

<figcaption>{{ caption }}</figcaption>
</figure>
</div>
47 changes: 47 additions & 0 deletions bedrock/firefox/templates/firefox/whatsnew/whatsnew-fx134-ca.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{#
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/.
#}

{% extends "firefox/whatsnew/base.html" %}

{% block page_css %}
{{ css_bundle('firefox_whatsnew_134') }}
{% endblock %}

{% block experiments %}
{{ js_bundle('firefox_whatsnew_134_experiment') }}
{% endblock %}

{% if variant == '2' %}
{% set title = 'Stay productive on the go' %}
{% set desc = 'Syncing your Firefox tabs across your devices means you can work, <br>read and shop whenever and wherever.'|safe %}
{% set qrcode = 'en-ca-b' %}
{% else %}
{% set title = 'Privacy in your pocket' %}
{% set desc = 'You deserve privacy even when you’re in public. With Firefox on your phone, <br>you can trust you won’t be followed around online wherever you go.'|safe %}
{% set qrcode = 'en-ca-a' %}
{% endif %}

{% block wnp_content %}
<section class="wnp-content-main">
<div class="mzp-l-content mzp-t-content-md">
<h1 class="wnp-main-title">{{ title }}</h1>
<p class="wnp-main-tagline">{{ desc }}</p>

{% with qrcode=qrcode, caption='Scan to get Firefox on your phone or tablet' %}
{% include "firefox/whatsnew/includes/fx134/qrcode.html" %}
{% endwith %}
</div>
</section>

<section class="wnp-footer">
<p class="wnp-sign-off">{{ ftl('whatsnew-signoff') }}</p>
{% include "firefox/whatsnew/includes/mofo-donate-cta.html" %}
</section>
{% endblock %}

{% block js %}
{{ js_bundle('firefox_whatsnew_events') }}
{% endblock %}
47 changes: 47 additions & 0 deletions bedrock/firefox/templates/firefox/whatsnew/whatsnew-fx134-de.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{#
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/.
#}

{% extends "firefox/whatsnew/base.html" %}

{% block page_css %}
{{ css_bundle('firefox_whatsnew_134') }}
{% endblock %}

{% block experiments %}
{{ js_bundle('firefox_whatsnew_134_experiment') }}
{% endblock %}

{% if variant == '2' %}
{% set title = 'Bleib unterwegs produktiv' %}
{% set desc = 'Wenn „produktiver sein“ auf deiner Liste mit guten Vorsätzen für 2025 steht, ist das Synchronisieren von Firefox auf all deinen Geräten der perfekte Start.' %}
{% set qrcode = 'de-b' %}
{% else %}
{% set title = 'Datenschutz für die Hosentasche' %}
{% set desc = 'Du verdienst Privatsphäre. Mit Firefox auf deinem Smartphone kannst du darauf vertrauen, dass du online nicht auf Schritt und Tritt verfolgt wirst.' %}
{% set qrcode = 'de-a' %}
{% endif %}

{% block wnp_content %}
<section class="wnp-content-main">
<div class="mzp-l-content mzp-t-content-md">
<h1 class="wnp-main-title">{{ title }}</h1>
<p class="wnp-main-tagline">{{ desc }}</p>

{% with qrcode=qrcode, caption='Scanne, um Firefox auf deinem Smartphone oder Tablet zu installieren.' %}
{% include "firefox/whatsnew/includes/fx134/qrcode.html" %}
{% endwith %}
</div>
</section>

<section class="wnp-footer">
<p class="wnp-sign-off">{{ ftl('whatsnew-signoff') }}</p>
{% include "firefox/whatsnew/includes/mofo-donate-cta.html" %}
</section>
{% endblock %}

{% block js %}
{{ js_bundle('firefox_whatsnew_events') }}
{% endblock %}
47 changes: 47 additions & 0 deletions bedrock/firefox/templates/firefox/whatsnew/whatsnew-fx134-fr.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{#
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/.
#}

{% extends "firefox/whatsnew/base.html" %}

{% block page_css %}
{{ css_bundle('firefox_whatsnew_134') }}
{% endblock %}

{% block experiments %}
{{ js_bundle('firefox_whatsnew_134_experiment') }}
{% endblock %}

{% if variant == '2' %}
{% set title = 'Restez productif où que vous soyez' %}
{% set desc = 'La synchronisation de vos onglets Firefox sur tous vos appareils vous permet de travailler, de lire et de faire des achats de n’importe où sans perdre le fil.' %}
{% set qrcode = 'fr-b' %}
{% else %}
{% set title = 'La confidentialité dans votre poche' %}
{% set desc = 'Vous méritez d’être protégé, même en public. Naviguez sans être suivi avec Firefox sur votre téléphone.' %}
{% set qrcode = 'fr-a' %}
{% endif %}

{% block wnp_content %}
<section class="wnp-content-main">
<div class="mzp-l-content mzp-t-content-md">
<h1 class="wnp-main-title">{{ title }}</h1>
<p class="wnp-main-tagline">{{ desc }}</p>

{% with qrcode=qrcode, caption='Scanner pour installer Firefox sur votre téléphone ou tablette' %}
{% include "firefox/whatsnew/includes/fx134/qrcode.html" %}
{% endwith %}
</div>
</section>

<section class="wnp-footer">
<p class="wnp-sign-off">{{ ftl('whatsnew-signoff') }}</p>
{% include "firefox/whatsnew/includes/mofo-donate-cta.html" %}
</section>
{% endblock %}

{% block js %}
{{ js_bundle('firefox_whatsnew_events') }}
{% endblock %}
46 changes: 46 additions & 0 deletions bedrock/firefox/templates/firefox/whatsnew/whatsnew-fx134-gb.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{#
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/.
#}

{% extends "firefox/whatsnew/base.html" %}

{% block page_css %}
{{ css_bundle('firefox_whatsnew_134') }}
{% endblock %}

{% block experiments %}
{{ js_bundle('firefox_whatsnew_134_experiment') }}
{% endblock %}

{% if variant == '2' %}
{% set title = 'Stay productive on the go' %}
{% set desc = 'Syncing your Firefox tabs across your devices means you can work, <br>read and shop whenever and wherever.'|safe %}
{% set qrcode = 'en-gb-b' %}
{% else %}
{% set title = 'Privacy in your pocket' %}
{% set desc = 'You deserve privacy even when you’re in public. With Firefox on your phone, <br>you can trust you won’t be followed around online wherever you go.'|safe %}
{% set qrcode = 'en-gb-a' %}
{% endif %}

{% block wnp_content %}
<section class="wnp-content-main">
<div class="mzp-l-content mzp-t-content-md">
<h1 class="wnp-main-title">{{ title }}</h1>
<p class="wnp-main-tagline">{{ desc }}</p>

{% with qrcode=qrcode, caption='Scan to get Firefox on your phone or tablet' %}
{% include "firefox/whatsnew/includes/fx134/qrcode.html" %}
{% endwith %}
</section>

<section class="wnp-footer">
<p class="wnp-sign-off">{{ ftl('whatsnew-signoff') }}</p>
{% include "firefox/whatsnew/includes/mofo-donate-cta.html" %}
</section>
{% endblock %}

{% block js %}
{{ js_bundle('firefox_whatsnew_events') }}
{% endblock %}
47 changes: 47 additions & 0 deletions bedrock/firefox/templates/firefox/whatsnew/whatsnew-fx134-us.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{#
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/.
#}

{% extends "firefox/whatsnew/base.html" %}

{% block page_css %}
{{ css_bundle('firefox_whatsnew_134') }}
{% endblock %}

{% block experiments %}
{{ js_bundle('firefox_whatsnew_134_experiment') }}
{% endblock %}

{% if variant == '2' %}
{% set title = 'Stay productive on the go' %}
{% set desc = 'Syncing your Firefox tabs across your devices means you can work, <br>read and shop whenever and wherever.'|safe %}
{% set qrcode = 'en-us-b' %}
{% else %}
{% set title = 'Privacy in your pocket' %}
{% set desc = 'You deserve privacy even when you’re in public. With Firefox on your phone, <br>you can trust you won’t be followed around online wherever you go.'|safe %}
{% set qrcode = 'en-us-a' %}
{% endif %}

{% block wnp_content %}
<section class="wnp-content-main">
<div class="mzp-l-content mzp-t-content-md">
<h1 class="wnp-main-title">{{ title }}</h1>
<p class="wnp-main-tagline">{{ desc }}</p>

{% with qrcode=qrcode, caption='Scan to get Firefox on your phone or tablet' %}
{% include "firefox/whatsnew/includes/fx134/qrcode.html" %}
{% endwith %}
</div>
</section>

<section class="wnp-footer">
<p class="wnp-sign-off">{{ ftl('whatsnew-signoff') }}</p>
{% include "firefox/whatsnew/includes/mofo-donate-cta.html" %}
</section>
{% endblock %}

{% block js %}
{{ js_bundle('firefox_whatsnew_events') }}
{% endblock %}
58 changes: 58 additions & 0 deletions bedrock/firefox/tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1620,6 +1620,64 @@ def test_fx_133_0_0_newsletter_en_ca_fr_v3(self, render_mock):

# end 133.0 whatsnew tests

# begin 134.0 whatsnew tests

@override_settings(DEV=True)
def test_fx_134_0_0_en_us(self, render_mock):
"""Should use whatsnew-fx134-us.html template for en-US"""
req = self.rf.get("/firefox/whatsnew/")
req.locale = "en-US"
self.view(req, version="134.0")
template = render_mock.call_args[0][1]
assert template == ["firefox/whatsnew/whatsnew-fx134-us.html"]

@override_settings(DEV=True)
def test_fx_134_0_0_en_ca(self, render_mock):
"""Should use whatsnew-fx134-ca.html template for en-CA"""
req = self.rf.get("/firefox/whatsnew/")
req.locale = "en-CA"
self.view(req, version="134.0")
template = render_mock.call_args[0][1]
assert template == ["firefox/whatsnew/whatsnew-fx134-ca.html"]

@override_settings(DEV=True)
def test_fx_134_0_0_en_gb(self, render_mock):
"""Should use whatsnew-fx134-gb.html template for en-GB"""
req = self.rf.get("/firefox/whatsnew/")
req.locale = "en-GB"
self.view(req, version="134.0")
template = render_mock.call_args[0][1]
assert template == ["firefox/whatsnew/whatsnew-fx134-gb.html"]

@override_settings(DEV=True)
def test_fx_134_0_0_de(self, render_mock):
"""Should use whatsnew-fx134-de.html template for de"""
req = self.rf.get("/firefox/whatsnew/")
req.locale = "de"
self.view(req, version="134.0")
template = render_mock.call_args[0][1]
assert template == ["firefox/whatsnew/whatsnew-fx134-de.html"]

@override_settings(DEV=True)
def test_fx_134_0_0_fr(self, render_mock):
"""Should use whatsnew-fx134-fr.html template for fr"""
req = self.rf.get("/firefox/whatsnew/")
req.locale = "fr"
self.view(req, version="134.0")
template = render_mock.call_args[0][1]
assert template == ["firefox/whatsnew/whatsnew-fx134-fr.html"]

@override_settings(DEV=True)
def test_fx_134_0_0_es_es(self, render_mock):
"""Should use default WNP template for other locales"""
req = self.rf.get("/firefox/whatsnew/")
req.locale = "es-ES"
self.view(req, version="134.0")
template = render_mock.call_args[0][1]
assert template == ["firefox/whatsnew/index.html"]

# end 134.0 whatsnew tests


@patch("bedrock.firefox.views.l10n_utils.render", return_value=HttpResponse())
class TestFirstRun(TestCase):
Expand Down
18 changes: 18 additions & 0 deletions bedrock/firefox/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,11 @@ class WhatsnewView(L10nTemplateView):
"firefox/whatsnew/whatsnew-fx133-donation-eu.html": ["firefox/whatsnew/whatsnew"],
"firefox/whatsnew/whatsnew-fx133-donation-na.html": ["firefox/whatsnew/whatsnew"],
"firefox/whatsnew/whatsnew-fx135beta.html": ["firefox/whatsnew/whatsnew"],
"firefox/whatsnew/whatsnew-fx134-us.html": ["firefox/whatsnew/whatsnew"],
"firefox/whatsnew/whatsnew-fx134-ca.html": ["firefox/whatsnew/whatsnew"],
"firefox/whatsnew/whatsnew-fx134-gb.html": ["firefox/whatsnew/whatsnew"],
"firefox/whatsnew/whatsnew-fx134-de.html": ["firefox/whatsnew/whatsnew"],
"firefox/whatsnew/whatsnew-fx134-fr.html": ["firefox/whatsnew/whatsnew"],
}

# specific templates that should not be rendered in
Expand Down Expand Up @@ -641,6 +646,19 @@ def get_template_names(self):
template = "firefox/whatsnew/index.html"
else:
template = "firefox/whatsnew/index.html"
elif version.startswith("134."):
if locale == "en-US":
template = "firefox/whatsnew/whatsnew-fx134-us.html"
elif locale == "en-CA":
template = "firefox/whatsnew/whatsnew-fx134-ca.html"
elif locale == "en-GB":
template = "firefox/whatsnew/whatsnew-fx134-gb.html"
elif locale == "de":
template = "firefox/whatsnew/whatsnew-fx134-de.html"
elif locale == "fr":
template = "firefox/whatsnew/whatsnew-fx134-fr.html"
else:
template = "firefox/whatsnew/index.html"
elif version.startswith("133."):
if locale in self.wnp_133_vpn_langs and country in settings.VPN_MOBILE_SUB_COUNTRY_CODES:
template = "firefox/whatsnew/whatsnew-fx133-vpn.html"
Expand Down
Loading

0 comments on commit fb70a44

Please sign in to comment.