Skip to content

Commit

Permalink
Fix expired text in EditStudentModal
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewJakubowicz committed Jul 25, 2018
1 parent b4ea20e commit 1c9e58b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
23 changes: 14 additions & 9 deletions app/templates/teachers/edit-student-modal.jade
Expand Up @@ -7,13 +7,26 @@ block modal-header-content

block modal-body-content

- var status = view.user.prepaidStatus()
- var prepaidType = view.user.prepaidType()

.text-center
.license-details
strong(data-i18n="teacher.license_status")
span.spr :
if view.user.prepaidStatus() !== 'enrolled'
if status == "not-enrolled"
.small-details
span(data-i18n="teacher.status_not_enrolled")
else
.small-details
if prepaidType === 'course'
span.spr(data-i18n="teacher.full_license")
else if prepaidType === 'starter_license'
span.spr(data-i18n="teacher.starter_license")
span (
span(class= status === 'expired' ? 'text-danger' : '')= view.studentStatusString()
span )
if status !== 'enrolled'
.small-details
if view.prepaids.totalAvailable() == 0
button.enroll-student-btn.btn.btn-navy.disabled(data-i18n="teacher.apply_license")
Expand All @@ -22,14 +35,6 @@ block modal-body-content
else
button.enroll-student-btn.btn.btn-navy(data-i18n="teacher.apply_license")
else
.small-details
if view.user.prepaidType() === 'course'
span.spr(data-i18n="teacher.full_license")
else if view.user.prepaidType() === 'starter_license'
span.spr(data-i18n="teacher.starter_license")
span (
span= view.studentStatusString(view.user)
span )
.small-details
button.revoke-student-btn.btn.btn-burgundy-alt(data-i18n="teacher.revoke_license")

Expand Down
6 changes: 3 additions & 3 deletions app/views/teachers/EditStudentModal.coffee
Expand Up @@ -56,9 +56,9 @@ module.exports = class EditStudentModal extends ModalView
noty text: msg, layout: 'center', type: 'error', killer: true, timeout: 3000
})

studentStatusString: (student) ->
status = student.prepaidStatus()
expires = student.get('coursePrepaid')?.endDate
studentStatusString: ->
status = @user.prepaidStatus()
expires = @user.get('coursePrepaid')?.endDate
date = if expires? then moment(expires).utc().format('ll') else ''
utils.formatStudentLicenseStatusDate(status, date)

Expand Down

0 comments on commit 1c9e58b

Please sign in to comment.