Skip to content

Commit 8dfcbc4

Browse files
Add post-download thank you page. (Fixes #391) (#394)
* Update download_thunderbird() to replace a deprecated parameter with a button_class parameter + new hide footer links parameter * Rough pass at a Thank you, please install Thunderbird page. * Check for a get `downloaded=true` query parameter, and if it exists don't download Thunderbird.
1 parent 30ecebf commit 8dfcbc4

8 files changed

Lines changed: 112 additions & 26 deletions

File tree

assets/less/base/variables.less

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@
130130
h-5: 1.25rem;
131131
h-6: 1.5rem;
132132
h-8: 2rem;
133-
// h-10: 2.5rem;
134-
// h-12: 3rem;
135-
// h-16: 4rem;
133+
h-10: 2.5rem;
134+
h-12: 3rem;
135+
h-16: 4rem;
136136
// h-20: 5rem;
137137
// h-24: 6rem;
138138
// h-32: 8rem;
@@ -403,6 +403,7 @@
403403
font-lg: 17px;
404404
font-xl: 19px;
405405
font-2xl: 21px;
406+
font-3xl: 25px;
406407
font-4xl: 41px;
407408
font-hero: 59px;
408409
}

assets/less/components/buttons.less

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ button {
119119
.btn-newsletter {
120120
&:extend(.md\:w-40, .leading-none, .md\:leading-normal, .font-md, .rounded-sm, .border-none, .bg-primary-button, .text-white, .p-2, .pl-3, .pr-3, .uppercase, .font-bold, .appearance-none);
121121

122+
// Keeps button text one-line
123+
white-space: nowrap;
124+
122125
&:hover,
123126
&:focus {
124127
&:extend(.shadow-md);
@@ -130,6 +133,12 @@ button {
130133
}
131134
}
132135

136+
// No javascript tweak
137+
.no-js .btn-newsletter {
138+
line-height: 3rem;
139+
}
140+
141+
133142
.btn-join {
134143
&:extend(.text-white, .font-md, .font-semibold, .no-underline, .uppercase, .inline-block, .pt-3, .pb-3, .pl-6, .pr-6, .mb-5, .bg-primary-button, .rounded-xs, .shadow);
135144

@@ -173,6 +182,15 @@ button {
173182
}
174183
}
175184

185+
.btn-banner {
186+
&:extend(.bg-transparent, .text-black, .font-regular, .font-md, .font-semibold, .inline-block, .pt-3, .pb-3, .pl-4, .pr-4, .rounded-sm, .m-1);
187+
188+
&:hover,
189+
&:focus {
190+
&:extend(.no-underline);
191+
}
192+
}
193+
176194
// Product download buttons
177195
.download-button {
178196
.ios-download,
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// This Source Code Form is subject to the terms of the Mozilla Public
2+
// License, v. 2.0. If a copy of the MPL was not distributed with this
3+
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
4+
5+
/* Retry Banner: "(i) Your download didn't start automatically? [Try Again]" */
6+
7+
// Yes javascript tweaks
8+
.retry-download {
9+
.retry-text {
10+
margin-left: auto;
11+
margin-right: 0;
12+
}
13+
.retry-button {
14+
margin-right: 0;
15+
}
16+
}
17+
18+
// No javascript tweaks
19+
.no-js .retry-download {
20+
&:extend(.flex-col, .h-full);
21+
.retry-text {
22+
&:extend(.mt-4, .mx-auto);
23+
p {
24+
&:extend(.mr-6);
25+
}
26+
}
27+
.retry-button {
28+
&:extend(.mx-auto);
29+
}
30+
}
31+
32+
/* Download buttons for the retry banner */
33+
34+
// By default we want to hide all the downloads, and then javascript will show the correct build
35+
.download-hidden {
36+
&:extend(.hidden);
37+
}
38+
// We want to hide channel titles on javascript enabled browsers
39+
.js .channel-title {
40+
&:extend(.hidden);
41+
}
42+
// Show everything if we don't have javascript
43+
.no-js .download-hidden {
44+
display: block;
45+
}

assets/less/style.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
@import "components/links.less";
2727
@import "components/buttons.less";
2828
@import "components/donation-elements.less";
29+
@import "components/download.less";
2930
@import "components/faq.less";
3031
@import "components/forms.less";
3132
@import "components/headings.less";

helper.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,9 @@ def platform_img(ctx, url, optional_attributes=None):
213213
@jinja2.contextfunction
214214
def download_thunderbird(ctx, channel='release', dom_id=None,
215215
locale=None, force_direct=False,
216-
alt_copy=None, button_color='button-green',
217-
section='header', flex_class=None):
216+
alt_copy=None, button_class=None,
217+
section='header', flex_class=None,
218+
hide_footer_links=False):
218219
""" Output a "Download Thunderbird" button.
219220
220221
:param ctx: context from calling template.
@@ -223,8 +224,9 @@ def download_thunderbird(ctx, channel='release', dom_id=None,
223224
:param locale: The locale of the download. Default to locale of request.
224225
:param force_direct: Force the download URL to be direct.
225226
:param alt_copy: Specifies alternate copy to use for download buttons.
226-
:param button_color: color of download button. Default to 'green'.
227+
:param button_class: Class of the button element. Default to `none`, and dynamically picks the class based on the channel.
227228
:param section: Where the button is rendered in the page. Default to 'header'.
229+
:param hide_footer_links: Whether we should hide the footer links (System Requirements, What's New, Privacy Policy) display. Default to 'False'.
228230
:return: The button html.
229231
"""
230232
alt_channel = '' if channel == 'release' else channel
@@ -278,9 +280,10 @@ def download_thunderbird(ctx, channel='release', dom_id=None,
278280
'id': dom_id,
279281
'channel': alt_channel,
280282
'alt_copy': alt_copy,
281-
'button_color': button_color,
283+
'button_class': button_class,
282284
'section': section,
283-
'flex_class': flex_class
285+
'flex_class': flex_class,
286+
'hide_footer_links': hide_footer_links,
284287
}
285288
loader = jinja2.FileSystemLoader(searchpath=settings.WEBSITE_PATH)
286289
env = jinja2.Environment(loader=loader, extensions=['jinja2.ext.i18n'])

media/svg/circle-info.svg

Lines changed: 3 additions & 0 deletions
Loading

website/download/index.html

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,46 @@
77

88
{% block page_title_prefix %}{{_('Thunderbird')}} — {% endblock %}
99
{% block page_title %}{{ _('Download Thunderbird') }}{% endblock %}
10-
{% block page_desc %}{{ _('Your download should begin automatically. Didn’t work? Try the button below!') }}{% endblock %}
10+
{% block page_desc %}{{ _('Thank you for downloading and installing Thunderbird!') }}{% endblock %}
1111

1212
{% block body_id %}thunderbird-download{% endblock %}
1313

1414
{% block header_content %}
15-
<section class="text-center text-white flex flex-col items-center mb-12 pr-4 pl-4">
16-
<h1 class="font-4xl md:font-hero font-thin md:mt-10 mb-8">{{ self.page_title() }}</h1>
17-
<p class="font-lg md:font-xl tracking-wide leading-relaxed max-w-xl mb-8 md:mb-16">{{ self.page_desc() }}</p>
18-
<div class="tracking-wider">
15+
<section class="w-full">
16+
<div class="retry-download flex bg-white items-center text-black mx-auto max-w-xl shadow-lg h-12 rounded">
17+
<div class="retry-text flex items-center text-center">
18+
<span class="text-blue mr-2 ml-4">{{ svg('circle-info') }}</span>
19+
<p class="font-lg tracking-wide leading-none">{{ _('Your download didn\'t start automatically?') }}</p>
20+
</div>
21+
<div class="retry-button leading-none text-center mx-auto mb-4 font-md">
1922
<!-- Hide all the possible channels, so we can later show the one we want. -->
20-
<div id="esr" class="hidden">
21-
{{ download_thunderbird(force_direct=true, alt_copy=_('Free Download'), flex_class='justify-center') }}
23+
<div id="esr" class="download-hidden">
24+
<h4 class="channel-title">{{ _('Release Channel') }}</h4>
25+
{{ download_thunderbird(force_direct=true, alt_copy=_('Try again'), flex_class='justify-center', button_class='btn-newsletter no-underline', hide_footer_links=True) }}
2226
</div>
23-
<div id="beta" class="hidden">
24-
{{ download_thunderbird(force_direct=true, alt_copy=_('Free Download'), channel='beta', flex_class='justify-center') }}
27+
<div id="beta" class="download-hidden">
28+
<h4 class="channel-title">{{ _('Beta Channel') }}</h4>
29+
{{ download_thunderbird(force_direct=true, alt_copy=_('Try again'), channel='beta', flex_class='justify-center', button_class='btn-newsletter no-underline', hide_footer_links=True) }}
2530
</div>
26-
<div id="daily" class="hidden">
27-
{{ download_thunderbird(force_direct=true, alt_copy=_('Free Download'), channel='daily', flex_class='justify-center') }}
31+
<div id="daily" class="download-hidden">
32+
<h4 class="channel-title">{{ _('Daily Channel') }}</h4>
33+
{{ download_thunderbird(force_direct=true, alt_copy=_('Try again'), channel='daily', flex_class='justify-center', button_class='btn-newsletter no-underline', hide_footer_links=True) }}
2834
</div>
2935
</div>
30-
</section>
31-
<section class="hidden md:flex max-w-5xl self-center">
32-
{{ platform_img('thunderbird/landing/screenshot.png', {'alt': _('Thunderbird screenshot'), 'high-res': True, 'l10n': True, 'platforms': ('windows', 'linux', 'mac')}) }}
33-
</section>
36+
</div>
37+
</section>
38+
<div class="flex flex-col" style="min-height: 70vh">
39+
<section class="text-center text-white mx-auto my-auto">
40+
<p class="font-3xl tracking-wide max-w-4xl mb-6"><span class="mb-2 font-hero" style="display: block;">{{ _('Just one more step!') }}</span>{{ _('Finish installing, and start enjoying Thunderbird.') }}</p>
41+
<p class="tracking-wider">
42+
{{ _('Having trouble? <a class="inline-link" href="%(url)s">Get help with your installation.</a>')|format(url='https://support.mozilla.org/products/thunderbird/install-migrate-and-update') }}
43+
</p>
44+
</section>
45+
46+
</div>
3447
{% endblock %}
3548

3649
{% block content %}
37-
3850
<div itemscope itemtype="http://schema.org/SoftwareApplication">
3951
<meta itemprop="name" content="{{_('Thunderbird')}}">
4052
<meta itemprop="description" content="{% block product_desc %}{{ self.page_desc() }}{% endblock %}">

website/includes/download-button.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{# This Source Code Form is subject to the terms of the Mozilla Public
22
# License, v. 2.0. If a copy of the MPL was not distributed with this
33
# file, You can obtain one at http://mozilla.org/MPL/2.0/. -#}
4-
5-
{% set button_class = 'btn-'+channel if channel else 'btn-download' %}
4+
{% if not button_class %}
5+
{% set button_class = 'btn-'+channel if channel else 'btn-download' %}
6+
{% endif %}
67
{% if not flex_class %}
78
{% set flex_class = 'self-start' if channel or section == 'body' else 'justify-center' %}
89
{% endif %}
@@ -66,11 +67,13 @@ <h4>{{ _('Download Thunderbird') }} — {{ locale_name|safe }}</h4>
6667
</li>
6768
{% endfor %}
6869
</ul>
70+
{% if not hide_footer_links %}
6971
<p class="download-other download-other-desktop os_android os_ios os_linux os_linux64 os_osx os_win os_win64 os_winsha1 font-sm mt-0">
7072
{% if channel != 'daily' %}{# Daily doesn't have an all download page or release notes. #}
7173
<a href="{{ thunderbird_url('all', channel) }}" class="small-link {% if section == 'body' %} text-blue {% endif %}">{{ _('Systems &amp; Languages') }}</a> &bull;
7274
<a href="{{ thunderbird_url('releasenotes', channel) }}" class="small-link {% if section == 'body' %} text-blue {% endif %}">{{ _('What’s New') }}</a> &bull;
7375
{% endif %}
7476
<a href="{{ url('privacy.notices.thunderbird') }}" class="small-link {% if section == 'body' %} text-blue {% endif %}">{{ _('Privacy') }}</a>
7577
</p>
78+
{% endif %}
7679
</div>

0 commit comments

Comments
 (0)