Skip to content

Commit bc20db6

Browse files
committed
Add share widget to Hello product page. Bug 1119849.
- Fix small attribute spacing issue in share macro.
1 parent 02e9ea4 commit bc20db6

File tree

4 files changed

+89
-56
lines changed

4 files changed

+89
-56
lines changed

bedrock/base/templates/macros.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ <h3>{{ _('Get Mozilla updates') }}</h3>
358358
{%- endmacro %}
359359

360360
{% macro share_cta(cta_text, share_urls, share_text, id) %}
361-
<div class="mozilla-share-cta" tabindex="0"{% if id -%} id="{{ id }}"{% endif -%}>
361+
<div class="mozilla-share-cta" tabindex="0"{% if id %} id="{{ id }}"{% endif -%}>
362362
<h3>{{ cta_text }}</h3>
363363
<ul>
364364
<li><a class="twitter" href="{{ 'https://www.twitter.com/intent/tweet?url=%s&amp;text=%s'|format(share_urls.get('twitter')|urlencode, share_text|urlencode)|e }}" title="Twitter">Twitter</a></li>

bedrock/firefox/templates/firefox/hello/index.html

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
{% set_lang_files "firefox/hello" %}
88

9+
{% from "macros.html" import share_cta with context %}
10+
911
{% block page_title_prefix %}{% endblock %}
1012
{% block page_title %}{{ _('Firefox Hello — Free, easy video conversations') }}{% endblock %}
1113
{% block page_desc %}{{ _('Learn all about Firefox Hello and see for yourself how easy it is to have a free video conversation with anyone, anywhere, right from your browser') }}{% endblock %}
@@ -25,14 +27,27 @@
2527
{% block site_header %}
2628
<header id="masthead">
2729
<div class="container">
28-
<a href="{{ url('mozorg.home') }}" id="tabzilla" data-infobar="{{ settings.TABZILLA_INFOBAR_OPTIONS }}">Mozilla</a>
30+
<div id="hello-header-nav">
31+
<a href="{{ url('mozorg.home') }}" id="tabzilla" data-infobar="{{ settings.TABZILLA_INFOBAR_OPTIONS }}">Mozilla</a>
2932

30-
{% block site_header_nav %}
31-
{% include 'firefox/includes/top-menu.html' %}
32-
{% endblock %}
33+
{% block site_header_nav %}
34+
{% include 'firefox/includes/top-menu.html' %}
35+
{% endblock %}
36+
</div>
3337

3438
{% block site_header_logo %}
35-
{{ super() }}
39+
<div id="hello-logo-wrapper">
40+
{{ super() }}
41+
42+
{%
43+
set share_urls = {
44+
'twitter': 'http://mzl.la/1wz83AN',
45+
'googleplus': 'https://www.mozilla.org/firefox/hello/?utm_source=Google&utm_medium=social&utm_campaign=Hello&utm_content=WebsiteShare',
46+
'facebook': 'https://www.mozilla.org/firefox/hello/?utm_source=Facebook&utm_medium=social&utm_campaign=Hello&utm_content=WebsiteShare'
47+
}
48+
%}
49+
{{ share_cta(_('Share'), share_urls, _('Meet Firefox Hello, the easiest way to connect for free over video with anyone, anywhere.'), 'spread-hello') }}
50+
</div>
3651
{% endblock %}
3752
</div>
3853
</header>
@@ -122,15 +137,6 @@ <h2 class="heading-tertiary">
122137
<aside id="powered-by">
123138
{{ _('Powered by %s')|format(high_res_img('/img/firefox/hello/tef-logo.png', {'alt': 'Telefonica', 'width': '106', 'height': '29'})) }}
124139
</aside>
125-
126-
{#
127-
Share widget pulled from 35, will be back for 36:
128-
https://bugzilla.mozilla.org/show_bug.cgi?id=1113917#c4
129-
130-
<div id="share-wrapper">
131-
{% include 'firefox/includes/social-share.html' %}
132-
</div>
133-
#}
134140
</div>{# /.container #}
135141
</section>
136142

bedrock/settings/base.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ def JINJA_CONFIG():
319319
'css/firefox/menu-resp.less',
320320
'css/base/mozilla-modal.less',
321321
'css/base/svg-animation-check.less',
322+
'css/base/mozilla-share-cta.less',
322323
'css/firefox/hello/index.less',
323324
),
324325
'firefox_new': (
@@ -830,6 +831,7 @@ def JINJA_CONFIG():
830831
'js/firefox/australis/australis-uitour.js',
831832
'js/base/mozilla-modal.js',
832833
'js/base/svg-animation-check.js',
834+
'js/base/mozilla-share-cta.js',
833835
'js/firefox/hello/index.js',
834836
),
835837
'firefox_hello_ie9': (

media/css/firefox/hello/index.less

Lines changed: 66 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44

55
@import "../../sandstone/lib.less";
66

7+
@font-face {
8+
font-family: 'Font Awesome';
9+
src: url('/media/fonts/fontawesome-webfont.eot?v4.01#iefix') format('embedded-opentype'),
10+
url('/media/fonts/fontawesome-webfont.woff?v4.01') format('woff'),
11+
url('/media/fonts/fontawesome-webfont.ttf?v4.01') format('truetype');
12+
font-weight: normal;
13+
font-style: normal;
14+
}
15+
716
.grainy-sky() {
817
background: #cae1f4;
918
background: url(/media/img/sandstone/grain.png) repeat,
@@ -39,11 +48,16 @@
3948
}
4049

4150
h2 {
42-
padding-top: 48px;
51+
float: left;
52+
padding-top: 0;
4353
width: 185px;
4454
}
4555
}
4656

57+
html[dir="rtl"] #masthead h2 {
58+
float: right;
59+
}
60+
4761
// Common styles
4862

4963
main {
@@ -100,60 +114,59 @@ main {
100114
}
101115
}
102116

103-
/*
104-
Share widget pulled from 35, but will be back for 36:
105-
https://bugzilla.mozilla.org/show_bug.cgi?id=1113917#c4
106-
107117
// Share
108118

109-
#share-wrapper {
110-
margin: 30px auto 0;
111-
width: 200px;
112-
text-align: center;
119+
#hello-header-nav,
120+
#hello-logo-wrapper {
121+
.clearfix();
122+
}
113123

114-
.socialshare {
115-
& > div > a {
116-
background-image: url(/media/img/firefox/hello/sprite-share.png);
117-
color: #2983c8;
124+
#spread-hello {
125+
display: none;
126+
float: right;
127+
margin-top: 15px;
128+
}
118129

119-
span {
120-
border-color: #2983c8;
121-
}
130+
.js #spread-hello {
131+
display: block;
132+
}
122133

123-
&:hover,
124-
&:focus {
125-
background-position: 0 8px;
126-
color: #2983c8;
134+
html[dir="rtl"] #spread-hello {
135+
float: left;
136+
}
127137

128-
span {
129-
border-color: #2983c8;
130-
}
131-
}
138+
.mozilla-share-cta {
139+
border: 0;
140+
background: transparent;
141+
width: 140px;
132142

133-
&:after {
134-
background-image: url(/media/img/firefox/hello/sprite-share.png);
135-
background-position: 4px -19px;
136-
}
137-
}
143+
&:hover,
144+
&:focus {
145+
background: transparent;
146+
}
138147

139-
&.open > div > a{
140-
background-position: 0 8px;
148+
h3 {
149+
.font-size(@smallFontSize);
150+
padding-left: @baseLine / 2;
151+
padding-right: @baseLine / 2;
152+
width: 120px;
153+
color: @linkBlue;
154+
}
141155

142-
&:after {
143-
background-position: 5px -17px;
144-
}
145-
}
156+
ul li a {
157+
color: @linkBlue;
146158

147-
#share-options {
148-
width: 85px;
159+
&:before {
160+
.font-size(18px);
161+
line-height: 43px;
162+
}
149163

150-
ul {
151-
text-align: left;
152-
}
164+
&:hover,
165+
&:focus {
166+
color: @linkBlue;
153167
}
154168
}
155169
}
156-
*/
157170

158171
// Intro
159172

@@ -1486,6 +1499,12 @@ html[lang^="en"] #powered-by {
14861499
.font-size(20px);
14871500
}
14881501

1502+
// Share
1503+
1504+
#spread-hello {
1505+
margin-top: 25px;
1506+
}
1507+
14891508
// Intro
14901509

14911510
#intro {
@@ -1903,6 +1922,12 @@ html[lang^="en"] #powered-by {
19031922
.font-size(20px);
19041923
}
19051924

1925+
// Share
1926+
1927+
.js #spread-hello {
1928+
display: none;
1929+
}
1930+
19061931
// Intro
19071932

19081933
#intro-image {

0 commit comments

Comments
 (0)