Skip to content

Commit

Permalink
[bug 1134414] Updates to FF37 whatsnew page
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgibson committed Mar 24, 2015
1 parent d505ec2 commit b0d80ea
Show file tree
Hide file tree
Showing 7 changed files with 373 additions and 108 deletions.
2 changes: 2 additions & 0 deletions bedrock/firefox/forms.py
Expand Up @@ -8,6 +8,8 @@

from lib.l10n_utils.dotlang import _

LANG_FILES = ['firefox/whatsnew-fx37']


class SMSSendForm(forms.Form):
number = forms.CharField(max_length=14)
Expand Down
121 changes: 73 additions & 48 deletions bedrock/firefox/templates/firefox/whatsnew-fx37.html
Expand Up @@ -6,7 +6,22 @@

{% 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 page_title_prefix %}{% endblock %}

{# L10n: This string is used in the <title> tag #}
{% block page_title %}{{ _('Now add Firefox to your Android devices') }}{% endblock %}
{% block page_title_suffix %}{% endblock %}
{% block body_id %}firefox-whatsnew-37{% endblock %}
Expand All @@ -24,72 +39,82 @@ <h2><a href="{{ url('firefox') }}">
{% endblock %}

{% macro thank_you_message() %}
{{_('Check your device to start downloading.') }} <a href="#send-another" class="more">{{ _('Send to another device') }}</a>
{# L10n: Thank you message after sending the SMS/email #}
{{_('Check your device to start downloading.') }}
<p><a role="button" href="#send-another" class="send-another more">
{# L10n: Thank you message after sending the SMS/email #}
{{ _('Send to another device') }}
</a></p>
{%- endmacro %}

{% block content %}
<main role="main" data-active="email">
<main role="main" data-active="email-only">
<header>
<p class="up-to-date">{{ _('Your Firefox is up to date!') }}</p>
<p class="up-to-date">{{ _('Your Firefox is up to date.') }}</p>
<h1>{{ _('Now add Firefox to your Android devices') }}</h1>
<p class="tagline">{{ _('Get the features you love and the privacy you trust in our most customizable Android browser yet. Simply send a download link straight to your phone or tablet — or both.') }}</p>
</header>
<nav class="toggle">
<ul>
<li class="sms-tab">
<a href="#send-sms">{{ _('Send by text message') }}</a>
<ul role="tablist">
<li role="presentation" class="sms-tab">
<a id="tab-sms" role="tab" aria-controls="send-sms" href="#send-sms">{{ _('Send by text message') }}</a>
</li>
<li class="email-tab">
<a href="#send-email">{{ _('Send by email') }}</a>
<li role="presentation" class="email-tab">
<a id="tab-email" role="tab" aria-controls="send-email" href="#send-email">{{ _('Send by email') }}</a>
</li>
</ul>
</nav>
<div class="tab-panel">
<section id="send-email" class="tab-content">
{% set newsletter_title = _('Send yourself a link by email') %}
{% set newsletter_submit = _('Send') %}
{% set newsletter_thankyou_head = _('Your link has been sent!') %}
{% set newsletter_thankyou_content = thank_you_message() %}
<div class="tab-container">
<div class="inner-wrapper">
<section id="send-email" class="tab-content">
{% set newsletter_id = 'download-firefox-android' %}
{% set newsletter_title = _('Send Firefox to your Android phone or tablet') %}
{% set newsletter_submit = _('Send') %}
{% set newsletter_thankyou_head = _('Your link has been sent!') %}
{% set newsletter_thankyou_content = thank_you_message() %}

{{ email_newsletter_form(title=newsletter_title, submit_text=newsletter_submit, thankyou_head=newsletter_thankyou_head,thankyou_content=newsletter_thankyou_content) }}
<footer>
{% trans url=settings.GOOGLE_PLAY_FIREFOX_LINK %}
Also available from <a href="{{ url }}">Google Play</a>.
{% endtrans %}
</footer>
</section>
<section id="send-sms" class="tab-content">
<div class="inner-wrapper">
<h3>{{ _('Send yourself a link by text message') }}</h3>
<form id="sms-form" method="post" action="{{ secure_url('firefox.sms') }}">
<div class="input">
<label for="number">{{ _('Enter your 10-digit phone number') }}</label>
<input type="tel"
maxlength="14"
id="number"
name="number"
placeholder="{{ _('Enter your 10-digit phone number') }}"
value=""
required>
<div class="error hidden"></div>
</div>
<button type="submit">{{ _('Send') }}</button>
</form>
<div class="sms-form-thank-you hidden">
<h3>{{ _('Your link has been sent!') }}</h3>
{{ thank_you_message() }}
</div>
{{ email_newsletter_form(newsletter_id, title=newsletter_title, submit_text=newsletter_submit, thankyou_head=newsletter_thankyou_head,thankyou_content=newsletter_thankyou_content) }}
<footer>
{% trans url=settings.GOOGLE_PLAY_FIREFOX_LINK %}
Also available from <a href="{{ url }}">Google Play</a>.
{% endtrans %}
<br>
{{ _('SMS & data rates may apply. The intended recipient of the SMS must have consented.') }}
<br>
<a href="#">{{ _('Learn more') }}</a>
<br>{{ _('The intended recipient of the email must have consented.') }} <a href="{{ url('privacy.notices.websites') }}#campaigns">{{ _('Learn more') }}</a>
</footer>
</div>
</section>
</section>
<section id="send-sms" class="tab-content">
<div class="inner-wrapper">
<div class="sms-form-wrapper">
<h3>{{ _('Send Firefox to your Android phone') }}</h3>
<form id="sms-form" method="post" action="{{ secure_url('firefox.sms') }}">
<div class="input">
<label for="number">{{ _('Enter your 10-digit phone number') }}</label>
<input type="tel"
maxlength="14"
id="number"
name="number"
placeholder="{{ _('Enter your 10-digit phone number') }}"
value=""
required>
<p class="error hidden">{{ _('An error occurred in our system. Please try again later.') }}</p>
</div>
<button type="submit">{{ _('Send') }}</button>
</form>
<div id="sms-form-thank-you">
<h3>{{ _('Your link has been sent!') }}</h3>
<p>{{ thank_you_message() }}</p>
</div>
<div id="sms-spinner" class="hidden"></div>
</div>
<footer>
{% trans url=settings.GOOGLE_PLAY_FIREFOX_LINK %}
Also available from <a href="{{ url }}">Google Play</a>.
{% endtrans %}
<br>
{{ _('SMS service available in the U.S. only.') }} {{ _('SMS & data rates may apply. The intended recipient of the SMS must have consented.') }} <a href="{{ url('privacy.notices.websites') }}#campaigns">{{ _('Learn more') }}</a>
</footer>
</div>
</section>
</div>
</div>
</main>
{% endblock %}
Expand Down
8 changes: 8 additions & 0 deletions bedrock/firefox/tests/test_base.py
Expand Up @@ -738,6 +738,14 @@ def test_fx_36_0_with_wrong_oldversion(self, render_mock):

# end 36.0 hello tour tests

@override_settings(DEV=True)
def test_fx_37_0_whatsnew(self, render_mock):
"""Should show Android SMS template for 37.0"""
req = self.rf.get('/en-US/firefox/whatsnew/?oldversion=36.0')
self.view(req, version='37.0')
template = render_mock.call_args[0][1]
eq_(template, ['firefox/whatsnew-fx37.html'])

# ESR31 whatsnew tests

@override_settings(DEV=True)
Expand Down

0 comments on commit b0d80ea

Please sign in to comment.