| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70 | 2×
2×
2×
2×
2×
2×
2×
2×
2×
108×
288×
288×
288×
288×
288×
288×
288×
288×
288×
288×
288×
108×
108×
288×
288×
288×
| var BS, ChangePeriodLink, DropStudentLink, Icon, React, RosterActions, RosterStore, _, ref;
React = require('react');
BS = require('react-bootstrap');
_ = require('underscore');
Icon = require('../icon');
ref = require('../../flux/roster'), RosterStore = ref.RosterStore, RosterActions = ref.RosterActions;
ChangePeriodLink = require('./change-period');
DropStudentLink = require('./drop-student');
module.exports = React.createClass({
displayName: 'PeriodRoster',
propTypes: {
courseId: React.PropTypes.string.isRequired,
period: React.PropTypes.object.isRequired,
isConceptCoach: React.PropTypes.bool.isRequired
},
renderStudentRow: function(student) {
return React.createElement("tr", {
"key": student.id
}, React.createElement("td", null, student.first_name), React.createElement("td", null, student.last_name), React.createElement("td", {
"className": "actions"
}, React.createElement(ChangePeriodLink, {
"courseId": this.props.courseId,
"student": student
}), React.createElement(DropStudentLink, {
"student": student
})));
},
isPeriodEmpty: function() {
var id, students;
id = this.props.activeTab.id;
students = RosterStore.getActiveStudentsForPeriod(this.props.courseId, id);
return students.length === 0;
},
render: function() {
var emptyInfo, student, students, studentsTable;
students = RosterStore.getActiveStudentsForPeriod(this.props.courseId, this.props.period.id);
studentsTable = React.createElement(BS.Table, {
"striped": true,
"bordered": true,
"condensed": true,
"hover": true,
"className": "roster"
}, React.createElement("thead", null, React.createElement("tr", null, React.createElement("th", null, "First Name"), React.createElement("th", null, "Last Name"), React.createElement("th", null, "Actions"))), React.createElement("tbody", null, (function() {
var i, len, ref1, results;
ref1 = _.sortBy(students, 'last_name');
results = [];
for (i = 0, len = ref1.length; i < len; i++) {
student = ref1[i];
results.push(this.renderStudentRow(student));
}
return results;
}).call(this)));
emptyInfo = React.createElement("div", {
"className": 'roster-empty-info'
}, "Use the \"Get Student Enrollment Code\" link above to get the code for this section of your course.\nAs your students login to Concept Coach, they will start appearing here.\nYou will be able to drop students or change their sections from this page.");
return React.createElement("div", {
"className": "period"
}, (this.isPeriodEmpty() && this.props.isConceptCoach ? emptyInfo : studentsTable));
}
});
|