Skip to content

Commit

Permalink
Merge pull request #3168 from mozilla/bug-1150231-firstrun-fx40
Browse files Browse the repository at this point in the history
[fix bug 1150231] Fx40 firstrun experience.
  • Loading branch information
alexgibson committed Aug 4, 2015
2 parents 229ce07 + 331098e commit dbb88f9
Show file tree
Hide file tree
Showing 7 changed files with 536 additions and 0 deletions.
131 changes: 131 additions & 0 deletions bedrock/firefox/templates/firefox/australis/fx40/firstrun.html
@@ -0,0 +1,131 @@
{# 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/. #}

{% add_lang_files "firefox/whatsnew_38" %}

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

{% block extra_meta %}<meta name="robots" content="noindex">{% endblock %}

{#- This will appear as <meta property="og:title"> which can be used for social share -#}
{% block page_og_title %}
{{_('Choose the independent browser')}}
{% endblock %}

{#- This will appear as <meta property="og:description"> which can be used for social share -#}
{% block page_og_desc %}
{{_('Firefox is non-profit, non-corporate, non-compromised. Choosing Firefox isn’t just choosing a browser. It’s a vote for personal freedom.')}}
{% endblock %}

{#- Override <meta property="og:url"> for social share -#}
{% block page_og_url %}{{ url('firefox') }}{% endblock %}

{% block body_class %}mozID{% endblock %}

{% block site_css %}
{% stylesheet 'firefox_fx40_firstrun' %}
{% endblock %}

{% block optimizely %}
{% if waffle.switch('firefox-firstrun-optimizely') %}
{% include 'includes/optimizely.html' %}
{% endif %}
{% endblock %}

{% block site_header %}
<header id="masthead">
{% block tabzilla_tab %}
<div id="tabzilla">
<a href="{{ url('mozorg.home') }}">Mozilla</a>
</div>
{% endblock %}
{% block site_header_nav %}{% endblock %}
{% block site_header_logo %}{% endblock %}
{% block breadcrumbs %}{% endblock %}
</header>
{% endblock %}

{% block content %}
<section id="intro" data-fxa-iframe-src="{{ settings.FXA_IFRAME_SRC }}">
<div class="container">
<div id="logo">
{{ high_res_img('img/firefox/australis/fx38.0.5/firefox-logo.png', {'alt': 'Firefox', 'width': '142', 'height': '147'}) }}
</div>

<div class="leftcol">
<h1>
{{ _('Almost done!') }}
</h1>

<h2>
{# L10n: Line break below for visual formatting only. #}
{{ _('Sign in to Firefox and <br>you’re good to go.') }}
</h2>

<p>
{{ _('With your Firefox Account you can sync your bookmarks, passwords, open tabs and more, and access them everywhere you use Firefox.') }}
</p>
</div>

<div class="rightcol">
<iframe id="fxa" scrolling="no" src="{{ settings.FXA_IFRAME_SRC }}?campaign=fxa-embedded-form&amp;entrypoint=firstrun&amp;service=sync&amp;context=iframe&amp;style=chromeless"></iframe>
</div>
</div>
</section>

{% if video_url %}
<section id="video">
<div class="container">
<div class="leftcol">
<h2 id="video-title">{{ _('From our hands to yours') }}</h2>

<p>
{{ _('Firefox is built from the heart by thousands who believe in personal freedom on the Web.') }}
</p>

<div id="video-container">
<div id="video-frame">
<video tabindex="0" id="firstrun-video" controls="controls" poster="{{ static('img/firefox/spring-campaign-2015/video-poster.jpg') }}" width="100%" height="auto">
<source src="{{ video_url }}.webm" type="video/webm">
<source src="{{ video_url }}.mp4" type="video/mp4">
</video>
</div>
</div>
</div>{#-- /.leftcol --#}

<div class="rightcol">
<a id="cta-video" href="{{ video_url }}.webm"><span>{{ _('Watch the video') }}</span></a>
</div>{#-- /.rightcol --#}

</div>{#-- /.container --#}
</section>{#-- /#video --#}
{% endif %}

{% endblock %}

{% block email_form %}{% endblock %}

{% block site_footer %}
<footer id="footer">
<div class="container">
<a class="mozlogo" href="{{ url('mozorg.home') }}">Mozilla</a>

<ul>
<li>
<a href="{{ url('privacy') }}">{{ _('Privacy Policy') }}</a>
</li>
<li>
<a href="{{ url('privacy.notices.websites') }}#cookies">{{ _('Cookies') }}</a>
</li>
<li>
<a href="{{ url('legal.index') }}">{{ _('Legal Notices') }}</a>
</li>
</ul>
</div>
</footer>
{% endblock %}

{% block js %}
{% javascript 'firefox_fx40_firstrun' %}
{% endblock %}
18 changes: 18 additions & 0 deletions bedrock/firefox/tests/test_base.py
Expand Up @@ -634,6 +634,24 @@ def test_fx_firstrun_38_0_5(self, render_mock):
template = render_mock.call_args[0][1]
eq_(template, ['firefox/australis/fx38_0_5/firstrun.html'])

@override_settings(DEV=True)
@patch.object(waffle, 'switch_is_active', Mock(return_value=True))
def test_fx_firstrun_40_0(self, render_mock):
"""Should use fx40.0 firstrun template for 40.0"""
req = self.rf.get('/en-US/firefox/firstrun/')
self.view(req, version='40.0')
template = render_mock.call_args[0][1]
eq_(template, ['firefox/australis/fx40/firstrun.html'])

@override_settings(DEV=True)
@patch.object(waffle, 'switch_is_active', Mock(return_value=False))
def test_fx_firstrun_40_0_prelaunch(self, render_mock):
"""Should use fx38.0.5 firstrun template for 40.0 when switch is False"""
req = self.rf.get('/en-US/firefox/firstrun/')
self.view(req, version='40.0')
template = render_mock.call_args[0][1]
eq_(template, ['firefox/australis/fx38_0_5/firstrun.html'])

@override_settings(DEV=False)
def test_fx_australis_secure_redirect(self, render_mock):
"""Should redirect to https:"""
Expand Down
14 changes: 14 additions & 0 deletions bedrock/firefox/views.py
Expand Up @@ -389,6 +389,18 @@ def show_38_0_5_firstrun_or_whatsnew(version):
return version >= Version('38.0.5')


def show_40_firstrun(version):
if (waffle.switch_is_active('fx40-firstrun')):
try:
version = Version(version)
except ValueError:
return False

return version >= Version('40.0')
else:
return False


class LatestFxView(TemplateView):

"""
Expand Down Expand Up @@ -472,6 +484,8 @@ def get_template_names(self):
template = 'firefox/dev-firstrun-spring-campaign.html'
else:
template = 'firefox/dev-firstrun.html'
elif show_40_firstrun(version):
template = 'firefox/australis/fx40/firstrun.html'
elif show_38_0_5_firstrun_or_whatsnew(version):
template = 'firefox/australis/fx38_0_5/firstrun.html'
elif show_36_firstrun(version):
Expand Down
14 changes: 14 additions & 0 deletions bedrock/settings/base.py
Expand Up @@ -689,6 +689,20 @@ def facebook_tab_url_lazy():
# Optimize.ly project code
OPTIMIZELY_PROJECT_ID = None

# Fx Accounts iframe source
# Prod, stage, dev, & demos have this set in their local.py files.
#
# For local testing:
# - Point FXA_IFRAME_SRC to stomlinson's instance in your own local.py:
# FXA_IFRAME_SRC = 'https://stomlinson.dev.lcip.org/'
# - Run local server on 127.0.0.1:8111
# - Configure Fx40+ as detailed here:
# https://bugzilla.mozilla.org/show_bug.cgi?id=1150231#c4
#
# For demo server testing, configure Fx40+ as detailed here:
# https://bugzilla.mozilla.org/show_bug.cgi?id=1150231#c28
FXA_IFRAME_SRC = config('FXA_IFRAME_SRC', default='')

# Link to Firefox for Android on the Google Play store with Google Analytics
# campaign parameters
GOOGLE_PLAY_FIREFOX_LINK = ('https://play.google.com/store/apps/details?' +
Expand Down
18 changes: 18 additions & 0 deletions bedrock/settings/static_media.py
Expand Up @@ -348,6 +348,16 @@
),
'output_filename': 'css/firefox_fx38_0_5_firstrun-bundle.css',
},
'firefox_fx40_firstrun': {
'source_filenames': (
'css/sandstone/sandstone.less',
'css/tabzilla/tabzilla-static.less',
'css/sandstone/video-resp.less',
'css/base/mozilla-modal.less',
'css/firefox/australis/fx40/firstrun.less',
),
'output_filename': 'css/firefox_fx40_firstrun-bundle.css',
},
'firefox_developer_firstrun': {
'source_filenames': (
'css/base/mozilla-modal.less',
Expand Down Expand Up @@ -1114,6 +1124,14 @@
),
'output_filename': 'js/firefox_fx38_0_5_firstrun-bundle.js',
},
'firefox_fx40_firstrun': {
'source_filenames': (
'js/base/mozilla-video-tools.js',
'js/base/mozilla-modal.js',
'js/firefox/australis/fx40/firstrun.js',
),
'output_filename': 'js/firefox_fx40_firstrun-bundle.js',
},
'firefox_developer_firstrun': {
'source_filenames': (
'js/firefox/australis/australis-uitour.js',
Expand Down

0 comments on commit dbb88f9

Please sign in to comment.