| 126 | } |
| 127 | |
| 128 | onLoaded () { |
| 129 | this.teacherMode = me.isAdmin() || (this.classroom.get('ownerID') === me.id) |
| 130 | const userSessions = this.sessions.groupBy('creator') |
| 131 | for (const user of Array.from(this.users.models)) { |
| 132 | user.sessions = new CocoCollection(userSessions[user.id], { model: LevelSession }) |
| 133 | user.sessions.comparator = 'changed' |
| 134 | user.sessions.sort() |
| 135 | } |
| 136 | for (const courseInstance of Array.from(this.courseInstances.models)) { |
| 137 | const courseID = courseInstance.get('courseID') |
| 138 | const course = this.courses.get(courseID) |
| 139 | courseInstance.sessions.course = course |
| 140 | } |
| 141 | return super.onLoaded() |
| 142 | } |
| 143 | |
| 144 | afterRender () { |
| 145 | this.$('[data-toggle="popover"]').popover({ |