Fix progress issues

ECOM-6602
This commit is contained in:
Matthew Piatetsky
2017-04-21 11:01:14 -04:00
parent 22ab0c8d47
commit ff0da0f78e
6 changed files with 553 additions and 17 deletions

View File

@@ -53,7 +53,8 @@
postRender: function() {
var $upgradeMessage = this.$('.upgrade-message'),
$certStatus = this.$('.certificate-status'),
$expiredNotification = this.$('.expired-notification');
$expiredNotification = this.$('.expired-notification'),
expired = this.model.get('expired');
this.enrollView = new CourseEnrollView({
$parentEl: this.$('.course-actions'),
@@ -62,14 +63,14 @@
enrollModel: this.enrollModel
});
if (this.model.get('upgrade_url')) {
if (this.model.get('upgrade_url') && !(expired === true)) {
this.upgradeMessage = new UpgradeMessageView({
$el: $upgradeMessage,
model: this.model
});
$certStatus.remove();
} else if (this.model.get('certificate_url')) {
} else if (this.model.get('certificate_url') && !(expired === true)) {
this.certificateStatus = new CertificateStatusView({
$el: $certStatus,
model: this.model
@@ -82,7 +83,7 @@
$certStatus.remove();
}
if (this.model.get('expired')) {
if (expired) {
this.expiredNotification = new ExpiredNotificationView({
$el: $expiredNotification,
model: this.model

View File

@@ -50,7 +50,7 @@
handleEnroll: function() {
// Enrollment click event handled here
var courseRunKey = $('.run-select').val();
var courseRunKey = $('.run-select').val() || this.model.get('course_run_key');
this.model.updateCourseRun(courseRunKey);
if (!this.model.get('is_enrolled')) {
// Create the enrollment.