2016-03-30 16:57:19 -04:00
|
|
|
extends /templates/core/modal-base-flat
|
2015-11-30 16:59:22 -05:00
|
|
|
|
|
|
|
block modal-header-content
|
|
|
|
.clearfix
|
|
|
|
.text-center
|
2016-04-07 17:55:42 -04:00
|
|
|
h1(data-i18n="teacher.enroll_students")
|
2016-03-30 16:57:19 -04:00
|
|
|
h2(data-i18n="courses.grants_lifetime_access")
|
2015-11-30 16:59:22 -05:00
|
|
|
|
|
|
|
block modal-body-content
|
2016-04-19 16:44:48 -04:00
|
|
|
- var numToEnroll = state.get('visibleSelectedUsers').length
|
|
|
|
- var unusedEnrollments = view.prepaids.totalMaxRedeemers() - view.prepaids.totalRedeemers()
|
|
|
|
- var tooManySelected = numToEnroll > unusedEnrollments
|
|
|
|
- var noneSelected = numToEnroll == 0
|
|
|
|
|
2016-04-07 17:55:42 -04:00
|
|
|
if view.classrooms.length > 1
|
2016-04-19 16:44:48 -04:00
|
|
|
.row
|
|
|
|
.col-sm-10.col-sm-offset-1
|
|
|
|
.text-center.m-b-3
|
|
|
|
.small.color-navy
|
|
|
|
span(data-i18n='teacher.show_students_from')
|
|
|
|
span.spr :
|
|
|
|
select.classroom-select
|
|
|
|
each classroom in view.classrooms.models
|
2016-05-09 18:16:54 -04:00
|
|
|
option(selected=(view.classroom ? classroom.id === view.classroom.id : false), value=classroom.id)
|
2016-04-19 16:44:48 -04:00
|
|
|
= classroom.get('name')
|
2016-05-09 18:16:54 -04:00
|
|
|
option(selected=(!view.classroom), value='' data-i18n='teacher.all_students')
|
2016-04-19 16:44:48 -04:00
|
|
|
|
|
|
|
form.form.m-t-3
|
2016-03-30 16:57:19 -04:00
|
|
|
span(data-i18n="teacher.enroll_the_following_students")
|
|
|
|
span :
|
|
|
|
.well.form-group
|
2016-05-09 18:16:54 -04:00
|
|
|
- var enrolledUsers = view.users.filter(function(user){ return user.isEnrolled() })
|
|
|
|
- var unenrolledUsers = view.users.filter(function(user){ return !user.isEnrolled() })
|
2016-04-19 16:44:48 -04:00
|
|
|
for user in unenrolledUsers
|
|
|
|
- var selected = Boolean(paid || state.get('selectedUsers').get(user.id))
|
2016-03-30 16:57:19 -04:00
|
|
|
.checkbox
|
|
|
|
label
|
2016-04-19 16:44:48 -04:00
|
|
|
input.user-checkbox(type="checkbox", disabled=false, checked=selected, data-user-id=user.id, name='user')
|
|
|
|
span.spr= user.broadName()
|
|
|
|
if enrolledUsers.length > 0
|
|
|
|
.small-details.m-t-3
|
|
|
|
span(data-i18n='TODO')
|
|
|
|
| The following students are already enrolled:
|
|
|
|
for user in enrolledUsers
|
|
|
|
- var selected = Boolean(paid || state.get('selectedUsers').get(user.id))
|
|
|
|
.checkbox
|
|
|
|
label
|
|
|
|
input.user-checkbox(type="checkbox", disabled=true, checked=true, data-user-id=user.id, name='user')
|
2016-03-30 16:57:19 -04:00
|
|
|
span.spr= user.broadName()
|
|
|
|
|
2016-04-19 16:44:48 -04:00
|
|
|
if state.get('error')
|
|
|
|
.alert.alert-danger
|
|
|
|
= state.get('error')
|
2016-03-30 16:57:19 -04:00
|
|
|
|
|
|
|
#submit-form-area.text-center
|
2016-04-19 16:44:48 -04:00
|
|
|
p.small-details.not-enough-enrollments(class=(tooManySelected ? 'visible' : ''))
|
|
|
|
span(data-i18n='teacher.not_enough_enrollments')
|
|
|
|
|
2016-03-30 16:57:19 -04:00
|
|
|
p.small-details
|
|
|
|
span.spr(data-i18n="courses.enrollment_credits_available")
|
|
|
|
span#total-available= view.prepaids.totalAvailable()
|
|
|
|
|
|
|
|
p
|
2016-04-19 16:44:48 -04:00
|
|
|
button#activate-licenses-btn.btn.btn-lg.btn-primary(type="submit" class=(tooManySelected || noneSelected ? 'disabled' : ''))
|
2016-03-30 16:57:19 -04:00
|
|
|
span.spr(data-i18n="courses.enroll")
|
|
|
|
| (
|
|
|
|
span#total-selected-span
|
2016-04-19 16:44:48 -04:00
|
|
|
= numToEnroll
|
2016-03-30 16:57:19 -04:00
|
|
|
| )
|
|
|
|
span.spl(data-i18n="courses.students1")
|
|
|
|
|
|
|
|
p
|
|
|
|
a#get-more-licenses-btn.btn.btn-lg.btn-primary-alt(href="/teachers/enrollments", data-i18n="courses.get_enrollments")
|
2015-12-08 15:05:08 -05:00
|
|
|
|
2015-12-06 09:27:54 -05:00
|
|
|
block modal-footer-content
|