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
f7b5066b
Commit
f7b5066b
authored
Sep 22, 2017
by
Diana Huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only show 'Explore New Courses' button when courses are browsable.
parent
990a8cbf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
6 deletions
+19
-6
openedx/features/learner_profile/templates/learner_profile/learner-achievements-fragment.html
+8
-6
openedx/features/learner_profile/tests/views/test_learner_profile.py
+11
-0
No files found.
openedx/features/learner_profile/templates/learner_profile/learner-achievements-fragment.html
View file @
f7b5066b
...
...
@@ -71,12 +71,14 @@ from openedx.core.djangolib.markup import HTML, Text
% elif own_profile:
<div
class=
"learner-message"
>
<h4
class=
"message-header"
>
${_("You haven't earned any certificates yet.")}
</h4>
<p
class=
"message-actions"
>
<a
class=
"btn btn-brand"
href=
"${marketing_link('COURSES')}"
>
<span
class=
"icon fa fa-search"
aria-hidden=
"true"
></span>
${_('Explore New Courses')}
</a>
</p>
% if settings.FEATURES.get('COURSES_ARE_BROWSABLE'):
<p
class=
"message-actions"
>
<a
class=
"btn btn-brand"
href=
"${marketing_link('COURSES')}"
>
<span
class=
"icon fa fa-search"
aria-hidden=
"true"
></span>
${_('Explore New Courses')}
</a>
</p>
% endif
</div>
% endif
% endif
...
...
openedx/features/learner_profile/tests/views/test_learner_profile.py
View file @
f7b5066b
...
...
@@ -3,6 +3,7 @@
import
datetime
import
ddt
import
mock
from
certificates.tests.factories
import
GeneratedCertificateFactory
# pylint: disable=import-error
from
course_modes.models
import
CourseMode
...
...
@@ -197,3 +198,13 @@ class LearnerProfileViewTest(UrlResetMixin, ModuleStoreTestCase):
self
.
assertContains
(
response
,
'You haven't earned any certificates yet.'
)
else
:
self
.
assertNotContains
(
response
,
'You haven't earned any certificates yet.'
)
@ddt.data
(
True
,
False
)
@override_waffle_flag
(
SHOW_ACHIEVEMENTS_FLAG
,
active
=
True
)
def
test_explore_courses_visibility
(
self
,
courses_browsable
):
with
mock
.
patch
.
dict
(
'django.conf.settings.FEATURES'
,
{
'COURSES_ARE_BROWSABLE'
:
courses_browsable
}):
response
=
self
.
client
.
get
(
'/u/{username}'
.
format
(
username
=
self
.
user
.
username
))
if
courses_browsable
:
self
.
assertContains
(
response
,
'Explore New Courses'
)
else
:
self
.
assertNotContains
(
response
,
'Explore New Courses'
)
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