Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions frontend/js/src/PrivacySummary.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React, { JSX } from "react";
import { useTranslation } from "react-i18next";
import PrivacySummaryContent from "./forms/PrivacySummaryContent";
import { getPageProps, renderRoot } from "./utils";

function PrivacySummary(): JSX.Element {
const { t } = useTranslation();

return (
<div className="well well-lg" style={{ maxWidth: "800px", margin: "0 auto" }}>
<h2 className="page-title">{t("Privacy Policy")}</h2>
<hr/>
<PrivacySummaryContent />
</div>
);
}

document.addEventListener("DOMContentLoaded", () => {
const { domContainer } = getPageProps();

renderRoot(domContainer, <PrivacySummary />);
});
68 changes: 3 additions & 65 deletions frontend/js/src/forms/ConditionsModal.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import { Trans, useTranslation } from "react-i18next";
import { ProjectIconPills } from "./utils";
import { useTranslation } from "react-i18next";
import PrivacySummaryContent from "./PrivacySummaryContent";

export default function ConditionsModal() {
const { t } = useTranslation();
Expand All @@ -20,69 +20,7 @@ export default function ConditionsModal() {
</button>
<h4 className="modal-title">{t("Privacy Policy")}</h4>
</div>
<h5>{t("Licensing")}</h5>
<p>
{t(
"Any contributions you make to any MetaBrainz service will be released into the Public Domain and/or licensed under a Creative Commons by-nc-sa license. Furthermore, you give the MetaBrainz Foundation the right to license this data for commercial use."
)}
<br />
<Trans
defaults={t(
"Please read our <licenseLink>license page</licenseLink> for more details."
)}
components={{licenseLink: (
// eslint-disable-next-line jsx-a11y/anchor-has-content
<a
target="_blank"
rel="noopener noreferrer"
href="/social-contract"
/>
)}}
/>
</p>
<h5>{t("Privacy")}</h5>
<p>
{t(
"MetaBrainz strongly believes in the privacy of its users. Any personal information you choose to provide will not be sold or shared with anyone else."
)}
<br />
<Trans
defaults={t(
"Please read our <privacyLink>privacy policy</privacyLink> for more details."
)}
components={{privacyLink: (
// eslint-disable-next-line jsx-a11y/anchor-has-content
<a target="_blank" rel="noopener noreferrer" href="/privacy" />
)}}
/>
</p>
<h5>{t("GDPR compliance")}</h5>
<p>
{t(
"You may remove your personal information from our services anytime by deleting your account."
)}
<br />
<Trans
defaults={t(
"Please read our <gdprLink>GDPR compliance statement</gdprLink> for more details."
)}
components={{gdprLink: (
// eslint-disable-next-line jsx-a11y/anchor-has-content
<a target="_blank" rel="noopener noreferrer" href="/gdpr" />
)}}
/>
</p>
<hr />
<ProjectIconPills />
<p>
{t(
"Creating an account on MetaBrainz will give you access to all of our projects, such as MusicBrainz, ListenBrainz, BookBrainz, and more."
)}
<br />
{t(
"We create a placeholder account for all the MetaBrainz projects when you sign up, and you are one log-in away from activating them."
)}
</p>
<PrivacySummaryContent />
<button
className="btn btn-primary center-block"
type="button"
Expand Down
81 changes: 81 additions & 0 deletions frontend/js/src/forms/PrivacySummaryContent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import React, { JSX } from "react";
import { Trans, useTranslation } from "react-i18next";
import { ProjectIconPills } from "./utils";

export default function PrivacySummaryContent(): JSX.Element {
const { t } = useTranslation();

return (
<>
<h5><b>{t("Licensing")}</b></h5>
<p>
{t(
"Any contributions you make to any MetaBrainz service will be released into the Public Domain and/or licensed under a Creative Commons by-nc-sa license. Furthermore, you give the MetaBrainz Foundation the right to license this data for commercial use."
)}
<br />
<Trans
defaults={t(
"Please read our <licenseLink>license page</licenseLink> for more details."
)}
components={{
licenseLink: (
// eslint-disable-next-line jsx-a11y/anchor-has-content
<a
target="_blank"
rel="noopener noreferrer"
href="/social-contract"
/>
),
}}
/>
</p>
<h5><b>{t("Privacy")}</b></h5>
<p>
{t(
"MetaBrainz strongly believes in the privacy of its users. Any personal information you choose to provide will not be sold or shared with anyone else."
)}
<br />
<Trans
defaults={t(
"Please read our <privacyLink>privacy policy</privacyLink> for more details."
)}
components={{
privacyLink: (
// eslint-disable-next-line jsx-a11y/anchor-has-content
<a target="_blank" rel="noopener noreferrer" href="/privacy" />
),
}}
/>
</p>
<h5><b>{t("GDPR compliance")}</b></h5>
<p>
{t(
"You may remove your personal information from our services anytime by deleting your account."
)}
<br />
<Trans
defaults={t(
"Please read our <gdprLink>GDPR compliance statement</gdprLink> for more details."
)}
components={{
gdprLink: (
// eslint-disable-next-line jsx-a11y/anchor-has-content
<a target="_blank" rel="noopener noreferrer" href="/gdpr" />
),
}}
/>
</p>
<hr />
<ProjectIconPills />
<p>
{t(
"Creating an account on MetaBrainz will give you access to all of our projects, such as MusicBrainz, ListenBrainz, BookBrainz, and more."
)}
<br />
{t(
"We create a placeholder account for all the MetaBrainz projects when you sign up, and you are one log-in away from activating them."
)}
</p>
</>
);
}
8 changes: 8 additions & 0 deletions metabrainz/templates/users/privacy-summary.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% extends 'base-react.html' %}

{% block title %}{{ _('Privacy Policy') }} - MetaBrainz Foundation{% endblock %}

{% block scripts %}
{{ super() }}
<script src="{{ get_static_path('privacySummary.js') }}" type="text/javascript"></script>
{% endblock %}
5 changes: 5 additions & 0 deletions metabrainz/user/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
users_bp = Blueprint("users", __name__)


@users_bp.route("/privacy-summary")
def privacy_summary():
return render_template("users/privacy-summary.html", props=json.dumps({}))


@users_bp.route("/signup", methods=["GET", "POST"])
@login_forbidden
def signup():
Expand Down
4 changes: 4 additions & 0 deletions metabrainz/user/views_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ def test_user_signup_regular_flow_is_not_registration_request_signup(self):
self.assertFalse(props["is_registration_request_signup"])
self.assertIsNone(props["registration_request_client_name"])

def test_privacy_summary(self):
response = self.client.get(url_for("users.privacy_summary"))
self.assert200(response)

def test_user_signup_missing_csrf_token(self):
self._test_user_signup_missing_fields_helper({
"username": "test_user_1",
Expand Down
1 change: 1 addition & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export default function (env, argv) {
oauthPrompt: path.resolve(jsDir, "src/forms/OAuthPrompt.tsx"),
applications: path.resolve(jsDir, "src/Applications.tsx"),
oauthError: path.resolve(jsDir, "src/OAuthError.tsx"),
privacySummary: path.resolve(jsDir, "src/PrivacySummary.tsx"),
signupUser: path.resolve(jsDir, "src/forms/SignupUser.tsx"),
loginUser: path.resolve(jsDir, "src/forms/LoginUser.tsx"),
lostPassword: path.resolve(jsDir, "src/forms/LostPassword.tsx"),
Expand Down
Loading