mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-24 08:08:15 -05:00
93 lines
3.6 KiB
Text
93 lines
3.6 KiB
Text
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
|
|
if view.teacherMode
|
|
.pull-right#main-button-area
|
|
button#add-students-btn.btn.btn-success Add Students
|
|
button#activate-licenses-btn.btn.btn-warning Activate Licenses
|
|
a.btn.btn-warning(href="/courses/purchase?from-classroom="+view.classroom.id) Purchase Licenses
|
|
|
|
hr
|
|
|
|
for user in view.users.models
|
|
if view.teacherMode
|
|
a.remove-student-link.pull-right.text-uppercase(data-user-id=user.id)
|
|
span.glyphicon.glyphicon-remove
|
|
span.spl remove student
|
|
|
|
h2= user.broadName()
|
|
- var lastPlayedString = view.makeLastPlayedString(user);
|
|
- var playtime = view.makePlaytimeString(user);
|
|
if lastPlayedString || playtime
|
|
#student-stats-row.row
|
|
if lastPlayedString
|
|
.col-sm-6 Last Played: #{lastPlayedString}
|
|
if playtime
|
|
.col-sm-6 Playtime: #{playtime}
|
|
|
|
- var paidFor = user.get('coursePrepaidID');
|
|
for courseInstance in view.courseInstances.models
|
|
- var inCourse = _.contains(courseInstance.get('members'), user.id);
|
|
if !(inCourse || view.teacherMode)
|
|
- continue;
|
|
- var course = view.courses.get(courseInstance.get('courseID'));
|
|
- var campaign = view.campaigns.get(course.get('campaignID'));
|
|
- var sessions = courseInstance.sessionsByUser[user.id] || [];
|
|
if !(course.get('free') || paidFor)
|
|
- continue;
|
|
.row
|
|
.col-sm-3.text-right= campaign.get('fullName')
|
|
.col-sm-9
|
|
if inCourse
|
|
- 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;
|
|
.progress
|
|
each level, levelID in campaign.get('levels')
|
|
- i++
|
|
- var session = sessionMap[levelID];
|
|
a(href=view.getLevelURL(level, course, courseInstance, session))
|
|
- var content = view.levelPopoverContent(level, session, i);
|
|
if session && session.get('state').complete
|
|
.progress-bar.progress-bar-success(style=css, data-content=content, data-toggle='popover')= i
|
|
else if session
|
|
.progress-bar.progress-bar-warning(style=css, data-content=content, data-toggle='popover')= i
|
|
else
|
|
.progress-bar.progress-bar-default(style=css, data-content=content, data-toggle='popover')= i
|
|
else if paidFor
|
|
button.enable-btn.btn.btn-info.btn-sm(data-user-id=user.id, data-course-instance-cid=courseInstance.cid) Enable
|
|
|
|
|
|
if view.teacherMode && !paidFor
|
|
.text-center
|
|
p
|
|
em Activate a license to enable more courses for this student.
|
|
p
|
|
button.activate-single-license-btn.btn.btn-info.btn-sm(data-user-id=user.id) Activate
|
|
|
|
hr
|