mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-24 08:08:15 -05:00
147 lines
6.2 KiB
Text
147 lines
6.2 KiB
Text
extends /templates/base
|
||
|
||
block content
|
||
|
||
if (noCourseInstance || noCourseInstanceSelected) && course
|
||
h1= course.get('name')
|
||
if noCourseInstance
|
||
p(data-i18n="courses.not_enrolled")
|
||
p
|
||
span.spr(data-i18n="courses.visit_pref")
|
||
a(href="/courses", data-i18n="courses.courses")
|
||
span.spl(data-i18n="courses.visit_suf")
|
||
else if noCourseInstanceSelected
|
||
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
|
||
option(value="#{courseInstance.id}", data-i18n="courses.unnamed")
|
||
.col-md-6
|
||
button.btn.btn-success.btn-select-instance(data-i18n="courses.select")
|
||
else if !course || !courseInstance
|
||
h1(data-i18n="common.loading") 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()
|
||
span.spl.spr - Teacher:
|
||
//a(href="/user/#{view.owner.id}") // Don't link to profiles until we improve them
|
||
span
|
||
strong= view.getOwnerName()
|
||
|
||
h1
|
||
| #{course.get('name')}
|
||
if view.courseComplete
|
||
span.spl - Complete!
|
||
|
||
p
|
||
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") School Name and City
|
||
em.optional-note
|
||
| (
|
||
span(data-i18n="signup.optional") 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") None
|
||
button.btn.btn-info.btn-submit.save-school(type="submit") Save
|
||
.row
|
||
if view.singlePlayerMode && !me.isAnonymous()
|
||
.col-md-6.col-md-offset-3
|
||
a.btn.btn-lg.btn-success(href="/play")
|
||
h1 Play the Campaign
|
||
p You’re ready to take the next step! Explore hundreds of challenging levels, learn advanced programming skills, and compete in multiplayer arenas!
|
||
else if view.singlePlayerMode && me.isAnonymous()
|
||
.col-md-6
|
||
a.btn.btn-lg.btn-success.signup-button
|
||
h1 Create an Account
|
||
p Sign up for a FREE CodeCombat account and gain access to more levels, more programming skills, and more fun!
|
||
.col-md-6
|
||
a.btn.btn-lg.btn-success(href="/play")
|
||
h1 Preview Campaign
|
||
p Take a sneak peek at all that CodeCombat has to offer before signing up for your FREE account.
|
||
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 Arena
|
||
| :
|
||
span.spl= view.arenaLevel.name
|
||
p= view.arenaLevel.description.replace(/!\[.*?\)/, '')
|
||
else
|
||
a.btn.btn-lg.btn-success.disabled
|
||
h1 Arena Coming Soon
|
||
p We are working on a multiplayer arena for classrooms at the end of #{course.get('name')}.
|
||
.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
|
||
em NOT ENROLLED
|
||
p Ask your teacher to enroll you in the next course.
|
||
else
|
||
a.btn.btn-lg.btn-success(disabled=!view.nextCourse ? "disabled" : "")
|
||
h1 Next Course
|
||
p
|
||
em COMING SOON
|
||
p We are hard at work making more courses for you!
|
||
|
||
.available-courses-title Available Levels
|
||
table.table.table-striped.table-condensed
|
||
thead
|
||
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)
|