🐛Fix jade i18n errors in courses pages

Uncaught TypeError: Cannot read property 'i18n' of undefined
This commit is contained in:
Matt Lott 2015-09-28 16:13:27 -07:00
parent 6b8a436aa1
commit 1557b7b442
2 changed files with 10 additions and 3 deletions

View file

@ -31,8 +31,13 @@ block content
else if !course || !courseInstance
h1(data-i18n="common.loading") Loading...
else
h1= courseInstance.get('name') || $.i18n.t('courses.unnamed_class')
small.spl (#{course.get('name')})
if courseInstance.get('name')
h1= courseInstance.get('name')
small.spl (#{course.get('name')})
else
h1
span(data-i18n='courses.unnamed_class')
small.spl (#{course.get('name')})
p
if courseInstance.get('description')

View file

@ -140,5 +140,7 @@ mixin course-block(course)
button.btn.btn-lg.btn-success.btn-continue(data-toggle='modal', data-target="#continueModal#{course.id}", data-i18n="courses.enter") Enter
else if enrolledCourses[course.id]
button.btn.btn-lg.btn-success.btn-continue(data-toggle='modal', data-target="#continueModal#{course.id}", data-i18n="common.continue")
else if course.get('pricePerSeat') === 0
button.btn.btn-lg.btn-success.btn-buy(data-course-id="#{course.id}", data-i18n='courses.get_free')
else
button.btn.btn-lg.btn-success.btn-buy(data-course-id="#{course.id}") #{course.get('pricePerSeat') === 0 ? $.i18n.t('courses.get_free') : $.i18n.t('courses.buy_course')}
button.btn.btn-lg.btn-success.btn-buy(data-course-id="#{course.id}", data-i18n='courses.buy_course')