codecombat/app/templates/courses/course-details.jade

162 lines
6.5 KiB
Text
Raw Normal View History

extends /templates/base
block content
if view.teacherMode
a(href="/courses/teachers", data-i18n="courses.back_classrooms")
else
a(href="/courses", data-i18n="courses.back_courses")
br
br
if (noCourseInstance || noCourseInstanceSelected) && course
h1= course.get('name')
if noCourseInstance
2015-09-25 15:51:51 -04:00
p(data-i18n="courses.not_enrolled")
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")
else if noCourseInstanceSelected
2015-09-25 15:51:51 -04:00
p(data-i18n="courses.select_class")
.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")
.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
h1(data-i18n="common.loading")
else
p
// TODO: format this text all good and stuff
strong
if courseInstance.get('name')
span= courseInstance.get('name')
else if view.classroom.get('name')
span= view.classroom.get('name')
else
span(data-i18n='courses.unnamed_class')
if !view.owner.isNew() && view.getOwnerName() && 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
2015-10-27 20:47:48 -04:00
strong= view.getOwnerName()
h1
| #{course.get('name')}
if view.courseComplete
span.spl -
span.spl(data-i18n='courses.complete')
span !
p
2015-09-13 01:01:59 -04:00
if courseInstance.get('description')
each line in courseInstance.get('description').split('\n')
div= line
if view.courseComplete && !view.teacherMode
.jumbotron
if promptForSchool
.row
.col-md-6.col-md-offset-3
form.form#school-form
.form-group
label.control-label(for="course-complete-school-input")
span.spr(data-i18n="signup.school_name")
em.optional-note
| (
span(data-i18n="signup.optional")
| ):
.input-border
input#course-complete-school-input.input-large.form-control(name="schoolName", data-i18n="[placeholder]signup.school_name_placeholder")
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')
.row
if view.singlePlayerMode && !me.isAnonymous()
.col-md-6.col-md-offset-3
a.btn.btn-lg.btn-success(href="/play")
h1(data-i18n='courses.play_campaign_title')
p(data-i18n='courses.play_campaign_description')
else if view.singlePlayerMode && me.isAnonymous()
.col-md-6
a.btn.btn-lg.btn-success.signup-button
h1(data-i18n='courses.create_account_title')
p(data-i18n='courses.create_account_description')
.col-md-6
a.btn.btn-lg.btn-success(href="/play")
h1(data-i18n='courses.preview_campaign_title')
p(data-i18n='courses.preview_campaign_description')
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
span(data-i18n='courses.arena')
span.spr :
span= view.arenaLevel.name
p= view.arenaLevel.description.replace(/!\[.*?\)/, '')
else
a.btn.btn-lg.btn-success.disabled
h1(data-i18n='courses.arena_soon_title') Arena Coming Soon
p
span.spr(data-i18n='courses.arena_soon_description')
span= course.get('name')
span .
.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')
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')
.available-courses-title(data-i18n='courses.available_levels')
table.table.table-striped.table-condensed
thead
2015-09-13 01:01:59 -04:00
tr
th
th(data-i18n="clans.status")
th(data-i18n="resources.level")
th(data-i18n="courses.concepts")
tbody
if campaign
- var lastLevelCompleted = true;
- var levelCount = 0;
each level, levelID in campaign.get('levels')
tr
td
if lastLevelCompleted || view.teacherMode
- 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]
- lastLevelCompleted = userLevelStateMap[me.id][levelID] === 'complete'
else
- lastLevelCompleted = false
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)