forked from mozilla/bedrock
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Firefox privacy notice and legal terms for ToS (Fixes mozilla#15872)
- Loading branch information
1 parent
f13a56d
commit bb6dd6c
Showing
14 changed files
with
411 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{# | ||
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 https://mozilla.org/MPL/2.0/. | ||
#} | ||
|
||
{% extends "legal/docs-base.html" %} | ||
|
||
{% block page_title %}{{ ftl('legal-firefox-rights') }}{% endblock %} | ||
|
||
{% block site_css %} | ||
{% if switch('m24-website-refresh') %} | ||
{{ css_bundle('m24-root') }} | ||
{% endif %} | ||
{{ css_bundle('protocol-firefox') }} | ||
{% endblock %} | ||
|
||
{% block page_css %} | ||
{{ css_bundle('legal-terms-firefox-tos') }} | ||
{% endblock %} | ||
|
||
{% block site_header %}{% endblock %} | ||
|
||
{% block side_nav %}{% endblock %} | ||
|
||
{# disable GA on Fx Privacy Notice. Bug 1576673 #} | ||
{% block google_analytics %}{% endblock %} | ||
{% block glean %}{% endblock %} | ||
|
||
{# Exclude stub attribution for in-product pages: issus 9620 #} | ||
{% block stub_attribution %}{% endblock %} | ||
|
||
{% block site_footer %}{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# 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 https://mozilla.org/MPL/2.0/. | ||
|
||
from unittest.mock import patch | ||
|
||
from django.http import HttpResponse | ||
from django.test.client import RequestFactory | ||
|
||
from bedrock.legal import views | ||
from bedrock.legal_docs import views as legal_docs_views | ||
from bedrock.mozorg.tests import TestCase | ||
|
||
|
||
@patch("bedrock.firefox.views.l10n_utils.render", return_value=HttpResponse()) | ||
@patch.object(legal_docs_views, "load_legal_doc") | ||
class TestFirefoxTermsOfServiceDocView(TestCase): | ||
def test_default_template(self, render_mock, lld_mock): | ||
req = RequestFactory().get("/about/legal/terms/firefox/") | ||
req.locale = "en-US" | ||
view = views.FirefoxTermsOfServiceDocView.as_view() | ||
view(req) | ||
template = lld_mock.call_args[0][1] | ||
assert template == "legal/terms/firefox.html" | ||
|
||
def test_tos_template(self, render_mock, lld_mock): | ||
req = RequestFactory().get("/about/legal/terms/firefox/?v=product") | ||
req.locale = "en-US" | ||
view = views.FirefoxTermsOfServiceDocView.as_view() | ||
view(req) | ||
template = lld_mock.call_args[0][1] | ||
assert template == "legal/terms/firefox-tos.html" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,13 +10,25 @@ | |
|
||
from bedrock.base.urlresolvers import reverse | ||
from bedrock.legal.forms import FraudReportForm | ||
from bedrock.legal_docs.views import LegalDocView | ||
from lib import l10n_utils | ||
|
||
FRAUD_REPORT_EMAIL_FROM = settings.DEFAULT_FROM_EMAIL | ||
FRAUD_REPORT_EMAIL_SUBJECT = "New trademark infringement report: %s; %s" | ||
FRAUD_REPORT_EMAIL_TO = ["[email protected]"] | ||
|
||
|
||
class FirefoxTermsOfServiceDocView(LegalDocView): | ||
def get_template_names(self): | ||
variant = self.request.GET.get("v", None) | ||
template_name = "legal/terms/firefox.html" | ||
|
||
if variant == "product": | ||
template_name = "legal/terms/firefox-tos.html" | ||
|
||
return [template_name] | ||
|
||
|
||
def submit_form(request, form): | ||
form_submitted = True | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
bedrock/privacy/templates/privacy/notices/firefox-old-style-notice.html
This file was deleted.
Oops, something went wrong.
40 changes: 40 additions & 0 deletions
40
bedrock/privacy/templates/privacy/notices/firefox-tos.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{# | ||
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 https://mozilla.org/MPL/2.0/. | ||
#} | ||
|
||
{% extends "privacy/notices/base-notice-headings.html" %} | ||
|
||
{% block site_css %} | ||
{% if switch('m24-website-refresh') %} | ||
{{ css_bundle('m24-root') }} | ||
{% endif %} | ||
{{ css_bundle('protocol-firefox') }} | ||
{% endblock %} | ||
|
||
{% block page_css %} | ||
{{ css_bundle('privacy_firefox_tos') }} | ||
{% endblock %} | ||
|
||
{% set body_id = "privacy_tos" %} | ||
|
||
{% block site_header %}{% endblock %} | ||
|
||
{% block sidemenu %}{% endblock %} | ||
|
||
{% block article_header_logo %}{% endblock %} | ||
|
||
{% block js %} | ||
{{ super() }} | ||
{{ js_bundle('privacy_firefox') }} | ||
{% endblock %} | ||
|
||
{# disable GA on Fx Privacy Notice. Bug 1576673 #} | ||
{% block google_analytics %}{% endblock %} | ||
{% block glean %}{% endblock %} | ||
|
||
{# Exclude stub attribution for in-product pages: issus 9620 #} | ||
{% block stub_attribution %}{% endblock %} | ||
|
||
{% block site_footer %}{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# 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 https://mozilla.org/MPL/2.0/. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# 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 https://mozilla.org/MPL/2.0/. | ||
|
||
from unittest.mock import patch | ||
|
||
from django.http import HttpResponse | ||
from django.test.client import RequestFactory | ||
|
||
from bedrock.mozorg.tests import TestCase | ||
from bedrock.privacy import views | ||
|
||
|
||
@patch("bedrock.firefox.views.l10n_utils.render", return_value=HttpResponse()) | ||
@patch.object(views.PrivacyDocView, "get_legal_doc") | ||
class TestFirefoxTermsOfServiceDocView(TestCase): | ||
def test_default_template(self, render_mock, lld_mock): | ||
req = RequestFactory().get("/privacy/notices/firefox/") | ||
req.locale = "en-US" | ||
view = views.firefox_notices | ||
view(req) | ||
template = lld_mock.call_args[0][1] | ||
assert template == "privacy/notices/firefox.html" | ||
|
||
def test_tos_template(self, render_mock, lld_mock): | ||
req = RequestFactory().get("/privacy/notices/firefox/?v=product") | ||
req.locale = "en-US" | ||
view = views.firefox_notices | ||
view(req) | ||
template = lld_mock.call_args[0][1] | ||
assert template == "privacy/notices/firefox-tos.html" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// 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 https://mozilla.org/MPL/2.0/. | ||
|
||
@use '~@mozilla-protocol/core/protocol/css/includes/lib' as *; | ||
|
||
// narrow top / bottom padding for modal display | ||
#outer-wrapper > .mzp-l-content { | ||
padding-bottom: $spacing-xl; | ||
padding-top: $spacing-xl; | ||
} | ||
|
||
// narrow max-width for readability | ||
@media #{$mq-lg} { | ||
.mzp-l-main { | ||
max-width: 640px; | ||
margin: 0 auto; | ||
} | ||
} | ||
|
||
// manual styling for markdown content. | ||
.article-body { | ||
h1 { | ||
@include text-title-sm; | ||
} | ||
|
||
h2, | ||
h3, | ||
h4 { | ||
@include text-title-xs; | ||
} | ||
|
||
blockquote { | ||
@include text-body-lg; | ||
} | ||
|
||
ul { | ||
list-style: disc; | ||
} | ||
|
||
ol { | ||
list-style: decimal; | ||
} | ||
|
||
li { | ||
margin: $spacing-sm $spacing-lg; | ||
} | ||
} |
Oops, something went wrong.