2016-03-30 16:57:19 -04:00
|
|
|
extends /templates/base-flat
|
|
|
|
|
|
|
|
block page_nav
|
|
|
|
include ./teacher-dashboard-nav.jade
|
|
|
|
|
|
|
|
block content
|
2016-03-30 19:20:37 -04:00
|
|
|
if !me.isTeacher() && !view.classrooms.size()
|
|
|
|
.access-restricted.container.text-center.m-y-3
|
|
|
|
h5(data-i18n='teacher.access_restricted')
|
|
|
|
p(data-i18n='teacher.teacher_account_required')
|
|
|
|
if me.isAnonymous()
|
|
|
|
.login-button.btn.btn-lg.btn-primary(data-i18n='login.log_in')
|
2016-06-08 09:24:59 -04:00
|
|
|
button.btn.btn-lg.btn-primary-alt.create-teacher-btn(data-event-action="Teachers Classes Create Teacher Account", data-i18n='teacher.create_teacher_account')
|
2016-03-30 19:20:37 -04:00
|
|
|
else
|
2016-06-08 09:24:59 -04:00
|
|
|
button.btn.btn-lg.btn-primary.update-teacher-btn(data-event-action="Teachers Classes Convert Teacher Account", data-i18n="teachers_quote.convert_account_title")
|
2016-03-30 19:20:37 -04:00
|
|
|
button#logout-button.btn.btn-lg.btn-primary-alt(data-i18n="login.log_out")
|
2016-06-08 09:24:59 -04:00
|
|
|
|
2016-06-15 16:09:43 -04:00
|
|
|
.container
|
|
|
|
.teacher-account-blurb.text-center.col-xs-6.col-xs-offset-3.m-y-3
|
|
|
|
h5(data-i18n='teacher.what_is_a_teacher_account')
|
|
|
|
p(data-i18n='teacher.teacher_account_explanation')
|
2016-06-08 09:24:59 -04:00
|
|
|
|
2016-03-30 19:20:37 -04:00
|
|
|
else
|
|
|
|
if !me.isTeacher()
|
|
|
|
.alert.alert-danger.text-center
|
|
|
|
.container
|
|
|
|
// DNT: Temporary
|
|
|
|
h3 ATTENTION: Please upgrade your account to a Teacher Account.
|
|
|
|
p
|
|
|
|
| We are transitioning to a new improved classroom management system for instructors.
|
2016-06-08 09:24:59 -04:00
|
|
|
| Please convert your account to ensure you retain access to your classrooms.
|
|
|
|
button.btn.btn-primary.btn-lg.update-teacher-btn(data-event-action="Teachers Classes Convert Teacher Account Temp") Upgrade to teacher account
|
|
|
|
|
2016-03-30 19:20:37 -04:00
|
|
|
.container
|
|
|
|
h3(data-i18n='teacher.current_classes')
|
2016-06-08 09:24:59 -04:00
|
|
|
|
2016-03-30 19:20:37 -04:00
|
|
|
.classes.container
|
|
|
|
// Loop each class
|
|
|
|
each classroom in view.classrooms.models
|
|
|
|
unless classroom.get('archived')
|
|
|
|
+classRow(classroom)
|
2016-06-08 09:24:59 -04:00
|
|
|
|
2016-03-30 19:20:37 -04:00
|
|
|
+createClassButton
|
2016-06-08 09:24:59 -04:00
|
|
|
|
2016-03-30 19:20:37 -04:00
|
|
|
- var archivedClassrooms = view.classrooms.where({archived: true});
|
|
|
|
if _.size(archivedClassrooms)
|
|
|
|
.container
|
|
|
|
h3(data-i18n='teacher.archived_classes')
|
|
|
|
p(data-i18n='teacher.archived_classes_blurb')
|
2016-06-08 09:24:59 -04:00
|
|
|
|
2016-03-30 19:20:37 -04:00
|
|
|
.classes.container
|
|
|
|
each classroom in archivedClassrooms
|
2016-03-30 18:55:20 -04:00
|
|
|
+archivedClassRow(classroom)
|
2016-06-08 09:24:59 -04:00
|
|
|
|
2016-03-30 16:57:19 -04:00
|
|
|
mixin classRow(classroom)
|
|
|
|
.class.row
|
2016-07-26 16:11:51 -04:00
|
|
|
.class-details-col
|
2016-03-30 16:57:19 -04:00
|
|
|
.text-h4.semibold
|
|
|
|
= classroom.get('name')
|
|
|
|
.language.small
|
|
|
|
span(data-i18n='teacher.language')
|
|
|
|
| :
|
|
|
|
span.language-name
|
|
|
|
= classroom.capitalLanguage
|
|
|
|
.student-count.small
|
|
|
|
span(data-i18n='teacher.students')
|
|
|
|
| :
|
|
|
|
span
|
|
|
|
= classroom.get('members').length
|
|
|
|
.class-links
|
2016-06-08 09:24:59 -04:00
|
|
|
a.view-class-btn.text-h6(data-i18n='teacher.view_class' data-classroom-id=classroom.id data-event-action="Teachers Classes View Class Link")
|
|
|
|
a.edit-classroom.text-h6(data-i18n='teacher.edit_class_settings' data-classroom-id=classroom.id data-event-action="Teachers Classes Edit Class Started")
|
|
|
|
a.archive-classroom.text-h6(data-i18n='teacher.archive_class' data-classroom-id=classroom.id data-event-action="Teachers Classes Archive Class")
|
2016-03-30 16:57:19 -04:00
|
|
|
|
2016-07-26 16:11:51 -04:00
|
|
|
.flex-right
|
|
|
|
.progress-col
|
|
|
|
if classroom.get('members').length == 0
|
|
|
|
+addStudentsButton(classroom)
|
|
|
|
else
|
|
|
|
- var courses = classroom.get('courses').map(function(c) { return view.courses.get(c._id); });
|
|
|
|
- var courseLabelsArray = view.helper.courseLabelsArray(courses);
|
|
|
|
each trimCourse, index in classroom.get('courses') || []
|
|
|
|
- var course = view.courses.get(trimCourse._id);
|
|
|
|
if view.courseInstances.findWhere({ classroomID: classroom.id, courseID: course.id })
|
|
|
|
- var label = courseLabelsArray[index];
|
|
|
|
+progressDot(classroom, course, label)
|
|
|
|
.view-class-arrow
|
|
|
|
a.view-class-arrow-inner.glyphicon.glyphicon-chevron-right.view-class-btn(data-classroom-id=classroom.id data-event-action="Teachers Classes View Class Chevron")
|
2016-03-30 16:57:19 -04:00
|
|
|
|
|
|
|
|
|
|
|
mixin addStudentsButton(classroom)
|
|
|
|
.add-students
|
|
|
|
.text-center
|
2016-08-19 18:06:25 -04:00
|
|
|
div.small-details(data-i18n='teacher.no_students_yet_view_class')
|
2016-06-08 09:24:59 -04:00
|
|
|
|
2016-03-30 16:57:19 -04:00
|
|
|
mixin createClassButton
|
|
|
|
.create-class
|
|
|
|
.text-center
|
|
|
|
a.create-classroom-btn.btn.btn-lg.btn-primary(data-i18n='teacher.create_new_class')
|
|
|
|
| Create a New Class
|
|
|
|
|
2016-07-17 04:12:58 -04:00
|
|
|
mixin progressDot(classroom, course, label)
|
2016-03-30 16:57:19 -04:00
|
|
|
//- TODO: inefficient. Cache this in the view?
|
|
|
|
- courseInstance = view.courseInstances.findWhere({ courseID: course.id, classroomID: classroom.id })
|
|
|
|
- var total = classroom.get('members').length
|
|
|
|
- var complete = 0;
|
|
|
|
- var dotClass = '';
|
2016-03-30 19:20:37 -04:00
|
|
|
- var started = 0;
|
2016-03-30 16:57:19 -04:00
|
|
|
if courseInstance
|
|
|
|
- complete = courseInstance.numCompleted
|
2016-05-20 17:52:04 -04:00
|
|
|
- started = courseInstance.started
|
2016-03-30 19:20:37 -04:00
|
|
|
- dotClass = complete === total ? 'forest' : started ? 'gold' : '';
|
2016-06-08 09:24:59 -04:00
|
|
|
- var progressDotContext = {total: total, complete: complete};
|
2016-03-30 16:57:19 -04:00
|
|
|
.progress-dot(class=dotClass, data-title=view.progressDotTemplate(progressDotContext))
|
2016-07-17 04:12:58 -04:00
|
|
|
+progressDotLabel(label)
|
2016-03-30 16:57:19 -04:00
|
|
|
|
2016-07-17 04:12:58 -04:00
|
|
|
mixin progressDotLabel(label)
|
2016-07-26 16:11:51 -04:00
|
|
|
.dot-label.text-h6= label
|
2016-03-30 16:57:19 -04:00
|
|
|
|
|
|
|
mixin archivedClassRow(classroom)
|
|
|
|
.class.row
|
|
|
|
.col-xs-10
|
|
|
|
span
|
|
|
|
= classroom.get('name')
|
|
|
|
.col-xs-2
|
|
|
|
.class-links.pull-right
|
|
|
|
a.unarchive-classroom.text-h6(data-i18n='teacher.unarchive_class' data-classroom-id=classroom.id)
|