course title link to course home when enrolled
This commit is contained in:
@@ -185,6 +185,7 @@
|
||||
|
||||
setActiveCourseRun: function(courseRun, userPreferences) {
|
||||
var startDateString,
|
||||
courseTitleLink = '',
|
||||
isEnrolled = this.isEnrolledInSession() && courseRun.key;
|
||||
if (courseRun) {
|
||||
if (this.valueIsDefined(courseRun.advertised_start)) {
|
||||
@@ -192,6 +193,11 @@
|
||||
} else {
|
||||
startDateString = this.formatDate(courseRun.start, userPreferences);
|
||||
}
|
||||
if (isEnrolled && courseRun.course_url) {
|
||||
courseTitleLink = courseRun.course_url;
|
||||
} else if (!isEnrolled && courseRun.marketing_url) {
|
||||
courseTitleLink = courseRun.marketing_url;
|
||||
}
|
||||
this.set({
|
||||
certificate_url: courseRun.certificate_url,
|
||||
course_run_key: courseRun.key || '',
|
||||
@@ -210,7 +216,8 @@
|
||||
start_date: startDateString,
|
||||
upcoming_course_runs: this.getUpcomingCourseRuns(),
|
||||
upgrade_url: courseRun.upgrade_url,
|
||||
price: this.getCertificatePriceString(courseRun)
|
||||
price: this.getCertificatePriceString(courseRun),
|
||||
course_title_link: courseTitleLink
|
||||
});
|
||||
|
||||
// This is used to render the date for completed and in progress courses
|
||||
|
||||
Reference in New Issue
Block a user