codecombat/app/templates/courses/purchase-courses-view.jade

99 lines
2.9 KiB
Text
Raw Normal View History

2015-11-05 18:30:57 -05:00
extends /templates/base
block content
if view.state === 'purchasing'
p.text-center(data-i18n="buy_gems.purchasing")
2015-11-05 18:30:57 -05:00
.progress.progress-striped.active
.progress-bar(style="width: 100%")
2015-11-05 18:30:57 -05:00
else if view.state === 'purchased'
p
span.spr(data-i18n="courses.thank_you_pref")
span= view.numberOfStudents
span.spl(data-i18n="courses.thank_you_suff")
2015-11-05 18:30:57 -05:00
p.text-center
2015-11-30 14:14:27 -05:00
if view.fromClassroom
a(href="/courses/"+view.fromClassroom, data-i18n="courses.return_to_class")
2015-11-30 14:14:27 -05:00
else
a(href="/teachers/classes", data-i18n="courses.return_to_course_man")
2015-11-05 18:30:57 -05:00
else
h2.text-center(data-i18n="courses.purchase_enrollments")
br
2015-11-05 18:30:57 -05:00
if view.state === 'error'
.alert.alert-danger= view.stateMessage
2015-12-06 17:26:32 -05:00
- var usedEnrollments = view.prepaids.totalRedeemers();
- var totalEnrollments = view.prepaids.totalMaxRedeemers();
- var remainingEnrollments = totalEnrollments - usedEnrollments;
.row
.col-md-4
.col-md-3
strong.uppercase(data-i18n="courses.you_have2")
2015-12-06 17:26:32 -05:00
.col-md-1
strong= remainingEnrollments
br
.row
.col-md-4
.col-md-3
strong.uppercase(data-i18n="courses.students_not_enrolled")
2015-12-06 17:26:32 -05:00
.row
.col-md-4
.col-md-3
each classroom in view.classrooms.models
if classroom.get('members').length > 0
.not-enrolled= classroom.get('name')
.not-enrolled(data-i18n="courses.total_all_classes")
2015-12-06 17:26:32 -05:00
.col-md-1
- var totalNotEnrolled = 0
each classroom in view.classrooms.models
if classroom.get('members').length > 0 && view.classroomNotEnrolledMap
.not-enrolled
strong= view.classroomNotEnrolledMap[classroom.id]
.not-enrolled
strong= view.totalNotEnrolled
br
br
p.text-center
strong(data-i18n="courses.how_many_enrollments")
br
p.text-center
2015-12-06 10:28:16 -05:00
input#students-input.text-center.enrollment-count(
2015-12-06 17:26:32 -05:00
value= view.numberOfStudents
type='number'
)
br
.container-fluid
.row
.col-md-offset-3.col-md-6
span(data-i18n="courses.each_student_access")
br
p.text-center#price-form-group
if view.numberOfStudentsIsValid()
strong
span(data-i18n="account_prepaid.purchase_total")
span.spr : #{view.numberOfStudents}
span(data-i18n="courses.enrollments")
span.spl x $#{(view.pricePerStudent/100).toFixed(2)} = #{view.getPriceString()}
else
strong Invalid number of students
p.text-center
2016-03-09 17:40:52 -05:00
button#purchase-btn.btn.btn-lg.btn-success.uppercase(data-i18n="courses.purchase_now" disabled=me.isAnonymous())
if me.isAnonymous()
// DNT. Temporary redirect until teacher-dashboard is finished
.alert.alert-danger.text-center
h2 You must be signed up to purchase enrollments.
p
a.btn.btn-primary.btn-lg(href="/teachers/signup") Create a teacher account