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
13 changes: 12 additions & 1 deletion openedx/core/djangoapps/user_authn/views/registration_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -1072,15 +1072,26 @@ def _add_terms_of_service_field(self, form_desc, required=True):
terms_label = _("Terms of Service")
terms_link = marketing_link("TOS")

pp_link = marketing_link("PRIVACY")
coppa_link = marketing_link("COPPA")

# Translators: "Terms of service" is a legal document users must agree to
# in order to register a new account.
label = Text(_("I agree to the {platform_name} {tos_link_start}{terms_of_service}{tos_link_end}")).format(
label = Text(_("I have read and agree to the {platform_name} {tos_link_start}{terms_of_service}{tos_link_end}, {privacy_policy_link_start}Privacy Policy{privacy_policy_link_end}, and {coppa_link_start}COPPA Policy{coppa_link_end}")).format(
platform_name=configuration_helpers.get_value("PLATFORM_NAME", settings.PLATFORM_NAME),
terms_of_service=terms_label,
tos_link_start=HTML("<a href='{terms_link}' rel='noopener' target='_blank'>").format(
terms_link=terms_link
),
tos_link_end=HTML("</a>"),
privacy_policy_link_start=HTML("<a href='{pp_url}' rel='noopener' target='_blank'>").format(
pp_url=pp_link
),
privacy_policy_link_end=HTML("</a>"),
coppa_link_start=HTML("<a href='{coppa_url}' rel='noopener' target='_blank'>").format(
coppa_url=coppa_link
),
coppa_link_end=HTML("</a>"),
)

# Translators: "Terms of service" is a legal document users must agree to
Expand Down
3 changes: 2 additions & 1 deletion openedx/features/termsofservice/api/v1/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ def terms_of_service_api(request): # lint-amnesty, pylint: disable=missing-func
result = {
"tos_exists_for_site": bool(latest_tos_html),
"tos_html": latest_tos_html,
"has_user_agreed_to_latest_tos": has_user_agreed_to_latest_tos
"has_user_agreed_to_latest_tos": has_user_agreed_to_latest_tos,
"site_name": cur_site_name
}

return JsonResponse(result)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class ModalView extends Component {
tos_html: '',
tos_exists_for_site: false,
has_user_agreed_to_latest_tos: false,
site_name: '',
tos_isChecked: false,
};
this.showModal = this.showModal.bind(this);
Expand Down Expand Up @@ -49,7 +50,8 @@ class ModalView extends Component {
this.setState({
tos_exists_for_site: data.tos_exists_for_site,
tos_html: data.tos_html,
has_user_agreed_to_latest_tos: data.has_user_agreed_to_latest_tos
has_user_agreed_to_latest_tos: data.has_user_agreed_to_latest_tos,
site_name: data.site_name
});
});
}
Expand Down Expand Up @@ -104,8 +106,8 @@ class ModalView extends Component {

<main>
<Modal show={this.state.show} handleClose={this.hideModal} >
<h2 className="mt-3 text-center">Terms of Service Agreement</h2>
<p className="text-center">EducateWorkforce has updated its terms of service. Please read the following terms and agree in order to continue use of the platform.</p>
<h2 className="mt-3 text-center">Policy Statements</h2>
<p className="text-center">{this.state.site_name} has updated its policy statements. Please read the following terms and agree in order to continue use of the platform.</p>

<div className="modal-body border border-dark rounded m-3">
<div className="scrollable_tos_style" dangerouslySetInnerHTML={{ __html: (this.state.tos_html) }}></div>
Expand All @@ -116,7 +118,7 @@ class ModalView extends Component {
<div className="form-check d-flex justify-content-center flex-nowrap">
<input className="form-check-input" type="checkbox" value="" onChange={this.checkboxClicked} id="agree-to-tos"></input>
<label className="form-check-label m-3" htmlFor="agree-to-tos">
I agree to the EducateWorkforce Terms of Service
I agree to the {this.state.site_name} Terms of Service, Privacy Policy, and COPPA statement
</label>
</div>
<button type="submit" disabled={this.isCheckboxClicked()} onClick={this.hideModal} className="submit-btn btn btn-primary">Continue to Dashboard</button>
Expand Down
Loading