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
a7ceb880
Commit
a7ceb880
authored
Apr 14, 2017
by
noraiz-anwar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Priortize advertised start date to diplay on learner's dashboard
parent
d6757b98
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
4 deletions
+44
-4
common/test/acceptance/tests/lms/test_lms_dashboard.py
+33
-0
lms/templates/dashboard/_dashboard_course_listing.html
+4
-4
openedx/core/djangoapps/content/course_overviews/models.py
+7
-0
No files found.
common/test/acceptance/tests/lms/test_lms_dashboard.py
View file @
a7ceb880
...
@@ -305,6 +305,39 @@ class LmsDashboardPageTest(BaseLmsDashboardTest):
...
@@ -305,6 +305,39 @@ class LmsDashboardPageTest(BaseLmsDashboardTest):
# and course starts within 5 days
# and course starts within 5 days
self
.
assertEqual
(
course_date
,
expected_course_date
)
self
.
assertEqual
(
course_date
,
expected_course_date
)
def
test_advertised_start_date
(
self
):
"""
Scenario:
Course Date should be advertised start date
if the course on student dashboard has `Course Advertised Start` set.
As a Student,
Given that I have enrolled to a course
And the course has `Course Advertised Start` set.
When I visit dashboard page
Then the advertised start date should be displayed rather course start date"
"""
course_start_date
=
self
.
now
+
datetime
.
timedelta
(
days
=
2
)
course_advertised_start
=
"Winter 2018"
self
.
course_fixture
.
add_course_details
({
'start_date'
:
course_start_date
,
})
self
.
course_fixture
.
configure_course
()
self
.
course_fixture
.
add_advanced_settings
({
u"advertised_start"
:
{
u"value"
:
course_advertised_start
}
})
self
.
course_fixture
.
_add_advanced_settings
()
expected_course_date
=
"Starts - {start_date}"
.
format
(
start_date
=
course_advertised_start
)
self
.
dashboard_page
.
visit
()
course_date
=
self
.
dashboard_page
.
get_course_date
()
self
.
assertEqual
(
course_date
,
expected_course_date
)
def
test_profile_img_alt_empty
(
self
):
def
test_profile_img_alt_empty
(
self
):
"""
"""
Validate value of profile image alt attribue is null
Validate value of profile image alt attribue is null
...
...
lms/templates/dashboard/_dashboard_course_listing.html
View file @
a7ceb880
...
@@ -109,19 +109,19 @@ from student.helpers import (
...
@@ -109,19 +109,19 @@ from student.helpers import (
course_date =
course_overview.end
course_date =
course_overview.end
elif
course_overview
.
has_started
()
:
elif
course_overview
.
has_started
()
:
container_string =
_("Started
-
{
date
}")
container_string =
_("Started
-
{
date
}")
course_date =
course_overview.
start
course_date =
course_overview.
dashboard_start_display
elif
course_overview
.
starts_within
(
days=
5):
elif
course_overview
.
starts_within
(
days=
5):
container_string =
_("Starts
-
{
date
}")
container_string =
_("Starts
-
{
date
}")
course_date =
course_overview.
start
course_date =
course_overview.
dashboard_start_display
format =
'defaultFormat'
format =
'defaultFormat'
else:
##
hasn
'
t
started
yet
else:
##
hasn
'
t
started
yet
container_string =
_("Starts
-
{
date
}")
container_string =
_("Starts
-
{
date
}")
course_date =
course_overview.
start
course_date =
course_overview.
dashboard_start_display
endif
endif
endif
endif
%
>
%
>
% if isinstance(course_date,
str
):
% if isinstance(course_date,
basestring
):
<span
class=
"info-date-block"
data-tooltip=
"Hi"
>
${_(container_string).format(date=course_date)}
</span>
<span
class=
"info-date-block"
data-tooltip=
"Hi"
>
${_(container_string).format(date=course_date)}
</span>
% elif course_date is not None:
% elif course_date is not None:
<
%
<
%
...
...
openedx/core/djangoapps/content/course_overviews/models.py
View file @
a7ceb880
...
@@ -361,6 +361,13 @@ class CourseOverview(TimeStampedModel):
...
@@ -361,6 +361,13 @@ class CourseOverview(TimeStampedModel):
"""
"""
return
block_metadata_utils
.
display_name_with_default_escaped
(
self
)
return
block_metadata_utils
.
display_name_with_default_escaped
(
self
)
@property
def
dashboard_start_display
(
self
):
"""
Return start date to diplay on learner's dashboard, preferably `Course Advertised Start`
"""
return
self
.
advertised_start
or
self
.
start
def
has_started
(
self
):
def
has_started
(
self
):
"""
"""
Returns whether the the course has started.
Returns whether the the course has started.
...
...
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