From 9574a8de7f5dfe12fe7970a11044b8d6a8bb5de4 Mon Sep 17 00:00:00 2001 From: Stephanie Hobson Date: Wed, 31 Jul 2024 14:28:43 -0700 Subject: [PATCH] Convert buttons with data-link-type="download" into CTAs Fix #14062 --- .../banners/mobile/firefox-app-store.html | 4 +- .../banners/mobile/focus-app-store.html | 4 +- bedrock/base/templates/macros.html | 18 +- .../firefox/browsers/chromebook.html | 4 +- .../firefox/browsers/mobile/index.html | 8 +- .../templates/firefox/enterprise/index.html | 20 +- .../includes/download-button-thanks.html | 4 +- .../firefox/includes/download-button.html | 19 +- .../firefox/includes/download-list.html | 4 +- .../includes/download-unsupported.html | 6 +- .../templates/firefox/includes/macros.html | 21 +- bedrock/firefox/templates/firefox/index.html | 6 +- bedrock/firefox/tests/test_helpers.py | 8 +- bedrock/firefox/tests/test_views.py | 15 +- .../mozorg/analytics-tests/ga-index.html | 4 +- media/css/firefox/browsers-products.scss | 2 +- media/js/base/base-page-init.js | 2 +- media/js/base/core-datalayer.js | 118 +++++++++ media/js/base/mozilla-utils.js | 29 +-- tests/pages/firefox/family/landing.py | 4 +- tests/unit/spec/base/core-datalayer.js | 238 ++++++++++++++++++ tests/unit/spec/base/mozilla-utils.js | 30 +-- tests/unit/spec/firefox/new/common/thanks.js | 2 +- 23 files changed, 460 insertions(+), 110 deletions(-) create mode 100644 media/js/base/core-datalayer.js create mode 100644 tests/unit/spec/base/core-datalayer.js diff --git a/bedrock/base/templates/includes/banners/mobile/firefox-app-store.html b/bedrock/base/templates/includes/banners/mobile/firefox-app-store.html index 027fcda6027..cfd2572d6b1 100644 --- a/bedrock/base/templates/includes/banners/mobile/firefox-app-store.html +++ b/bedrock/base/templates/includes/banners/mobile/firefox-app-store.html @@ -21,8 +21,8 @@

{{ ftl('banner-firefox-app-store-title') }}

{{ ftl('banner-firefox-app-store-free-google-play') }}

{{ ftl('banner-firefox-app-store-free-app-store') }}

- {{ ftl('ui-view') }} - {{ ftl('ui-view') }} + {{ ftl('ui-view') }} + {{ ftl('ui-view') }} diff --git a/bedrock/base/templates/includes/banners/mobile/focus-app-store.html b/bedrock/base/templates/includes/banners/mobile/focus-app-store.html index 340c0a337e6..efbdafac769 100644 --- a/bedrock/base/templates/includes/banners/mobile/focus-app-store.html +++ b/bedrock/base/templates/includes/banners/mobile/focus-app-store.html @@ -21,8 +21,8 @@

{{ ftl('banner-firefox-focus-app-store-title') }}

{{ ftl('banner-firefox-app-store-free-google-play') }}

{{ ftl('banner-firefox-app-store-free-app-store') }}

- {{ ftl('ui-view') }} - {{ ftl('ui-view') }} + {{ ftl('ui-view') }} + {{ ftl('ui-view') }} diff --git a/bedrock/base/templates/macros.html b/bedrock/base/templates/macros.html index 44ceafb59c1..2aba7a818d4 100644 --- a/bedrock/base/templates/macros.html +++ b/bedrock/base/templates/macros.html @@ -48,7 +48,14 @@ {% macro google_play_button(class_name='', extra_data_attributes={}, extra_img_attributes={}, href=settings.GOOGLE_PLAY_FIREFOX_LINK_UTMS, id='', product='Firefox', target='') -%} {% set optional_img_attributes = {'alt': ftl('download-button-google-play'), 'width': '152', 'height': '45', 'l10n': True} %} {% do optional_img_attributes.update(extra_img_attributes) %} - + {{ resp_img( url='img/firefox/android/btn-google-play.png', srcset={ @@ -61,7 +68,14 @@ {% macro apple_app_store_button(class_name='', extra_data_attributes={}, extra_img_attributes={}, href=settings.APPLE_APPSTORE_FIREFOX_LINK, id='', product='Firefox', target='') -%} {% set optional_img_attributes = {'width': '152', 'height': '45'} %} - + {{ ftl('download-button-download-app-store') }} {%- endmacro %} diff --git a/bedrock/firefox/templates/firefox/browsers/chromebook.html b/bedrock/firefox/templates/firefox/browsers/chromebook.html index a8730a0cd5d..9419bf8ee63 100644 --- a/bedrock/firefox/templates/firefox/browsers/chromebook.html +++ b/bedrock/firefox/templates/firefox/browsers/chromebook.html @@ -49,13 +49,13 @@

{{ ftl('browsers-chromebook-get-firefox-browser') }}<

{{ ftl('browsers-chromebook-dropdown-copy') }}