2015-09-03 14:04:40 -04:00
|
|
|
extends /templates/base
|
|
|
|
|
|
|
|
block content
|
2015-12-07 14:11:07 -05:00
|
|
|
|
|
|
|
if view.teacherMode
|
2015-12-08 15:05:08 -05:00
|
|
|
a(href="/courses/teachers", 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
|
|
|
|
2015-09-23 19:27:45 -04:00
|
|
|
if (noCourseInstance || noCourseInstanceSelected) && course
|
|
|
|
h1= course.get('name')
|
|
|
|
if noCourseInstance
|
2015-09-25 15:51:51 -04:00
|
|
|
p(data-i18n="courses.not_enrolled")
|
2015-09-23 19:27:45 -04:00
|
|
|
p
|
2015-09-25 15:51:51 -04:00
|
|
|
span.spr(data-i18n="courses.visit_pref")
|
|
|
|
a(href="/courses", data-i18n="courses.courses")
|
|
|
|
span.spl(data-i18n="courses.visit_suf")
|
2015-09-23 19:27:45 -04:00
|
|
|
else if noCourseInstanceSelected
|
2015-09-25 15:51:51 -04:00
|
|
|
p(data-i18n="courses.select_class")
|
2015-09-23 19:27:45 -04:00
|
|
|
.container-fluid
|
|
|
|
.row
|
|
|
|
.col-md-6
|
|
|
|
select.form-control.select-instance
|
|
|
|
each courseInstance in courseInstances
|
|
|
|
if courseInstance.get('name')
|
|
|
|
option(value="#{courseInstance.id}")= courseInstance.get('name')
|
|
|
|
else
|
2015-09-25 15:51:51 -04:00
|
|
|
option(value="#{courseInstance.id}", data-i18n="courses.unnamed")
|
2015-09-23 19:27:45 -04:00
|
|
|
.col-md-6
|
2015-09-25 15:51:51 -04:00
|
|
|
button.btn.btn-success.btn-select-instance(data-i18n="courses.select")
|
2015-09-13 01:01:59 -04:00
|
|
|
else if !course || !courseInstance
|
2015-12-08 15:05:08 -05:00
|
|
|
h1(data-i18n="common.loading")
|
2015-09-03 14:04:40 -04:00
|
|
|
else
|
2015-12-01 20:23:33 -05:00
|
|
|
p
|
|
|
|
// TODO: format this text all good and stuff
|
|
|
|
strong
|
2015-11-09 21:08:39 -05:00
|
|
|
if courseInstance.get('name')
|
2015-12-01 20:23:33 -05:00
|
|
|
span= courseInstance.get('name')
|
2015-11-09 21:08:39 -05:00
|
|
|
else if view.classroom.get('name')
|
2015-12-01 20:23:33 -05:00
|
|
|
span= view.classroom.get('name')
|
2015-11-09 21:08:39 -05:00
|
|
|
else
|
|
|
|
span(data-i18n='courses.unnamed_class')
|
2015-12-01 20:23:33 -05:00
|
|
|
|
2015-12-04 14:04:18 -05:00
|
|
|
if !view.owner.isNew() && view.getOwnerName() && courseInstance.get('name') != 'Single Player'
|
2015-12-08 15:05:08 -05:00
|
|
|
span.spl -
|
|
|
|
span.spl(data-i18n='courses.teacher')
|
|
|
|
span.spr :
|
2015-12-02 12:52:52 -05:00
|
|
|
//a(href="/user/#{view.owner.id}") // Don't link to profiles until we improve them
|
|
|
|
span
|
2015-10-27 20:47:48 -04:00
|
|
|
strong= view.getOwnerName()
|
2015-09-03 14:04:40 -04:00
|
|
|
|
2015-12-01 20:23:33 -05:00
|
|
|
h1
|
|
|
|
| #{course.get('name')}
|
|
|
|
if view.courseComplete
|
2015-12-08 15:05:08 -05:00
|
|
|
span.spl -
|
|
|
|
span.spl(data-i18n='courses.complete')
|
|
|
|
span !
|
|
|
|
|
2015-09-03 14:04:40 -04:00
|
|
|
p
|
2015-09-13 01:01:59 -04:00
|
|
|
if courseInstance.get('description')
|
|
|
|
each line in courseInstance.get('description').split('\n')
|
|
|
|
div= line
|
2015-12-02 12:52:52 -05:00
|
|
|
|
|
|
|
if view.courseComplete && !view.teacherMode
|
|
|
|
.jumbotron
|
2015-12-02 13:59:55 -05:00
|
|
|
if promptForSchool
|
|
|
|
.row
|
|
|
|
.col-md-6.col-md-offset-3
|
|
|
|
form.form#school-form
|
|
|
|
.form-group
|
|
|
|
label.control-label(for="course-complete-school-input")
|
2015-12-08 15:05:08 -05:00
|
|
|
span.spr(data-i18n="signup.school_name")
|
2015-12-02 13:59:55 -05:00
|
|
|
em.optional-note
|
|
|
|
| (
|
2015-12-08 15:05:08 -05:00
|
|
|
span(data-i18n="signup.optional")
|
2015-12-02 13:59:55 -05:00
|
|
|
| ):
|
|
|
|
.input-border
|
|
|
|
input#course-complete-school-input.input-large.form-control(name="schoolName", data-i18n="[placeholder]signup.school_name_placeholder")
|
2015-12-08 15:05:08 -05:00
|
|
|
button.btn.btn-primary.btn-submit.no-school(type="submit", data-i18n='courses.none')
|
|
|
|
button.btn.btn-info.btn-submit.save-school(type="submit", data-i18n='courses.save')
|
2015-12-02 12:52:52 -05:00
|
|
|
.row
|
|
|
|
if view.singlePlayerMode && !me.isAnonymous()
|
2015-12-02 13:59:55 -05:00
|
|
|
.col-md-6.col-md-offset-3
|
2015-12-02 12:52:52 -05:00
|
|
|
a.btn.btn-lg.btn-success(href="/play")
|
2015-12-08 15:05:08 -05:00
|
|
|
h1(data-i18n='courses.play_campaign_title')
|
|
|
|
p(data-i18n='courses.play_campaign_description')
|
2015-12-02 12:52:52 -05:00
|
|
|
else if view.singlePlayerMode && me.isAnonymous()
|
|
|
|
.col-md-6
|
|
|
|
a.btn.btn-lg.btn-success.signup-button
|
2015-12-08 15:05:08 -05:00
|
|
|
h1(data-i18n='courses.create_account_title')
|
|
|
|
p(data-i18n='courses.create_account_description')
|
2015-12-02 12:52:52 -05:00
|
|
|
.col-md-6
|
|
|
|
a.btn.btn-lg.btn-success(href="/play")
|
2015-12-08 15:05:08 -05:00
|
|
|
h1(data-i18n='courses.preview_campaign_title')
|
|
|
|
p(data-i18n='courses.preview_campaign_description')
|
2015-12-02 12:52:52 -05:00
|
|
|
else if !view.singlePlayerMode
|
|
|
|
.col-md-6
|
|
|
|
if view.arenaLevel
|
|
|
|
a.btn.btn-lg.btn-success.btn-play-level(data-level-slug=view.arenaLevel.slug, data-level-id=view.arenaLevel.original)
|
|
|
|
h1
|
2015-12-08 15:05:08 -05:00
|
|
|
span(data-i18n='courses.arena')
|
|
|
|
span.spr :
|
|
|
|
span= view.arenaLevel.name
|
2015-12-02 12:52:52 -05:00
|
|
|
p= view.arenaLevel.description.replace(/!\[.*?\)/, '')
|
|
|
|
else
|
|
|
|
a.btn.btn-lg.btn-success.disabled
|
2015-12-08 15:58:53 -05:00
|
|
|
h1(data-i18n='courses.arena_soon_title')
|
2015-12-08 15:05:08 -05:00
|
|
|
p
|
|
|
|
span.spr(data-i18n='courses.arena_soon_description')
|
|
|
|
span= course.get('name')
|
|
|
|
span .
|
2015-12-02 12:52:52 -05:00
|
|
|
.col-md-6
|
|
|
|
if view.nextCourseInstance
|
|
|
|
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')
|
2015-12-08 15:05:08 -05:00
|
|
|
p.text-uppercase
|
|
|
|
em(data-i18n='courses.not_enrolled1')
|
|
|
|
p(data-i18n='courses.not_enrolled2')
|
2015-12-02 12:52:52 -05:00
|
|
|
else
|
|
|
|
a.btn.btn-lg.btn-success(disabled=!view.nextCourse ? "disabled" : "")
|
2015-12-08 15:05:08 -05:00
|
|
|
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
|
|
|
|
2015-12-08 15:05:08 -05:00
|
|
|
.available-courses-title(data-i18n='courses.available_levels')
|
2015-12-03 19:20:53 -05:00
|
|
|
table.table.table-striped.table-condensed
|
|
|
|
thead
|
2015-09-13 01:01:59 -04:00
|
|
|
tr
|
2015-12-03 19:20:53 -05:00
|
|
|
th
|
|
|
|
th(data-i18n="clans.status")
|
|
|
|
th(data-i18n="resources.level")
|
|
|
|
th(data-i18n="courses.concepts")
|
|
|
|
tbody
|
|
|
|
if campaign
|
2015-12-11 15:59:53 -05:00
|
|
|
- var previousLevelCompleted = true;
|
|
|
|
- var lastLevelCompleted = view.getLastLevelCompleted();
|
|
|
|
- var passedLastCompletedLevel = false;
|
2015-12-03 19:20:53 -05:00
|
|
|
- var levelCount = 0;
|
|
|
|
each level, levelID in campaign.get('levels')
|
2015-12-11 15:59:53 -05:00
|
|
|
- var levelStatus = null;
|
|
|
|
if userLevelStateMap[me.id]
|
|
|
|
- levelStatus = userLevelStateMap[me.id][levelID]
|
2015-12-03 19:20:53 -05:00
|
|
|
tr
|
|
|
|
td
|
2015-12-11 15:59:53 -05:00
|
|
|
if previousLevelCompleted || view.teacherMode || !passedLastCompletedLevel || levelStatus
|
2015-12-03 19:20:53 -05:00
|
|
|
- var i18n = level.type === 'course-ladder' ? 'play.compete' : 'home.play';
|
|
|
|
button.btn.btn-success.btn-play-level(data-level-slug=level.slug, data-i18n=i18n, data-level-id=levelID)
|
|
|
|
td
|
|
|
|
if userLevelStateMap[me.id]
|
|
|
|
div= userLevelStateMap[me.id][levelID]
|
2015-12-11 15:59:53 -05:00
|
|
|
- previousLevelCompleted = userLevelStateMap[me.id][levelID] === 'complete'
|
2015-12-03 19:20:53 -05:00
|
|
|
else
|
2015-12-11 15:59:53 -05:00
|
|
|
- previousLevelCompleted = false
|
2015-12-03 19:20:53 -05:00
|
|
|
td= ++levelCount + '. ' + level.name.replace('Course: ', '')
|
|
|
|
td
|
|
|
|
if levelConceptMap[levelID]
|
|
|
|
each concept in course.get('concepts')
|
|
|
|
if levelConceptMap[levelID][concept]
|
|
|
|
span.spr.concept(data-i18n="concepts." + concept)
|
2015-12-11 15:59:53 -05:00
|
|
|
if levelID === lastLevelCompleted
|
|
|
|
- passedLastCompletedLevel = true
|