2015-09-03 14:04:40 -04:00
|
|
|
extends /templates/base
|
|
|
|
|
|
|
|
block content
|
2015-12-07 14:11:07 -05:00
|
|
|
|
2016-05-31 16:56:02 -04:00
|
|
|
if me.isTeacher()
|
2016-03-30 19:20:37 -04:00
|
|
|
.alert.alert-danger.text-center
|
|
|
|
// DNT: Temporary
|
|
|
|
h3 ATTENTION TEACHERS:
|
|
|
|
p We are transitioning to a new classroom management system; this page will soon be student-only.
|
|
|
|
a(href="/teachers/classes") Go to teachers area.
|
|
|
|
|
2015-12-07 14:11:07 -05:00
|
|
|
if view.teacherMode
|
2016-03-30 19:20:37 -04:00
|
|
|
a(href="/teachers/classes", data-i18n="courses.back_classrooms")
|
2015-12-07 14:11:07 -05:00
|
|
|
else
|
2015-12-08 15:05:08 -05:00
|
|
|
a(href="/courses", data-i18n="courses.back_courses")
|
2015-12-07 14:11:07 -05:00
|
|
|
br
|
|
|
|
br
|
2015-09-03 14:04:40 -04:00
|
|
|
|
2016-04-13 12:54:24 -04:00
|
|
|
p
|
|
|
|
// TODO: format this text all good and stuff
|
|
|
|
strong
|
|
|
|
if view.courseInstance.get('name')
|
|
|
|
span= view.courseInstance.get('name')
|
|
|
|
else if view.classroom.get('name')
|
|
|
|
span= view.classroom.get('name')
|
|
|
|
else
|
|
|
|
span(data-i18n='courses.unnamed_class')
|
2015-12-01 20:23:33 -05:00
|
|
|
|
2016-04-13 12:54:24 -04:00
|
|
|
if !view.owner.isNew() && view.getOwnerName() && view.courseInstance.get('name') != 'Single Player'
|
|
|
|
span.spl -
|
|
|
|
span.spl(data-i18n='courses.teacher')
|
|
|
|
span.spr :
|
|
|
|
//a(href="/user/#{view.owner.id}") // Don't link to profiles until we improve them
|
|
|
|
span
|
|
|
|
strong= view.getOwnerName()
|
2015-09-03 14:04:40 -04:00
|
|
|
|
2016-04-13 12:54:24 -04:00
|
|
|
h1
|
|
|
|
| #{view.course.get('name')}
|
|
|
|
if view.courseComplete
|
|
|
|
span.spl -
|
|
|
|
span.spl(data-i18n='courses.complete')
|
|
|
|
span !
|
2015-12-08 15:05:08 -05:00
|
|
|
|
2016-04-13 12:54:24 -04:00
|
|
|
p
|
|
|
|
if view.courseInstance.get('description')
|
|
|
|
each line in view.courseInstance.get('description').split('\n')
|
|
|
|
div= line
|
2015-12-02 12:52:52 -05:00
|
|
|
|
2016-04-13 12:54:24 -04:00
|
|
|
if view.courseComplete && !view.teacherMode
|
|
|
|
.jumbotron
|
|
|
|
.row
|
|
|
|
.col-md-6
|
|
|
|
if view.arenaLevel
|
|
|
|
a.btn.btn-lg.btn-success.btn-play-level(data-level-slug=view.arenaLevel.get('slug'), data-level-id=view.arenaLevel.get('original'))
|
|
|
|
h1
|
|
|
|
span(data-i18n='courses.arena')
|
|
|
|
span.spr :
|
|
|
|
span= view.arenaLevel.get('name')
|
|
|
|
p= view.arenaLevel.get('description').replace(/!\[.*?\)/, '')
|
|
|
|
else
|
|
|
|
a.btn.btn-lg.btn-success.disabled
|
|
|
|
h1(data-i18n='courses.arena_soon_title')
|
|
|
|
p
|
|
|
|
span.spr(data-i18n='courses.arena_soon_description')
|
|
|
|
span= view.course.get('name')
|
|
|
|
span .
|
|
|
|
.col-md-6
|
2016-05-18 20:03:49 -04:00
|
|
|
if view.nextCourseInstance && _.contains(view.nextCourseInstance.get('members'), me.id)
|
2016-04-13 12:54:24 -04:00
|
|
|
a.btn.btn-lg.btn-success(href="/courses/#{view.nextCourse.id}/#{view.nextCourseInstance.id}")
|
|
|
|
h1= view.nextCourse.get('name')
|
|
|
|
p= view.nextCourse.get('description')
|
|
|
|
else if view.nextCourse
|
|
|
|
a.btn.btn-lg.btn-success.disabled
|
|
|
|
h1= view.nextCourse.get('name')
|
|
|
|
p.text-uppercase
|
|
|
|
em(data-i18n='courses.not_enrolled1')
|
|
|
|
p(data-i18n='courses.not_enrolled2')
|
|
|
|
else
|
|
|
|
a.btn.btn-lg.btn-success(disabled=!view.nextCourse ? "disabled" : "")
|
|
|
|
h1(data-i18n='courses.next_course')
|
|
|
|
p.text-uppercase
|
|
|
|
em(data-i18n='courses.coming_soon1')
|
|
|
|
p(data-i18n='courses.coming_soon2')
|
2015-12-02 12:52:52 -05:00
|
|
|
|
2016-04-13 12:54:24 -04:00
|
|
|
.available-courses-title(data-i18n='courses.available_levels')
|
|
|
|
table.table.table-striped.table-condensed
|
|
|
|
thead
|
|
|
|
tr
|
|
|
|
th
|
|
|
|
th(data-i18n="clans.status")
|
2016-06-26 16:51:14 -04:00
|
|
|
th(data-i18n="common.type")
|
2016-04-13 12:54:24 -04:00
|
|
|
th(data-i18n="resources.level")
|
|
|
|
th(data-i18n="courses.concepts")
|
|
|
|
tbody
|
|
|
|
- var previousLevelCompleted = true;
|
|
|
|
- var lastLevelCompleted = view.getLastLevelCompleted();
|
|
|
|
- var passedLastCompletedLevel = !lastLevelCompleted;
|
|
|
|
- var levelCount = 0;
|
|
|
|
each level in view.levels.models
|
|
|
|
- var levelStatus = null;
|
2016-06-26 16:51:14 -04:00
|
|
|
- var levelNumber = view.classroom.getLevelNumber(level.get('original'), ++levelCount);
|
2016-04-13 12:54:24 -04:00
|
|
|
if view.userLevelStateMap[me.id]
|
|
|
|
- levelStatus = view.userLevelStateMap[me.id][level.get('original')]
|
2015-09-13 01:01:59 -04:00
|
|
|
tr
|
2016-04-13 12:54:24 -04:00
|
|
|
td
|
|
|
|
if previousLevelCompleted || view.teacherMode || !passedLastCompletedLevel || levelStatus
|
|
|
|
- var i18n = level.get('type') === 'course-ladder' ? 'play.compete' : 'home.play';
|
|
|
|
button.btn.btn-success.btn-play-level(data-level-slug=level.get('slug'), data-i18n=i18n, data-level-id=level.get('original'))
|
|
|
|
td
|
|
|
|
if view.userLevelStateMap[me.id]
|
|
|
|
div= view.userLevelStateMap[me.id][level.get('original')]
|
2016-06-26 16:51:14 -04:00
|
|
|
td #{level.get('practice') ? 'practice' : 'required'}
|
|
|
|
td #{levelNumber}. #{level.get('name').replace('Course: ', '')}
|
2016-04-13 12:54:24 -04:00
|
|
|
td
|
|
|
|
if view.levelConceptMap[level.get('original')]
|
|
|
|
each concept in view.course.get('concepts')
|
|
|
|
if view.levelConceptMap[level.get('original')][concept]
|
|
|
|
span.spr.concept(data-i18n="concepts." + concept)
|
|
|
|
if level.get('original') === lastLevelCompleted
|
|
|
|
- passedLastCompletedLevel = true
|
2016-06-26 16:51:14 -04:00
|
|
|
if !level.get('practice')
|
|
|
|
if view.userLevelStateMap[me.id]
|
|
|
|
- previousLevelCompleted = view.userLevelStateMap[me.id][level.get('original')] === 'complete'
|
|
|
|
else
|
|
|
|
- previousLevelCompleted = false
|