diff --git a/bedrock/firefox/redirects.py b/bedrock/firefox/redirects.py index db3e657909f..cdd52e9b5bb 100644 --- a/bedrock/firefox/redirects.py +++ b/bedrock/firefox/redirects.py @@ -611,4 +611,7 @@ def firefox_channel(*args, **kwargs): # issue 7287 redirect(r'^accounts/?$', 'firefox.accounts'), + + # issue 7436 + redirect(r'^firefox/feedback/?$', 'https://support.mozilla.org/questions/new/desktop'), ) diff --git a/bedrock/firefox/templates/firefox/feedback/happy.html b/bedrock/firefox/templates/firefox/feedback/happy.html deleted file mode 100644 index b73d5c4fcd0..00000000000 --- a/bedrock/firefox/templates/firefox/feedback/happy.html +++ /dev/null @@ -1,81 +0,0 @@ -{# 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 "firefox/base-resp.html" %} - -{% set_lang_files "firefox/feedback" "firefox/sendto" %} - -{% block page_title_prefix %}{% endblock %} -{% block page_title %}{{_('Firefox Feedback')}}{% endblock %} -{% block page_desc %}{% endblock %} - -{% block body_id %}feedback{% endblock %} -{% block body_class %}sky happy{% endblock %} - -{% block page_css %} - {{ css_bundle('firefox_feedback') }} -{% endblock %} - -{% block js %} - {{ js_bundle('firefox_feedback') }} -{% endblock %} - -{% block site_header_nav %}{% endblock %} - -{% block content %} -
-
-

{{ _('Thank you for your feedback!') }}

-

{{ _('We’re so glad you’re happy with Firefox.') }}

- - {% if LANG == 'en-US' and donate_stars_url %} -

{{ _('Mozilla, the non-profit behind Firefox, relies on donations. Would you like to make a donation to help us carry out our mission to keep the Web open and free?') }}

- -

{{ _('Donate Now') }}

- {% else %} -

{{ _('Firefox is non-profit, non-corporate, non-compromised. Help protect the largest global public resource we have — the Web — by sharing Firefox with your friends.') }}

- {% endif %} - - {% set share_urls = { - 'twitter': 'http://mzl.la/1MZOYmZ', - 'googleplus': 'https://www.mozilla.org/firefox/new/?utm_source=google&utm_medium=social&utm_content=happyheartbeat&utm_campaign=desktop', - 'facebook': 'http://mzl.la/1zmGNa6' - } %} - {{ share_cta(_('Share Firefox'), share_urls, _('Proud to use Firefox, the only non-profit, non-corporate, non-compromised browser. Join me:'), 'feedback-share', '') }} - - - -
- -
- - - - - -
- -
-{% endblock %} - -{% block email_form %}{% endblock %} diff --git a/bedrock/firefox/templates/firefox/feedback/unhappy.html b/bedrock/firefox/templates/firefox/feedback/unhappy.html deleted file mode 100644 index ad809d8858b..00000000000 --- a/bedrock/firefox/templates/firefox/feedback/unhappy.html +++ /dev/null @@ -1,65 +0,0 @@ -{# 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 "firefox/base-resp.html" %} - -{% set_lang_files "firefox/feedback" %} - -{% block page_title_prefix %}{% endblock %} -{% block page_title %}{{ _('Firefox Feedback') }}{% endblock %} -{% block page_desc %}{% endblock %} - -{% block body_id %}feedback{% endblock %} -{% block body_class %}sky sad{% endblock %} - -{% block page_css %} - {{ css_bundle('firefox_feedback') }} -{% endblock %} - -{% block js %} - {{ js_bundle('firefox_feedback') }} -{% endblock %} - -{% block site_header_nav %}{% endblock %} - -{% block content %} -
-
-

{{ _('Having problems with Firefox?') }}

-

- {% trans link_sumo='https://support.mozilla.org/questions/new/desktop' %} - Let’s help fix them. If the articles below don’t solve the problem, please ask a question on our support forum to get help from our global community of Firefox users. - {% endtrans %} -

- - {% if LANG == 'en-US' and donate_stars_url %} -

{{ _('Mozilla, the non-profit behind Firefox, relies on donations. Would you like to make a donation to help us carry out our mission to keep the Web open and free?') }}

- -

{{ _('Donate Now') }}

- {% endif %} - - - -
- -
-

{{ _('How can we make Firefox better?') }}

-

{{ _('Share your suggestions and we’ll use them to improve Firefox.') }}

-

{{ _('Tell us more') }}

-
- -
-{% endblock %} - -{% block email_form %}{% endblock %} diff --git a/bedrock/firefox/tests/test_views.py b/bedrock/firefox/tests/test_views.py index 3b1ce85da0d..347a4a10028 100644 --- a/bedrock/firefox/tests/test_views.py +++ b/bedrock/firefox/tests/test_views.py @@ -958,45 +958,6 @@ def test_compare_edge_scene_1_non_us(self, render_mock): ) -class TestFeedbackView(TestCase): - def test_get_template_names_default_unhappy(self): - view = views.FeedbackView() - view.request = RequestFactory().get('/') - assert view.get_template_names() == ['firefox/feedback/unhappy.html'] - - def test_get_template_names_happy(self): - view = views.FeedbackView() - view.request = RequestFactory().get('/?score=5') - assert view.get_template_names() == ['firefox/feedback/happy.html'] - - def test_get_template_names_unhappy(self): - view = views.FeedbackView() - view.request = RequestFactory().get('/?score=1') - assert view.get_template_names() == ['firefox/feedback/unhappy.html'] - - def test_get_context_data_three_stars(self): - view = views.FeedbackView() - view.request = RequestFactory().get('/?score=3') - - ctx = view.get_context_data() - self.assertTrue(ctx['donate_stars_url'].endswith('Heartbeat_3stars')) - - def test_get_context_data_five_stars(self): - view = views.FeedbackView() - view.request = RequestFactory().get('/?score=5') - - ctx = view.get_context_data() - self.assertTrue(ctx['donate_stars_url'].endswith('Heartbeat_5stars')) - - def test_get_context_data_one_star(self): - """donate_stars_url should be undefined""" - view = views.FeedbackView() - view.request = RequestFactory().get('/?score=1') - - ctx = view.get_context_data() - self.assertFalse('donate_stars_url' in ctx) - - class TestFirefoxConcerts(TestCase): @override_settings(DEV=False) @override_settings(SWITCH_FIREFOX_CONCERT_SERIES=False) diff --git a/bedrock/firefox/urls.py b/bedrock/firefox/urls.py index 78237ee2172..b5680f1fc09 100644 --- a/bedrock/firefox/urls.py +++ b/bedrock/firefox/urls.py @@ -105,9 +105,6 @@ url('^firefox/releases/$', bedrock.releasenotes.views.releases_index, {'product': 'Firefox'}, name='firefox.releases.index'), - # Bug 1108828. Different templates for different URL params. - url('firefox/feedback/$', views.FeedbackView.as_view(), name='firefox.feedback'), - url('^firefox/stub_attribution_code/$', views.stub_attribution_code, name='firefox.stub_attribution_code'), diff --git a/bedrock/firefox/views.py b/bedrock/firefox/views.py index b38b6d8213b..ea7f07589da 100644 --- a/bedrock/firefox/views.py +++ b/bedrock/firefox/views.py @@ -643,36 +643,6 @@ def get_template_names(self): return [template] -class FeedbackView(TemplateView): - - donate_url = ( - 'https://donate.mozilla.org/' - '?utm_source=Heartbeat_survey&utm_medium=referral' - '&utm_content=Heartbeat_{0}stars' - ) - - def get_score(self): - return self.request.GET.get('score', '0') - - def get_template_names(self): - score = self.get_score() - if score > '3': - template = 'firefox/feedback/happy.html' - else: - template = 'firefox/feedback/unhappy.html' - - return [template] - - def get_context_data(self, **kwargs): - context = super(FeedbackView, self).get_context_data(**kwargs) - score = self.get_score() - - if score in ['3', '4', '5']: - context['donate_stars_url'] = self.donate_url.format(score) - - return context - - class TrackingProtectionTourView(l10n_utils.LangFilesMixin, TemplateView): def get_template_names(self): variation = self.request.GET.get('variation', None) diff --git a/media/css/firefox/feedback.less b/media/css/firefox/feedback.less deleted file mode 100644 index aba2805332d..00000000000 --- a/media/css/firefox/feedback.less +++ /dev/null @@ -1,269 +0,0 @@ -// 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/. - -@import "../sandstone/lib.less"; - -@font-face { - font-family: FA-Icons-Contact; - src: url('/media/fonts/icons-contact.woff2?20-12-2016') format('woff2'), - url('/media/fonts/icons-contact.woff?20-12-2016') format('woff'); - font-weight: normal; - font-style: normal; -} - -main { - padding: 0 @gridGutterWidth; -} - -.headline { - .font-size(48px); - text-align: center; -} - -.tagline { - .font-size(24px); - text-align: center; -} - -.mozilla-share-cta { - text-align: center; - margin: 0 auto; -} - -.primary { - .clearfix; - .span-all; - margin-bottom: @baseLine; - padding: @baseLine @gridGutterWidth; - background: #fff; - border-bottom: 1px solid @borderColor; - - .copy { - .font-size(@largeFontSize); - text-align: center; - margin: 0 auto 1.5em; - max-width: (@gridColumnWidth * 7) + (@gridGutterWidth * 6); - } -} - -.secondary { - .clearfix; -} - -.sad .secondary { - text-align: center; - - p { - margin: 0 auto 1.5em; - max-width: (@gridColumnWidth * 4) + (@gridGutterWidth * 3); - } -} - -.action-secondary { - .border-box; - .span(4); - padding: 120px @gridGutterWidth @baseLine; - text-align: center; - position: relative; - - h2 { - .font-size(20px); - - &:before { - content: ''; - display: block; - width: 100px; - height: 100px; - background-image: url('/media/img/firefox/feedback/cta-icons.png'); - background-repeat: no-repeat; - position: absolute; - top: 10px; - left: 50%; - margin-left: -50px; - - @media @highdpi { - background-image: url('/media/img/firefox/feedback/cta-icons-high-res.png'); - .background-size(100px 300px); - } - } - } - - a:hover, - a:focus { - text-decoration: none; - - p { - text-decoration: underline; - } - } -} - -.cta-sync h2:before { - background-position: center top; -} - -.cta-android h2:before { - background-position: center -100px; -} - -.cta-addons h2:before { - background-position: center -200px; -} - -.support-links { - .clearfix; - list-style: none; - margin: 0 @gridColumnWidth/2; - - li { - .span(3.5); - margin-bottom: @baseLine; - min-height: 6em; - } - - a { - .trailing-arrow; - display: block; - position: relative; - padding: 10px @gridGutterWidth 10px 45px; - font-weight: bold; - border: 2px solid; - border-radius: .5em; - min-height: 4em; - - &:before { - font-family: FA-Icons-Contact; - content: '\e810'; - .font-size(22px); - font-weight: normal; - position: absolute; - left: 15px; - top: 6px; - color: lighten(@linkSkyBlue, 15%); - } - - &:hover:before, - &:focus:before { - color: darken(@linkSkyBlue, 10%); - } - } - - .ask a:before { - content: '\e811'; - left: 13px; - top: 4px; - } -} - -.social-links { - list-style: none; - margin: (@baseLine * 1.5) auto 0; - text-align: center; - max-width: (@gridColumnWidth * 8) + (@gridGutterWidth * 7); - - li { - display: inline; - margin: 0 10px; - } - - a { - padding-left: @gridGutterWidth; - - &:before { - font-family: FA-Icons-Contact; - margin-right: 8px; - } - } - - .facebook:before { - content: '\e802'; - } - - .twitter:before { - content: '\e809'; - } - - .email:before { - content: '\e806'; - } -} - - -/*-------------------------------------------------------------------------*/ -// @Tablet Layout: 760px -@media only screen and (min-width: @breakTablet) and (max-width: @breakDesktop) { - - .action-secondary { - .span_narrow(4); - } - - .support-links li { - .span_narrow(5); - margin-bottom: @baseLine; - } - - .support-links li.ask { - .span_narrow(10); - margin-bottom: @baseLine; - } - -} - - - -/*-------------------------------------------------------------------------*/ -// @Mobile Layout: 320px -@media only screen and (max-width: @breakTablet) { - - .headline { - .font-size(32px); - } - - .tagline { - .font-size(20px); - } - - .action-secondary { - .span-all(); - } - - .social-links { - max-width: none; - text-align: left; - - li { - display: block; - margin: 0 0 .5em; - } - } - - .mozilla-share-cta { - width: 210px; - - h3 { - width: 170px; - } - } - - .support-links { - margin: 0 auto; - - li { - .span-all(); - margin-bottom: @baseLine; - } - } - -} - - -/*-------------------------------------------------------------------------*/ -// @Wide mobile Layout: 480px -@media only screen and (min-width: @breakMobileLandscape) and (max-width: @breakTablet) { - - .social-links { - margin: (@baseLine * 1.5) 40px 0; - } - -} diff --git a/media/img/firefox/feedback/cta-icons-high-res.png b/media/img/firefox/feedback/cta-icons-high-res.png deleted file mode 100644 index 864566a0e4f..00000000000 Binary files a/media/img/firefox/feedback/cta-icons-high-res.png and /dev/null differ diff --git a/media/img/firefox/feedback/cta-icons.png b/media/img/firefox/feedback/cta-icons.png deleted file mode 100644 index 9775f72e453..00000000000 Binary files a/media/img/firefox/feedback/cta-icons.png and /dev/null differ diff --git a/media/static-bundles.json b/media/static-bundles.json index 1406a7d283f..94cb5022cfc 100644 --- a/media/static-bundles.json +++ b/media/static-bundles.json @@ -142,13 +142,6 @@ ], "name": "annual_2012" }, - { - "files": [ - "css/base/mozilla-share-cta.less", - "css/firefox/feedback.less" - ], - "name": "firefox_feedback" - }, { "files": [ "css/press/press.less" @@ -1349,12 +1342,6 @@ ], "name": "about-leadership" }, - { - "files": [ - "js/base/mozilla-share-cta.js" - ], - "name": "firefox_feedback" - }, { "files": [ "js/base/mozilla-modal.js", diff --git a/tests/redirects/map_globalconf.py b/tests/redirects/map_globalconf.py index 5e2e1aad7cd..517de161bbf 100644 --- a/tests/redirects/map_globalconf.py +++ b/tests/redirects/map_globalconf.py @@ -1271,4 +1271,7 @@ # Issue 7435 url_test('/about/history/details/', '/about/history/'), + + # Issue 7436 + url_test('/firefox/feedback/', 'https://support.mozilla.org/questions/new/desktop'), ))