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
d4e1e3eb
Commit
d4e1e3eb
authored
Jun 14, 2017
by
Asad Iqbal
Committed by
GitHub
Jun 14, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15272 from edx/asadiqbal08/ENT-368
ENT-368 Hide Register or Sign In links in Header on Logistration
parents
c2c32e72
cd896501
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
8 deletions
+10
-8
lms/djangoapps/student_account/test/test_views.py
+4
-4
lms/djangoapps/student_account/views.py
+1
-0
lms/templates/navigation.html
+2
-2
themes/edx.org/lms/templates/header.html
+3
-2
No files found.
lms/djangoapps/student_account/test/test_views.py
View file @
d4e1e3eb
...
@@ -328,19 +328,19 @@ class StudentAccountLoginAndRegistrationTest(ThirdPartyAuthTestMixin, UrlResetMi
...
@@ -328,19 +328,19 @@ class StudentAccountLoginAndRegistrationTest(ThirdPartyAuthTestMixin, UrlResetMi
(
"edx.org"
,
"register_user"
),
(
"edx.org"
,
"register_user"
),
)
)
@ddt.unpack
@ddt.unpack
def
test_login_and_registration_form_signin_preserves_params
(
self
,
theme
,
url_name
):
def
test_login_and_registration_form_signin_
not_
preserves_params
(
self
,
theme
,
url_name
):
params
=
[
params
=
[
(
'course_id'
,
'edX/DemoX/Demo_Course'
),
(
'course_id'
,
'edX/DemoX/Demo_Course'
),
(
'enrollment_action'
,
'enroll'
),
(
'enrollment_action'
,
'enroll'
),
]
]
# The response should have a "Sign In" button with the URL
# The response should
not
have a "Sign In" button with the URL
# that preserves the querystring params
# that preserves the querystring params
with
with_comprehensive_theme_context
(
theme
):
with
with_comprehensive_theme_context
(
theme
):
response
=
self
.
client
.
get
(
reverse
(
url_name
),
params
,
HTTP_ACCEPT
=
"text/html"
)
response
=
self
.
client
.
get
(
reverse
(
url_name
),
params
,
HTTP_ACCEPT
=
"text/html"
)
expected_url
=
'/login?{}'
.
format
(
self
.
_finish_auth_url_param
(
params
+
[(
'next'
,
'/dashboard'
)]))
expected_url
=
'/login?{}'
.
format
(
self
.
_finish_auth_url_param
(
params
+
[(
'next'
,
'/dashboard'
)]))
self
.
assertContains
(
response
,
expected_url
)
self
.
assert
Not
Contains
(
response
,
expected_url
)
# Add additional parameters:
# Add additional parameters:
params
=
[
params
=
[
...
@@ -356,7 +356,7 @@ class StudentAccountLoginAndRegistrationTest(ThirdPartyAuthTestMixin, UrlResetMi
...
@@ -356,7 +356,7 @@ class StudentAccountLoginAndRegistrationTest(ThirdPartyAuthTestMixin, UrlResetMi
response
=
self
.
client
.
get
(
reverse
(
url_name
),
params
,
HTTP_ACCEPT
=
"text/html"
)
response
=
self
.
client
.
get
(
reverse
(
url_name
),
params
,
HTTP_ACCEPT
=
"text/html"
)
expected_url
=
'/login?{}'
.
format
(
self
.
_finish_auth_url_param
(
params
))
expected_url
=
'/login?{}'
.
format
(
self
.
_finish_auth_url_param
(
params
))
self
.
assertContains
(
response
,
expected_url
)
self
.
assert
Not
Contains
(
response
,
expected_url
)
@mock.patch.dict
(
settings
.
FEATURES
,
{
"ENABLE_THIRD_PARTY_AUTH"
:
False
})
@mock.patch.dict
(
settings
.
FEATURES
,
{
"ENABLE_THIRD_PARTY_AUTH"
:
False
})
@ddt.data
(
"signin_user"
,
"register_user"
)
@ddt.data
(
"signin_user"
,
"register_user"
)
...
...
lms/djangoapps/student_account/views.py
View file @
d4e1e3eb
...
@@ -141,6 +141,7 @@ def login_and_registration_form(request, initial_mode="login"):
...
@@ -141,6 +141,7 @@ def login_and_registration_form(request, initial_mode="login"):
'responsive'
:
True
,
'responsive'
:
True
,
'allow_iframing'
:
True
,
'allow_iframing'
:
True
,
'disable_courseware_js'
:
True
,
'disable_courseware_js'
:
True
,
'combined_login_and_register'
:
True
,
'disable_footer'
:
not
configuration_helpers
.
get_value
(
'disable_footer'
:
not
configuration_helpers
.
get_value
(
'ENABLE_COMBINED_LOGIN_REGISTRATION_FOOTER'
,
'ENABLE_COMBINED_LOGIN_REGISTRATION_FOOTER'
,
settings
.
FEATURES
[
'ENABLE_COMBINED_LOGIN_REGISTRATION_FOOTER'
]
settings
.
FEATURES
[
'ENABLE_COMBINED_LOGIN_REGISTRATION_FOOTER'
]
...
...
lms/templates/navigation.html
View file @
d4e1e3eb
...
@@ -136,7 +136,7 @@ site_status_msg = get_site_status_msg(course_id)
...
@@ -136,7 +136,7 @@ site_status_msg = get_site_status_msg(course_id)
</
%
block>
</
%
block>
<
%
block
name=
"navigation_other_global_links"
>
<
%
block
name=
"navigation_other_global_links"
>
% if not settings.FEATURES['DISABLE_LOGIN_BUTTON']:
% if not settings.FEATURES['DISABLE_LOGIN_BUTTON']
and not combined_login_and_register
:
% if settings.FEATURES.get('ENABLE_COURSE_DISCOVERY'):
% if settings.FEATURES.get('ENABLE_COURSE_DISCOVERY'):
<li
class=
"item nav-global-05"
>
<li
class=
"item nav-global-05"
>
<a
class=
"btn"
href=
"/courses"
>
${_("Explore Courses")}
</a>
<a
class=
"btn"
href=
"/courses"
>
${_("Explore Courses")}
</a>
...
@@ -158,7 +158,7 @@ site_status_msg = get_site_status_msg(course_id)
...
@@ -158,7 +158,7 @@ site_status_msg = get_site_status_msg(course_id)
<ol
class=
"right nav-courseware list-inline"
>
<ol
class=
"right nav-courseware list-inline"
>
<
%
block
name=
"navigation_sign_in"
>
<
%
block
name=
"navigation_sign_in"
>
<li
class=
"item nav-courseware-01"
>
<li
class=
"item nav-courseware-01"
>
% if not settings.FEATURES['DISABLE_LOGIN_BUTTON']:
% if not settings.FEATURES['DISABLE_LOGIN_BUTTON']
and not combined_login_and_register
:
% if course and settings.FEATURES.get('RESTRICT_ENROLL_BY_REG_METHOD') and course.enrollment_domain:
% if course and settings.FEATURES.get('RESTRICT_ENROLL_BY_REG_METHOD') and course.enrollment_domain:
<a
class=
"btn btn-login"
href=
"${reverse('course-specific-login', args=[course.id.to_deprecated_string()])}${login_query()}"
>
${_("Sign in")}
</a>
<a
class=
"btn btn-login"
href=
"${reverse('course-specific-login', args=[course.id.to_deprecated_string()])}${login_query()}"
>
${_("Sign in")}
</a>
% else:
% else:
...
...
themes/edx.org/lms/templates/header.html
View file @
d4e1e3eb
...
@@ -124,15 +124,16 @@ site_status_msg = get_site_status_msg(course_id)
...
@@ -124,15 +124,16 @@ site_status_msg = get_site_status_msg(course_id)
<nav
aria-label=
"${_('Account')}"
class=
"nav-account-management"
>
<nav
aria-label=
"${_('Account')}"
class=
"nav-account-management"
>
<div
class=
"right nav-courseware list-inline"
>
<div
class=
"right nav-courseware list-inline"
>
<div
class=
"item nav-courseware-01"
>
<div
class=
"item nav-courseware-01"
>
% if not settings.FEATURES['DISABLE_LOGIN_BUTTON']:
% if not settings.FEATURES['DISABLE_LOGIN_BUTTON']
and not combined_login_and_register
:
% if course and settings.FEATURES.get('RESTRICT_ENROLL_BY_REG_METHOD') and course.enrollment_domain:
% if course and settings.FEATURES.get('RESTRICT_ENROLL_BY_REG_METHOD') and course.enrollment_domain:
<a
class=
"btn btn-login"
href=
"${reverse('course-specific-login', args=[course.id.to_deprecated_string()])}${login_query()}"
>
${_("Sign in")}
</a>
<a
class=
"btn btn-login"
href=
"${reverse('course-specific-login', args=[course.id.to_deprecated_string()])}${login_query()}"
>
${_("Sign in")}
</a>
% else:
% else:
<a
class=
"btn btn-login"
href=
"/login${login_query()}"
>
${_("Sign in")}
</a>
<a
class=
"btn btn-login"
href=
"/login${login_query()}"
>
${_("Sign in")}
</a>
% endif
% endif
% endif
% endif
</div>
</div>
% if not settings.FEATURES['DISABLE_LOGIN_BUTTON']:
% if not settings.FEATURES['DISABLE_LOGIN_BUTTON']
and not combined_login_and_register
:
% if course and settings.FEATURES.get('RESTRICT_ENROLL_BY_REG_METHOD') and course.enrollment_domain:
% if course and settings.FEATURES.get('RESTRICT_ENROLL_BY_REG_METHOD') and course.enrollment_domain:
<div
class=
"item nav-courseware-02"
>
<div
class=
"item nav-courseware-02"
>
<a
class=
"btn-neutral btn-register"
href=
"${reverse('course-specific-register', args=[course.id.to_deprecated_string()])}"
>
${_("Register")}
</a>
<a
class=
"btn-neutral btn-register"
href=
"${reverse('course-specific-register', args=[course.id.to_deprecated_string()])}"
>
${_("Register")}
</a>
...
...
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