2015-11-30 14:14:27 -05:00
|
|
|
extends /templates/base
|
|
|
|
|
|
|
|
block content
|
|
|
|
|
|
|
|
- var isOwner = view.classroom.get('ownerID') === me.id;
|
|
|
|
if isOwner
|
|
|
|
a(href="/courses/teachers") Back to my classrooms
|
|
|
|
else
|
|
|
|
a(href="/courses") Back to my courses
|
|
|
|
|
|
|
|
h1
|
|
|
|
span.spr= view.classroom.get('name')
|
|
|
|
if isOwner
|
|
|
|
a#edit-class-details-link
|
|
|
|
small Edit class details
|
|
|
|
|
|
|
|
if view.classroom.get('description')
|
|
|
|
p= view.classroom.get('description')
|
|
|
|
|
|
|
|
// TODO: Add classroom statistics (grab from CourseDetailsView)
|
|
|
|
|
|
|
|
h1
|
|
|
|
| Students
|
|
|
|
.pull-right#main-button-area
|
2015-12-01 16:17:21 -05:00
|
|
|
button#add-students-btn.btn.btn-success Add Students
|
2015-11-30 16:59:22 -05:00
|
|
|
button#activate-licenses-btn.btn.btn-warning Activate Licenses
|
2015-11-30 14:14:27 -05:00
|
|
|
a.btn.btn-warning(href="/courses/purchase?from-classroom="+view.classroom.id) Purchase Licenses
|
|
|
|
|
|
|
|
hr
|
|
|
|
|
|
|
|
for user in view.users.models
|
2015-12-02 14:56:38 -05:00
|
|
|
a.remove-student-link.pull-right.text-uppercase(data-user-id=user.id)
|
|
|
|
span.glyphicon.glyphicon-remove
|
|
|
|
span.spl remove student
|
|
|
|
|
2015-11-30 16:59:22 -05:00
|
|
|
h2= user.broadName()
|
2015-11-30 14:14:27 -05:00
|
|
|
- var lastPlayedString = view.makeLastPlayedString(user);
|
|
|
|
if lastPlayedString
|
|
|
|
p Last Played: #{lastPlayedString}
|
|
|
|
|
|
|
|
- var paidFor = user.get('coursePrepaidID');
|
|
|
|
for courseInstance in view.courseInstances.models
|
|
|
|
- var inCourse = _.contains(courseInstance.get('members'), user.id);
|
|
|
|
- var course = view.courses.get(courseInstance.get('courseID'));
|
|
|
|
- var campaign = view.campaigns.get(course.get('campaignID'));
|
2015-12-03 15:07:12 -05:00
|
|
|
- var sessions = courseInstance.sessionsByUser[user.id] || [];
|
2015-11-30 14:14:27 -05:00
|
|
|
if !(course.get('free') || paidFor)
|
|
|
|
- continue;
|
|
|
|
.row
|
2015-12-03 15:07:12 -05:00
|
|
|
.col-sm-3.text-right= campaign.get('fullName')
|
|
|
|
.col-sm-9
|
2015-11-30 14:14:27 -05:00
|
|
|
if inCourse
|
2015-12-03 15:07:12 -05:00
|
|
|
- var levels = campaign.get('levels');
|
|
|
|
- var numLevels = Object.keys(levels).length;
|
|
|
|
- var sessionMap = _.zipObject(_.map(sessions, function(s) { return s.get('level').original; }), sessions);
|
|
|
|
- var levelCellWidth = 100.00;
|
|
|
|
if numLevels > 0
|
|
|
|
- levelCellWidth = 100.00 / numLevels;
|
|
|
|
- var css = "width:"+levelCellWidth+"%;"
|
|
|
|
- var i = 0;
|
2015-11-30 14:14:27 -05:00
|
|
|
.progress
|
2015-12-03 15:07:12 -05:00
|
|
|
each level, levelID in campaign.get('levels')
|
|
|
|
- var session = sessionMap[levelID];
|
2015-12-03 15:09:58 -05:00
|
|
|
if !session
|
|
|
|
- break;
|
2015-12-03 15:07:12 -05:00
|
|
|
a(href=view.getLevelURL(level, course, courseInstance, session))
|
|
|
|
- var content = view.levelPopoverContent(level, session, i);
|
|
|
|
if session && session.get('state').complete
|
2015-12-03 15:09:58 -05:00
|
|
|
.progress-bar.progress-bar-success(style=css, data-content=content, data-toggle='popover')= i + 1
|
2015-12-03 15:07:12 -05:00
|
|
|
else
|
2015-12-03 15:09:58 -05:00
|
|
|
.progress-bar.progress-bar-warning(style=css, data-content=content, data-toggle='popover')= i + 1
|
2015-12-03 15:07:12 -05:00
|
|
|
- i++
|
2015-11-30 14:14:27 -05:00
|
|
|
else if paidFor
|
2015-12-02 19:07:46 -05:00
|
|
|
button.enable-btn.btn.btn-info.btn-sm(data-user-id=user.id, data-course-instance-cid=courseInstance.cid) Enable
|
2015-11-30 14:14:27 -05:00
|
|
|
|
|
|
|
if !paidFor
|
|
|
|
.text-center
|
|
|
|
p
|
|
|
|
em Activate a license to enable more courses for this student.
|
|
|
|
p
|
2015-11-30 16:59:22 -05:00
|
|
|
button.activate-single-license-btn.btn.btn-info.btn-sm(data-user-id=user.id) Activate
|
2015-11-30 14:14:27 -05:00
|
|
|
|
2015-12-03 15:07:12 -05:00
|
|
|
hr
|