Skip to content

Commit

Permalink
Add convert.com experimentation sandbox (Fixes mozilla#7508)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpetto authored and alexgibson committed Sep 11, 2019
1 parent 174b3ce commit 9c51fc9
Show file tree
Hide file tree
Showing 21 changed files with 349 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bedrock/base/templates/base-pebbles.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!doctype html>
{# Note the "windows" class, without javascript platform-specific
assets default to windows #}
<html class="windows x86 no-js" lang="{{ LANG|replace('en-US', 'en') }}" dir="{{ DIR }}" data-latest-firefox="{{ latest_firefox_version }}" data-esr-versions="{{ esr_firefox_versions|join(' ') }}" {% if settings.GTM_CONTAINER_ID %}data-gtm-container-id="{{ settings.GTM_CONTAINER_ID }}"{% endif %} {% block gtm_page_id %}{% endblock %} {% if settings.STUB_ATTRIBUTION_RATE %}data-stub-attribution-rate="{{ settings.STUB_ATTRIBUTION_RATE }}"{% endif %}>
<html class="windows x86 no-js" lang="{{ LANG|replace('en-US', 'en') }}" dir="{{ DIR }}" data-latest-firefox="{{ latest_firefox_version }}" data-esr-versions="{{ esr_firefox_versions|join(' ') }}" {% if settings.GTM_CONTAINER_ID %}data-gtm-container-id="{{ settings.GTM_CONTAINER_ID }}"{% endif %} {% block gtm_page_id %}{% endblock %} {% if settings.STUB_ATTRIBUTION_RATE %}data-stub-attribution-rate="{{ settings.STUB_ATTRIBUTION_RATE }}"{% endif %} {% block html_attrs %}{% endblock %}>
<head>
<meta charset="utf-8">{# Note: Must be within first 512 bytes of page #}

Expand Down
2 changes: 1 addition & 1 deletion bedrock/base/templates/base-resp.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!doctype html>
{# Note the "windows" class, without javascript platform-specific
assets default to windows #}
<html class="windows x86 no-js" lang="{{ LANG|replace('en-US', 'en') }}" dir="{{ DIR }}" data-latest-firefox="{{ latest_firefox_version }}" data-esr-versions="{{ esr_firefox_versions|join(' ') }}" {% if settings.GTM_CONTAINER_ID %}data-gtm-container-id="{{ settings.GTM_CONTAINER_ID }}"{% endif %} {% block gtm_page_id %}{% endblock %} {% if settings.STUB_ATTRIBUTION_RATE %}data-stub-attribution-rate="{{ settings.STUB_ATTRIBUTION_RATE }}"{% endif %}>
<html class="windows x86 no-js" lang="{{ LANG|replace('en-US', 'en') }}" dir="{{ DIR }}" data-latest-firefox="{{ latest_firefox_version }}" data-esr-versions="{{ esr_firefox_versions|join(' ') }}" {% if settings.GTM_CONTAINER_ID %}data-gtm-container-id="{{ settings.GTM_CONTAINER_ID }}"{% endif %} {% block gtm_page_id %}{% endblock %} {% if settings.STUB_ATTRIBUTION_RATE %}data-stub-attribution-rate="{{ settings.STUB_ATTRIBUTION_RATE }}"{% endif %} {% block html_attrs %}{% endblock %}>
<head>
<meta charset="utf-8">{# Note: Must be within first 512 bytes of page #}

Expand Down
Empty file added bedrock/exp/__init__.py
Empty file.
Empty file added bedrock/exp/models.py
Empty file.
18 changes: 18 additions & 0 deletions bedrock/exp/templates/exp/base/base-firefox.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{# 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 http://mozilla.org/MPL/2.0/. -#}

{% extends "exp/base/base.html" %}

{% block page_title_prefix %}{% endblock %}
{% block page_title_suffix %}{% endblock %}

{% block page_image %}{{ static('img/firefox/template/page-image-firefox.jpg') }}{% endblock %}
{% block page_favicon %}{{ static('img/firefox/favicon.ico') }}{% endblock %}
{% block page_favicon_large %}{{ static('img/firefox/favicon-196.png') }}{% endblock %}
{% block page_ios_icon %}{{ static('img/firefox/ios-icon-180.png') }}{% endblock %}

{% block facebook_id %}14696440021{# facebook.com/Firefox #}{% endblock %}
{% block twitter_id %}firefox{% endblock %}

{% block body_class %}{{ super() }} mzp-t-firefox{% endblock %}
27 changes: 27 additions & 0 deletions bedrock/exp/templates/exp/base/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{# 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 http://mozilla.org/MPL/2.0/. -#}

{% extends "base-protocol.html" %}

{% block html_attrs %}data-convert-project-id="{{ settings.CONVERT_PROJECT_ID }}"{% endblock %}

{% block experiments %}
{% if switch('convert-experiment-script') %}
{# Pre-fetch the DNS lookup prior to loading the convert script #}
<link rel="dns-prefetch" href="https://cdn-3.convertexperiments.com/">
<!--[if !lte IE 8]><!-->
{{ js_bundle('convert') }}
<!--<![endif]-->
{% endif %}
{% endblock %}

{% block site_js %}
<!--[if !lte IE 8]><!-->
{{ js_bundle('common-protocol-no-jquery') }}
<!--<![endif]-->

<!--[if lte IE 8]>
{{ js_bundle('common-ie8') }}
<![endif]-->
{% endblock %}
28 changes: 28 additions & 0 deletions bedrock/exp/templates/exp/firefox/new/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{# 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 http://mozilla.org/MPL/2.0/. -#}

{% from "macros.html" import google_play_button with context %}
{% from "macros-protocol.html" import hero, picto_card with context %}

{% extends "exp/base/base-firefox.html" %}

{% block canonical_urls %}
{# the SEM campaign page should set canonical to the /firefox/new/ page. #}
<link rel="canonical" href="{{ settings.CANONICAL_URL }}/{{ LANG }}/firefox/new/">
{% endblock %}

{# All stylesheets are loaded in extrahead to serve legacy IE basic styles #}
{% block extrahead %}
{{ css_bundle('protocol-core') }}
{{ css_bundle('exp-firefox-new') }}
{% endblock %}

{% block old_ie_styles %}{% endblock %}
{% block site_css %}{% endblock %}
{% block page_css %}{% endblock %}

{% block site_header %}{% endblock %}

{# Bug 1381776 #}
{% block update_notification %}{% endblock %}
43 changes: 43 additions & 0 deletions bedrock/exp/templates/exp/firefox/new/download.de.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{# 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 http://mozilla.org/MPL/2.0/. -#}

{% extends "exp/firefox/new/base.html" %}

{% block page_title_prefix %}Download Firefox — {% endblock %}

{% block page_title %}kostenloser Browser{% endblock %}

{# Bug 1438302 Avoid duplicate content for en-CA and en-GB pages. #}
{% block page_title_suffix %} — Mozilla{% endblock %}

{% block page_desc %}Download Mozilla Firefox, den kostenlosen Browser für Windows, Mac, Linux, Android und iOS. Firefox wird von Mozilla entwickelt – der Non-Profit-Organisation, die sich für deine Online-Rechte stark macht.{% endblock %}

{#- This will appear as <meta property="og:title"> which can be used for social share -#}
{% block page_og_title %}Jetzt den schnellsten Firefox aller Zeiten herunterladen{% endblock %}

{#- This will appear as <meta property="og:description"> which can be used for social share -#}
{% block page_og_desc %}Der neue Firefox: schnellere Seitenladezeiten, weniger Speicherverbrauch und vollgepackt mit neuen Funktionen.{% endblock %}

{% block content %}
<main role="main" class="main-download" {% if v %}data-variant="{{ v }}"{% endif %}>
{% call hero(
title='Hol dir den neuesten Firefox Browser.',
desc='Und damit eines der Firefox Produkte, für die deine Privatsphäre an erster Stelle steht.',
class='mzp-has-image mzp-t-dark',
include_cta=True,
image_url='firefox/new/trailhead/browser-window.svg',
heading_level=1
) %}
{{ download_firefox(alt_copy='Jetzt herunterladen', download_location='primary cta') }}
{% endcall %}

<section class="features">
<ul class="mzp-l-card-third mzp-l-content">
{{ picto_card(title='Komm zu Firefox', desc='Verbinde alle deine Firefox Produkte miteinander und bleib in Sachen Online-Sicherheit immer auf dem neuesten Stand.', class='join') }}
{{ picto_card(title='Passwörter immer dabei', desc='<strong>Firefox Lockwise</strong> hat deine gespeicherten Passwörter immer und auf allen deinen Geräten für dich parat.'|safe, class='lockwise') }}
{{ picto_card(title='Schütze deine Privatsphäre', desc='Im <strong>Privaten Modus</strong> wird dein Browserverlauf automatisch gelöscht, sodass andere Benutzer deines Computers ihn nicht sehen können.'|safe, class='private') }}
</ul>
</section>
</main>
{% endblock %}
51 changes: 51 additions & 0 deletions bedrock/exp/templates/exp/firefox/new/download.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{# 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 http://mozilla.org/MPL/2.0/. -#}

{% extends "exp/firefox/new/base.html" %}

{% block page_title_prefix %}Download Firefox — {% endblock %}

{% block page_title %}Free Web Browser{% endblock %}

{# Bug 1438302 Avoid duplicate content for en-CA and en-GB pages. #}
{%- block page_title_suffix -%}
{% if LANG == 'en-CA' %}
— Mozilla (CA)
{% elif LANG == 'en-GB' %}
— Mozilla (UK)
{% else %}
— Mozilla
{% endif %}
{%- endblock -%}

{% block page_desc %}Download Mozilla Firefox, a free web browser. Firefox is created by a global non-profit dedicated to putting individuals in control online. Get Firefox for Windows, macOS, Linux, Android and iOS today!{% endblock %}

{#- This will appear as <meta property="og:title"> which can be used for social share -#}
{% block page_og_title %}Download the fastest Firefox ever{% endblock %}

{#- This will appear as <meta property="og:description"> which can be used for social share -#}
{% block page_og_desc %}Faster page loading, less memory usage and packed with features, the new Firefox is here.{% endblock %}

{% block content %}
<main role="main" class="main-download" {% if v %}data-variant="{{ v }}"{% endif %}>
{% call hero(
title='Get the latest Firefox browser.',
desc='And start getting the respect you deserve with our family of privacy-first products.',
class='mzp-has-image mzp-t-dark',
include_cta=True,
image_url='firefox/new/trailhead/browser-window.svg',
heading_level=1
) %}
{{ download_firefox(alt_copy='Download Now', download_location='primary cta') }}
{% endcall %}

<section class="features">
<ul class="mzp-l-card-third mzp-l-content">
{{ picto_card(title='Join Firefox', desc='Connect to a whole family of respectful products, plus all the knowledge you need to protect yourself online.', class='join') }}
{{ picto_card(title='Passwords made portable', desc='<strong>Firefox Lockwise</strong> makes the passwords you save in Firefox available on all your devices.'|safe, class='lockwise') }}
{{ picto_card(title='Protect your privacy', desc='<strong>Private Browsing</strong> clears your history to keep it secret from anyone who uses your computer.'|safe, class='private') }}
</ul>
</section>
</main>
{% endblock %}
10 changes: 10 additions & 0 deletions bedrock/exp/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# 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 http://mozilla.org/MPL/2.0/.

from bedrock.mozorg.util import page


urlpatterns = (
page('firefox/new', 'exp/firefox/new/download.html', active_locales=['en-US', 'en-GB', 'en-CA', 'de']),
)
Empty file added bedrock/exp/views.py
Empty file.
12 changes: 12 additions & 0 deletions bedrock/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ def lazy_langs():
r'^about/legal/impressum/$',
r'^security/announce/',
r'^etc/',
r'^exp/',
]

# Pages we do want indexed but don't show up in automated URL discovery
Expand Down Expand Up @@ -466,6 +467,7 @@ def get_app_name(hostname):
'bedrock.sitemaps',
'bedrock.etc',
'bedrock.pocketfeed',
'bedrock.exp',
# last so that redirects here will be last
'bedrock.redirects',

Expand Down Expand Up @@ -1395,6 +1397,8 @@ def get_app_name(hostname):
'adservice.google.de',
'adservice.google.dk',
'creativecommons.org',
'cdn-3.convertexperiments.com',
'logs.convertexperiments.com',
]
CSP_SCRIPT_SRC = CSP_DEFAULT_SRC + [
# TODO fix things so that we don't need this
Expand All @@ -1407,10 +1411,15 @@ def get_app_name(hostname):
'tagmanager.google.com',
'www.youtube.com',
's.ytimg.com',
'cdn-3.convertexperiments.com',
'app.convert.com',
'1003350.track.convertexperiments.com',
'1003343.track.convertexperiments.com',
]
CSP_STYLE_SRC = CSP_DEFAULT_SRC + [
# TODO fix things so that we don't need this
"'unsafe-inline'",
'app.convert.com',
]
CSP_CHILD_SRC = [
'www.googletagmanager.com',
Expand Down Expand Up @@ -1459,3 +1468,6 @@ def get_app_name(hostname):
# FUNNELCAKE_103_LOCALES=de,fr,en-US
#
# where "103" in the variable name is the funnelcake ID.

# Issue 7508 - Convert.com experiment sandbox
CONVERT_PROJECT_ID = ('10039-1003350' if DEV else '10039-1003343')
1 change: 1 addition & 0 deletions bedrock/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
url(r'', include('bedrock.mozorg.urls')),
url(r'', include('bedrock.newsletter.urls')),
url(r'^etc/', include('bedrock.etc.urls')),
url(r'^exp/', include('bedrock.exp.urls')),

url(r'^healthz/$', watchman_views.ping, name="watchman.ping"),
url(r'^readiness/$', watchman_views.status, name="watchman.status"),
Expand Down
100 changes: 100 additions & 0 deletions media/css/exp/firefox/new/download.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
// 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 http://mozilla.org/MPL/2.0/.

$font-path: '/media/fonts';
$image-path: '/media/protocol/img';

@import '../../../../protocol/css/components/hero';
@import '../../../../protocol/css/components/modal';
@import '../../../../protocol/css/components/picto-card';
@import '../../../../protocol/css/includes/lib';
@import '../../../../protocol/css/templates/card-layout';


.mzp-c-hero.mzp-t-dark {
@include background-size(auto 100%);
background-color: $color-off-black;

.mzp-c-hero-title {
@include at2x('/media/img/logos/firefox/logo-quantum-wordmark-white.png', 147px, 48px);
background-position: top center;
background-repeat: no-repeat;
padding-top: $layout-xl;
}

.mzp-c-hero-image img {
top: 48px;
bottom: auto;
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, .5);
}

@media #{$mq-md} {
@include bidi((
(background-image, url('/media/img/exp/firefox/new/hero-bg.svg'), url('/media/img/exp/firefox/new/hero-bg-rtl.svg')),
(background-position, top right -600px, top left -600px),
));
background-repeat: no-repeat;

.mzp-c-hero-title {
@include bidi(((background-position, top left, top right),));
max-width: 9em;
}

.mzp-c-hero-desc {
max-width: 21em;
}
}

@media #{$mq-lg} {
@include bidi(((background-position, top right -480px, top left -480px),));
}

@media #{$mq-xl} {
@include bidi(((background-position, top right -260px, top left -260px),));
}
}


/**
* Picto card custom icon sizes.
* These should be standardized into a `large` icon size.
* https://github.com/mozilla/protocol/issues/382
*/
.mzp-c-card-picto .mzp-c-card-picto-content {
padding-top: 140px;

&:before {
background-color: transparent;
background-position: top left;
background-repeat: no-repeat;
}

@media #{$mq-lg} {
.mzp-c-card-picto-title {
@include text-display-sm;
margin-bottom: $spacing-xl;
}
}
}

.join .mzp-c-card-picto-content::before {
height: 104px;
width: 104px;
margin-left: -52px;
background-image: url('/media/img/exp/firefox/new/icon-join.svg');
}

.lockwise .mzp-c-card-picto-content::before {
height: 96px;
width: 152px;
margin-left: -76px;
background-image: url('/media/img/exp/firefox/new/icon-lockwise.svg');
}

.private .mzp-c-card-picto-content::before {
height: 83px;
width: 113px;
margin-left: -56px;
background-image: url('/media/img/exp/firefox/new/icon-private.svg');
}
1 change: 1 addition & 0 deletions media/img/exp/firefox/new/hero-bg-rtl.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions media/img/exp/firefox/new/hero-bg.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 9c51fc9

Please sign in to comment.