Skip to content
Merged
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
7 changes: 5 additions & 2 deletions lms/static/js/student_account/views/RegisterView.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@
isCheckbox = $input.attr('class').indexOf('checkbox') !== -1;

if (!isCheckbox) {
if ($input.val().length === 0 && !$input.is(':-webkit-autofill')) {
if ($input.find(inputSelectors).val().length === 0
&& !$input.is(':-webkit-autofill')) {
$input.find('label').addClass('focus-out')
.removeClass('focus-in');
} else {
Expand All @@ -235,12 +236,14 @@
// is a required checkbox field and the optional fields toggle is a cosmetic
// improvement so that we don't have to show all the optional fields.
// xss-lint: disable=javascript-jquery-insert-into-target
$('.checkbox-optional_fields_toggle').insertBefore('.optional-fields');
$('.checkbox-optional_fields_toggle').insertAfter('.required-fields');
if (!this.hasOptionalFields) {
$('.checkbox-optional_fields_toggle').addClass('hidden');
}
// xss-lint: disable=javascript-jquery-insert-into-target
$('.checkbox-honor_code').insertAfter('.optional-fields');
// xss-lint: disable=javascript-jquery-insert-into-target
$('.checkbox-terms_of_service').insertAfter('.optional-fields');

// Clicking on links inside a label should open that link.
$('label a').click(function(ev) {
Expand Down
2 changes: 2 additions & 0 deletions lms/templates/student_account/register.underscore
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
<span class="text"><%- gettext("or create a new one here") %></span>
</h3>
</div>
<% } else { %>
<h2><%- gettext('Create an Account')%></h2>
<% } %>
<% } else if (context.autoRegisterWelcomeMessage) { %>
<span class="auto-register-message"><%- context.autoRegisterWelcomeMessage %></span>
Expand Down
9 changes: 4 additions & 5 deletions openedx/core/djangoapps/user_api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -786,13 +786,14 @@ def _add_terms_of_service_field(self, form_desc, required=True):
# in order to register a new account.
terms_label = _(u"Terms of Service")
terms_link = marketing_link("TOS")
terms_text = _(u"Review the Terms of Service")

# Translators: "Terms of service" is a legal document users must agree to
# in order to register a new account.
label = _(u"I agree to the {platform_name} {terms_of_service}").format(
label = Text(_(u"I agree to the {platform_name} {tos_link_start}{terms_of_service}{tos_link_end}")).format(
platform_name=configuration_helpers.get_value("PLATFORM_NAME", settings.PLATFORM_NAME),
terms_of_service=terms_label
terms_of_service=terms_label,
tos_link_start=HTML("<a href='{terms_link}' target='_blank'>").format(terms_link=terms_link),
tos_link_end=HTML("</a>"),
)

# Translators: "Terms of service" is a legal document users must agree to
Expand All @@ -811,8 +812,6 @@ def _add_terms_of_service_field(self, form_desc, required=True):
error_messages={
"required": error_msg
},
supplementalLink=terms_link,
supplementalText=terms_text
)

def _apply_third_party_auth_overrides(self, request, form_desc):
Expand Down
6 changes: 4 additions & 2 deletions openedx/core/djangoapps/user_api/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1593,12 +1593,13 @@ def test_registration_separate_terms_of_service_mktg_site_enabled(self):

# Terms of service field should also be present
link_label = "Terms of Service"
link_template = "<a href='https://www.test.com/tos' target='_blank'>{link_label}</a>"
self._assert_reg_field(
{"honor_code": "required", "terms_of_service": "required"},
{
"label": u"I agree to the {platform_name} {link_label}".format(
platform_name=settings.PLATFORM_NAME,
link_label=link_label
link_label=link_template.format(link_label=link_label)
),
"name": "terms_of_service",
"defaultValue": False,
Expand Down Expand Up @@ -1640,12 +1641,13 @@ def test_registration_separate_terms_of_service_mktg_site_disabled(self):

link_label = 'Terms of Service'
# Terms of service field should also be present
link_template = "<a href='/tos' target='_blank'>{link_label}</a>"
self._assert_reg_field(
{"honor_code": "required", "terms_of_service": "required"},
{
"label": u"I agree to the {platform_name} {link_label}".format(
platform_name=settings.PLATFORM_NAME,
link_label=link_label
link_label=link_template.format(link_label=link_label)
),
"name": "terms_of_service",
"defaultValue": False,
Expand Down