Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add WNP 134 (fixes #15750) #15779

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions bedrock/firefox/redirects.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,21 @@ 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-de-c",
"wnp134-en-ca-a",
"wnp134-en-ca-b",
"wnp134-en-ca-c",
"wnp134-en-na-a",
"wnp134-en-na-b",
"wnp134-en-na-c",
"wnp134-en-uk-a",
"wnp134-en-uk-b",
"wnp134-en-uk-c",
"wnp134-fr-a",
"wnp134-fr-b",
"wnp134-fr-c",
]

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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{#
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 %}
{% 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 %}
{% endif %}

{% if variant == '1' %}
{% set qrcode = 'en-ca-a' %}
{% elif variant == '2' %}
{% set qrcode = 'en-ca-b' %}
{% else %}
{% set qrcode = 'en-ca-c' %}
{% 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 %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{#
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.' %}
{% 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.' %}
{% endif %}

{% if variant == '1' %}
{% set qrcode = 'de-a' %}
{% elif variant == '2' %}
{% set qrcode = 'de-b' %}
{% else %}
{% set qrcode = 'de-c' %}
{% 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 %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{#
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.' %}
{% 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.' %}
{% endif %}

{% if variant == '1' %}
{% set qrcode = 'fr-a' %}
{% elif variant == '2' %}
{% set qrcode = 'fr-b' %}
{% else %}
{% set qrcode = 'fr-c' %}
{% 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 %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{#
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 %}
{% 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 %}
{% endif %}

{% if variant == '1' %}
{% set qrcode = 'en-gb-a' %}
{% elif variant == '2' %}
{% set qrcode = 'en-gb-b' %}
{% else %}
{% set qrcode = 'en-gb-c' %}
{% 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 %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{#
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 %}

{% if variant == '1' %}
{% set qrcode = 'en-us-a' %}
{% elif variant == '2' %}
{% set qrcode = 'en-us-b' %}
{% else %}
{% set qrcode = 'en-us-c' %}
{% 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
Loading
Loading