Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
0ecc0558
Commit
0ecc0558
authored
Dec 07, 2017
by
Diana Huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More registration form cleanup.
parent
f9623fc9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
9 deletions
+15
-9
lms/static/js/student_account/views/RegisterView.js
+5
-2
lms/templates/student_account/register.underscore
+2
-0
openedx/core/djangoapps/user_api/api.py
+4
-5
openedx/core/djangoapps/user_api/tests/test_views.py
+4
-2
No files found.
lms/static/js/student_account/views/RegisterView.js
View file @
0ecc0558
...
...
@@ -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
{
...
...
@@ -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'
).
insert
Before
(
'.optional
-fields'
);
$
(
'.checkbox-optional_fields_toggle'
).
insert
After
(
'.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
)
{
...
...
lms/templates/student_account/register.underscore
View file @
0ecc0558
...
...
@@ -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>
...
...
openedx/core/djangoapps/user_api/api.py
View file @
0ecc0558
...
...
@@ -786,13 +786,14 @@ class RegistrationFormFactory(object):
# 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
...
...
@@ -811,8 +812,6 @@ class RegistrationFormFactory(object):
error_messages
=
{
"required"
:
error_msg
},
supplementalLink
=
terms_link
,
supplementalText
=
terms_text
)
def
_apply_third_party_auth_overrides
(
self
,
request
,
form_desc
):
...
...
openedx/core/djangoapps/user_api/tests/test_views.py
View file @
0ecc0558
...
...
@@ -1593,12 +1593,13 @@ class RegistrationViewTest(ThirdPartyAuthTestMixin, UserAPITestCase):
# 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
,
...
...
@@ -1640,12 +1641,13 @@ class RegistrationViewTest(ThirdPartyAuthTestMixin, UserAPITestCase):
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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment