2015-11-03 19:41:06 -05:00
|
|
|
extends /templates/base
|
|
|
|
|
|
|
|
block content
|
|
|
|
|
2015-12-08 15:05:08 -05:00
|
|
|
p(data-i18n="courses.to_join_ask")
|
|
|
|
|
2015-11-04 19:54:13 -05:00
|
|
|
#join-classroom-form.form-horizontal
|
2015-11-03 19:41:06 -05:00
|
|
|
.form-group
|
|
|
|
.col-sm-2
|
2015-12-09 09:57:33 -05:00
|
|
|
button#join-class-btn.btn.btn-default.btn-block(disabled=view.state==='enrolling', data-i18n="courses.join_this_class")
|
2015-11-03 19:41:06 -05:00
|
|
|
.col-sm-6
|
2015-11-04 19:54:13 -05:00
|
|
|
input#classroom-code-input.form-control(
|
2015-12-08 15:05:08 -05:00
|
|
|
data-i18n="[placeholder]courses.enter_here",
|
2015-11-04 19:54:13 -05:00
|
|
|
placeholder='<enter unlock code here>',
|
|
|
|
value=view.classCode,
|
|
|
|
disabled=view.state==='enrolling')
|
2015-12-08 15:05:08 -05:00
|
|
|
|
2015-11-04 19:54:13 -05:00
|
|
|
if view.state === 'enrolling'
|
|
|
|
.progress.progress-striped.active
|
2015-12-08 15:05:08 -05:00
|
|
|
.progress-bar(style="width: 100%", data-i18n="courses.joining")
|
|
|
|
|
2015-11-04 19:54:13 -05:00
|
|
|
if view.state === 'unknown_error'
|
|
|
|
.alert.alert-danger= view.stateMessage
|
2015-12-08 15:05:08 -05:00
|
|
|
|
2015-11-10 15:08:44 -05:00
|
|
|
- var justJoinedCourseInstance = view.courseInstances.find(function(ci) { return ci.justJoined; });
|
|
|
|
if justJoinedCourseInstance
|
|
|
|
- var course = view.courses.get(justJoinedCourseInstance.get('courseID'));
|
|
|
|
- var classroom = view.classrooms.get(justJoinedCourseInstance.get('classroomID'));
|
|
|
|
if course && classroom
|
|
|
|
.alert.alert-info
|
2015-12-08 15:05:08 -05:00
|
|
|
span.spr(data-i18n="courses.successfully_joined")
|
|
|
|
span.spr "#{classroom.get('name')}"!
|
|
|
|
a(href="/courses/#{course.id}/#{justJoinedCourseInstance.id}")
|
|
|
|
strong
|
|
|
|
span.spr(data-i18n="courses.click_to_start")
|
|
|
|
span "#{course.get('name')}".
|
|
|
|
|
2015-11-04 19:54:13 -05:00
|
|
|
.panel.panel-default
|
|
|
|
.panel-heading
|
2015-12-08 15:05:08 -05:00
|
|
|
.panel-title(data-i18n="courses.my_courses")
|
|
|
|
|
2015-11-05 20:31:11 -05:00
|
|
|
.list-group
|
2015-11-10 15:08:44 -05:00
|
|
|
.list-group-item
|
|
|
|
.row
|
|
|
|
.col-sm-3
|
2015-12-08 15:05:08 -05:00
|
|
|
strong(data-i18n="courses.classroom")
|
2015-11-10 15:08:44 -05:00
|
|
|
.col-sm-3
|
2015-12-08 15:05:08 -05:00
|
|
|
strong(data-i18n="courses.course")
|
2015-11-05 20:31:11 -05:00
|
|
|
for courseInstance in view.courseInstances.models
|
2015-11-09 20:58:40 -05:00
|
|
|
- var classroom = view.classrooms.get(courseInstance.get('classroomID'))
|
|
|
|
- var course = view.courses.get(courseInstance.get('courseID'))
|
|
|
|
if !(classroom && course)
|
|
|
|
- continue;
|
|
|
|
|
2015-11-05 20:31:11 -05:00
|
|
|
.list-group-item
|
|
|
|
.row
|
2015-11-09 20:58:40 -05:00
|
|
|
.col-sm-3
|
|
|
|
if classroom
|
|
|
|
| #{classroom.get('name')}
|
|
|
|
.col-sm-3
|
|
|
|
if course
|
|
|
|
| #{course.get('name')}
|
2015-11-05 20:31:11 -05:00
|
|
|
.col-sm-6
|
2015-12-08 15:05:08 -05:00
|
|
|
a.btn.btn-default.btn-sm(href="/courses/#{course.id}/#{courseInstance.id}", data-i18n="courses.enter")
|
|
|
|
|
2015-11-05 20:31:11 -05:00
|
|
|
.panel.panel-default
|
|
|
|
.panel-heading
|
2015-12-08 15:05:08 -05:00
|
|
|
.panel-title(data-i18n="courses.my_classes")
|
2015-11-05 20:31:11 -05:00
|
|
|
.list-group
|
|
|
|
for classroom in view.classrooms.models
|
|
|
|
.list-group-item
|
|
|
|
.row
|
|
|
|
.col-sm-3= classroom.get('name')
|
2015-12-08 15:05:08 -05:00
|
|
|
.col-sm-9= classroom.get('description')
|