Skip to content

Commit

Permalink
Update fallback WNP [fix mozilla#14501] (mozilla#14577)
Browse files Browse the repository at this point in the history
  • Loading branch information
craigcook authored May 22, 2024
1 parent 7030e72 commit 5f15398
Show file tree
Hide file tree
Showing 17 changed files with 85 additions and 424 deletions.
80 changes: 0 additions & 80 deletions bedrock/firefox/templates/firefox/whatsnew/index-account.html

This file was deleted.

56 changes: 23 additions & 33 deletions bedrock/firefox/templates/firefox/whatsnew/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
file, You can obtain one at https://mozilla.org/MPL/2.0/.
#}

{% from "macros.html" import google_play_button, apple_app_store_button with context %}

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

{% block page_title %}{{ftl('whatsnew-s2d-download-firefox-for-android')}}{% endblock %}
{% block page_title %}{{ ftl('whatsnew-s2d-download-firefox-for-android') }}{% endblock %}
{% block page_desc %}{{ ftl('whatsnew-page-description') }}{% endblock %}

{#- This will appear as <meta property="og:description"> which can be used for social share -#}
{% block page_og_desc %}{{ ftl('whatsnew-page-description') }}{% endblock %}
Expand All @@ -20,41 +23,28 @@
{{ css_bundle('firefox_whatsnew') }}
{% endblock %}

{% set show_send_to_device = LANG in settings.SEND_TO_DEVICE_LOCALES %}

{% set send_to_device_message_set = 'fx-whatsnew' %}
{% set android_url = play_store_url('firefox', 'firefox-whatsnew') %}
{% set ios_url = app_store_url('firefox', 'firefox-whatsnew') %}

{% block wnp_content %}
<section class="wnp-content-main{% if show_send_to_device %} show-send-to-device{% endif %}">
<div class="mzp-l-content mzp-t-content-md">
<header>
<div class="mzp-c-logo mzp-t-logo-lg mzp-t-product-firefox"></div>
{# If user is in a locale with translated basket messages... #}
{% if show_send_to_device %}
{% if ftl_has_messages('whatsnew-s2d-want-privacy-on-every-device', 'whatsnew-s2d-you-got-it-get-firefox-for') %}
<h1 class="wnp-main-title">{{ ftl('whatsnew-s2d-want-privacy-on-every-device') }}</h1>
<p class="wnp-main-tagline">{{ ftl('whatsnew-s2d-you-got-it-get-firefox-for') }}</p>
{% else %}
<h1 class="wnp-main-title">{{ ftl('whatsnew-s2d-send-firefox-to-your-phone') }}</h1>
{% endif %}
{# For users not in a locale with translated basket messages... #}
{% else %}
<h1 class="wnp-main-title">{{ ftl('whatsnew-s2d-download-firefox-for-your') }}</h1>
{% endif %}
</header>

{# Only certain locales get send_to_device, else they see a QRCode. #}
{% if show_send_to_device %}
<div id="send-to-device-wrapper" class="primary-cta">
{{ send_to_device(include_title=False, message_set=send_to_device_message_set, spinner_color='#fff;') }}
</div>
{% else %}
<div id="qr-wrapper" class="primary-cta">
<img src="{{ static('img/firefox/whatsnew/qrcode-firefox-whatsnew.png') }}" width="250" height="250" alt="">
</div>
{% endif %}
<section class="wnp-content-main">
<div class="mzp-l-content mzp-t-content-md">
<h1 class="wnp-main-title">{{ ftl('whatsnew-s2d-download-firefox-for-your') }}</h1>

<div class="qr-wrapper">
<img class="qr-code" src="{{ static('img/firefox/whatsnew/qrcode-firefox-whatsnew.png') }}" width="180" height="180" alt="{{ ftl('whatsnew-s2d-qr-code-alt') }}">
</div>
</section>

<ul class="mobile-download-buttons">
<li class="android">
{{ google_play_button(href=android_url, id='play-store-link') }}
</li>
<li class="ios">
{{ apple_app_store_button(href=ios_url, id='app-store-link') }}
</li>
</ul>
</div>
</section>
{% endblock %}

{% block js %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ <h1 class="wnp-main-title">{{ ftl('whatsnew-s2d-want-privacy-on-every-device') }
<p class="wnp-main-tagline">{{ ftl('whatsnew-s2d-you-got-it-get-firefox-for') }}</p>

<div id="qr-wrapper">
<img src="{{ static('img/firefox/whatsnew/whatsnew122/qrcode-firefox-whatsnew-122.png') }}" width="250" height="250" alt="{{ ftl('whatsnew-account-qr-code-alt') }}">
<img src="{{ static('img/firefox/whatsnew/whatsnew122/qrcode-firefox-whatsnew-122.png') }}" width="250" height="250" alt="{{ ftl('whatsnew-s2d-qr-code-alt') }}">
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions bedrock/firefox/tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def test_context_variables_whatsnew(self, render_mock):
self.view(req, version="70.0")
template = render_mock.call_args[0][1]
ctx = render_mock.call_args[0][2]
assert template == ["firefox/whatsnew/index-account.html"]
assert template == ["firefox/whatsnew/index.html"]
assert ctx["version"] == "70.0"
assert ctx["analytics_version"] == "70"
assert ctx["entrypoint"] == "mozilla.org-whatsnew70"
Expand Down Expand Up @@ -478,7 +478,7 @@ def test_fx_default_whatsnew_sync(self, render_mock):
req = self.rf.get("/en-US/firefox/whatsnew/")
self.view(req, version="60.0")
template = render_mock.call_args[0][1]
assert template == ["firefox/whatsnew/index-account.html"]
assert template == ["firefox/whatsnew/index.html"]

@override_settings(DEV=True)
@patch.object(fx_views, "ftl_file_is_active", lambda *x: False)
Expand Down
17 changes: 2 additions & 15 deletions bedrock/firefox/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,15 +334,6 @@ def show_57_dev_firstrun(version):
return version >= Version("57.0")


def show_default_account_whatsnew(version):
try:
version = Version(version)
except ValueError:
return False

return version >= Version("60.0")


class FirstrunView(L10nTemplateView):
ftl_files_map = {"firefox/developer/firstrun.html": ["firefox/developer"]}

Expand Down Expand Up @@ -379,7 +370,6 @@ class WhatsnewView(L10nTemplateView):
"firefox/developer/whatsnew.html": ["firefox/developer"],
"firefox/developer/whatsnew-mdnplus.html": ["firefox/whatsnew/whatsnew-developer-mdnplus"],
"firefox/nightly/whatsnew.html": ["firefox/nightly/whatsnew", "firefox/whatsnew/whatsnew"],
"firefox/whatsnew/index-account.html": ["firefox/whatsnew/whatsnew-account", "firefox/whatsnew/whatsnew"],
"firefox/whatsnew/index.html": ["firefox/whatsnew/whatsnew-s2d", "firefox/whatsnew/whatsnew"],
"firefox/whatsnew/whatsnew-fx119-eu-relay.html": ["firefox/whatsnew/whatsnew"],
"firefox/whatsnew/whatsnew-fx119-eu-trio-v1.html": ["firefox/whatsnew/whatsnew"],
Expand Down Expand Up @@ -579,14 +569,11 @@ def get_template_names(self):
else:
template = "firefox/whatsnew/index.html"
else:
if show_default_account_whatsnew(version) and ftl_file_is_active("firefox/whatsnew/whatsnew-account"):
template = "firefox/whatsnew/index-account.html"
else:
template = "firefox/whatsnew/index.html"
template = "firefox/whatsnew/index.html"

# do not promote Mozilla VPN in excluded countries.
if country in settings.VPN_EXCLUDED_COUNTRY_CODES and template in self.vpn_excluded_templates:
template = "firefox/whatsnew/index-account.html"
template = "firefox/whatsnew/index.html"

# return a list to conform with original intention
return [template]
Expand Down
3 changes: 0 additions & 3 deletions l10n/configs/pontoon.toml
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,6 @@ locales = [
[[paths]]
reference = "en/firefox/welcome/page14.ftl"
l10n = "{locale}/firefox/welcome/page14.ftl"
[[paths]]
reference = "en/firefox/whatsnew/whatsnew-account.ftl"
l10n = "{locale}/firefox/whatsnew/whatsnew-account.ftl"
[[paths]]
reference = "en/firefox/whatsnew/whatsnew-s2d.ftl"
l10n = "{locale}/firefox/whatsnew/whatsnew-s2d.ftl"
Expand Down
27 changes: 0 additions & 27 deletions l10n/en/firefox/whatsnew/whatsnew-account.ftl

This file was deleted.

3 changes: 3 additions & 0 deletions l10n/en/firefox/whatsnew/whatsnew-s2d.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ whatsnew-s2d-you-got-it-get-firefox-for = You got it. Get { -brand-name-firefox
whatsnew-s2d-send-firefox-to-your-phone = Send { -brand-name-firefox } to your phone<br> and unleash your Internet.
whatsnew-s2d-download-firefox-for-your = Download { -brand-name-firefox } for your smartphone and tablet.
# An accessible label for a QR code image
whatsnew-s2d-qr-code-alt = Scan this QR code
95 changes: 0 additions & 95 deletions media/css/firefox/whatsnew/whatsnew-account.scss

This file was deleted.

Loading

0 comments on commit 5f15398

Please sign in to comment.