2015-11-03 19:41:06 -05:00
|
|
|
extends /templates/base
|
|
|
|
|
|
|
|
block content
|
2015-11-21 14:38:34 -05:00
|
|
|
.pull-right
|
2015-11-30 19:43:24 -05:00
|
|
|
a(href="/courses/teachers") Teachers, click here!
|
|
|
|
br
|
2015-11-03 19:41:06 -05:00
|
|
|
|
2015-11-21 14:38:34 -05:00
|
|
|
#main-content
|
|
|
|
if me.isAnonymous()
|
2015-11-22 03:08:46 -05:00
|
|
|
|
|
|
|
h1.text-center Adventurers, welcome to Courses!
|
|
|
|
|
2015-11-21 14:38:34 -05:00
|
|
|
.text-center
|
|
|
|
p
|
|
|
|
h3 Ready to play?
|
|
|
|
p
|
|
|
|
button#start-new-game-btn.btn.btn-default Start New Game
|
|
|
|
p - OR -
|
|
|
|
p
|
|
|
|
button#log-in-btn.btn.btn-default(data-i18n="login.log_in")
|
|
|
|
|
|
|
|
h3#play-now-to-learn-header.text-center PLAY NOW TO LEARN
|
|
|
|
ul
|
|
|
|
li basic syntax to control your character
|
|
|
|
li while loops to solve pesky puzzles
|
|
|
|
li strings & variables to customize actions
|
|
|
|
li how to defeat an ogre (important life skills!)
|
2015-11-22 03:08:46 -05:00
|
|
|
|
|
|
|
else
|
|
|
|
|
2015-11-23 11:46:08 -05:00
|
|
|
- var showHOCComplete = false;
|
2015-11-29 17:18:24 -05:00
|
|
|
if view.hocCourseInstance
|
|
|
|
- var course = view.courses.get(view.hocCourseInstance.get('courseID'));
|
|
|
|
- var campaign = view.campaigns.get(course.get('campaignID'));
|
|
|
|
- var stats = campaign.statsForSessions(view.hocCourseInstance.sessions);
|
2015-11-29 18:26:42 -05:00
|
|
|
- showHOCComplete = stats.levels.done && !view.classrooms.size();
|
2015-11-23 11:46:08 -05:00
|
|
|
|
|
|
|
.text-center
|
|
|
|
if !showHOCComplete
|
|
|
|
h1 Welcome to your Courses page!
|
|
|
|
else
|
|
|
|
h1 Amazing! You've completed the Hour of Code course!
|
|
|
|
h2 Ready for more? Play the campaign mode!
|
2015-11-29 17:23:55 -05:00
|
|
|
ul.text-left
|
2015-11-23 11:46:08 -05:00
|
|
|
li Use gems to unlock new items!
|
|
|
|
li Play through brand new worlds and challenges
|
|
|
|
li Learn even more programming!
|
2015-11-29 17:23:55 -05:00
|
|
|
a.btn.btn-lg.btn-success(href="/play") Play Now
|
2015-11-22 03:08:46 -05:00
|
|
|
|
2015-11-29 18:26:42 -05:00
|
|
|
if view.hocCourseInstance && !view.classrooms.size()
|
2015-11-29 13:27:40 -05:00
|
|
|
h3 Saved Games
|
2015-11-22 03:08:46 -05:00
|
|
|
hr
|
2015-11-21 14:38:34 -05:00
|
|
|
|
2015-11-22 03:08:46 -05:00
|
|
|
.course-instance-entry
|
2015-11-29 13:27:40 -05:00
|
|
|
h3
|
2015-11-22 03:08:46 -05:00
|
|
|
span.spr Hour of Code: Course 1
|
2015-11-23 12:52:15 -05:00
|
|
|
span.spr= (me.get('aceConfig') || {}).language === 'python' ? 'Python' : 'JavaScript'
|
2015-11-22 03:08:46 -05:00
|
|
|
small
|
|
|
|
a#change-language-link change language
|
2015-11-29 13:27:40 -05:00
|
|
|
+course-instance-body(view.hocCourseInstance)
|
|
|
|
.clearfix
|
2015-11-23 11:46:08 -05:00
|
|
|
|
2015-11-29 17:18:24 -05:00
|
|
|
else if view.classrooms.size()
|
2015-11-29 13:27:40 -05:00
|
|
|
h3.text-uppercase My Classes
|
|
|
|
hr
|
|
|
|
|
|
|
|
for classroom in view.classrooms.models
|
2015-11-29 18:13:23 -05:00
|
|
|
- var justAdded = classroom.id === view.classroomJustAdded;
|
|
|
|
- var classroomClass = justAdded ? 'just-added' : '';
|
|
|
|
if justAdded
|
|
|
|
#just-added-text.text-center Class successfully added!
|
2015-11-25 18:13:43 -05:00
|
|
|
|
|
|
|
//- sigh
|
|
|
|
div(class=classroomClass)
|
2015-11-29 13:27:40 -05:00
|
|
|
h3
|
2015-11-23 11:46:08 -05:00
|
|
|
span.spr= classroom.get('name')
|
|
|
|
span.spr (#{(view.hocCourseInstance.get('aceConfig') || {}).language === 'python' ? 'Python' : 'JavaScript'})
|
|
|
|
a(href="/courses/classroom/"+classroom.id) view class
|
|
|
|
|
|
|
|
- var courseInstances = view.courseInstances.where({classroomID: classroom.id});
|
|
|
|
for courseInstance in courseInstances
|
|
|
|
|
2015-11-29 13:27:40 -05:00
|
|
|
.course-instance-entry
|
2015-11-23 11:46:08 -05:00
|
|
|
- var course = view.courses.get(courseInstance.get('courseID'));
|
2015-11-29 13:27:40 -05:00
|
|
|
h3
|
2015-11-23 11:46:08 -05:00
|
|
|
span.spr= course.get('name')
|
|
|
|
small
|
2015-11-29 15:25:59 -05:00
|
|
|
a(href="/courses/"+courseInstance.get('courseID')+'/'+courseInstance.id+'#levels') view levels
|
2015-11-29 13:27:40 -05:00
|
|
|
+course-instance-body(courseInstance)
|
|
|
|
.clearfix
|
2015-11-23 11:46:08 -05:00
|
|
|
|
2015-11-29 18:41:57 -05:00
|
|
|
else
|
|
|
|
.text-center
|
|
|
|
button#start-new-game-btn.btn.btn-success.btn-lg Start New Game
|
|
|
|
|
2015-11-29 13:27:40 -05:00
|
|
|
h3.text-uppercase Join A Class
|
|
|
|
hr
|
|
|
|
|
|
|
|
form#join-class-form.form-inline
|
2015-11-23 11:46:08 -05:00
|
|
|
.help-block
|
|
|
|
em Ask your teacher if you have a CodeCombat class code! If so, enter it below:
|
2015-11-29 13:27:40 -05:00
|
|
|
.form-group
|
2015-11-29 18:13:23 -05:00
|
|
|
input#class-code-input.form-control(placeholder="<Enter Class Code>", value=view.classCode)
|
2015-11-29 13:27:40 -05:00
|
|
|
input#join-class-button.btn.btn-default(type="submit" value="Join")
|
|
|
|
|
|
|
|
if view.state === 'enrolling'
|
|
|
|
.progress.progress-striped.active
|
|
|
|
.progress-bar(style="width: 100%") Joining class
|
|
|
|
|
2015-11-29 18:13:23 -05:00
|
|
|
if view.errorMessage
|
|
|
|
.alert.alert-danger= view.errorMessage
|
2015-11-23 11:46:08 -05:00
|
|
|
|
2015-11-22 03:08:46 -05:00
|
|
|
|
2015-11-21 14:38:34 -05:00
|
|
|
#begin-hoc-area.hide
|
2015-11-29 13:27:40 -05:00
|
|
|
h3.text-center(data-i18n="common.loading")
|
2015-11-21 14:38:34 -05:00
|
|
|
.progress.progress-striped.active
|
2015-11-22 03:08:46 -05:00
|
|
|
.progress-bar(style="width: 100%")
|
|
|
|
|
2015-11-23 11:46:08 -05:00
|
|
|
|
|
|
|
mixin course-instance-body(courseInstance)
|
|
|
|
- var course = view.courses.get(courseInstance.get('courseID'));
|
2015-11-29 13:27:40 -05:00
|
|
|
- var campaign = view.campaigns.get(course.get('campaignID'));
|
2015-11-29 17:18:24 -05:00
|
|
|
- var stats = campaign.statsForSessions(courseInstance.sessions);
|
|
|
|
if stats.levels.done
|
2015-11-23 11:46:08 -05:00
|
|
|
.text-success
|
|
|
|
span.glyphicon.glyphicon-ok
|
|
|
|
span.spl Course Complete!
|
|
|
|
.pull-right
|
2015-11-29 17:18:24 -05:00
|
|
|
if stats.levels.done
|
|
|
|
- var arenaLevel = stats.levels.arena;
|
2015-11-29 15:25:59 -05:00
|
|
|
if arenaLevel
|
2015-11-29 17:18:24 -05:00
|
|
|
- var arenaURL = "/play/ladder/"+arenaLevel.slug+"/course/"+courseInstance.id;
|
2015-11-29 15:25:59 -05:00
|
|
|
a.btn.btn-warning.btn-lg(href=arenaURL)
|
|
|
|
| Play Arena
|
|
|
|
else
|
|
|
|
a.btn.btn-default.btn-lg(disabled=true) Course Complete
|
2015-11-29 13:27:40 -05:00
|
|
|
else if courseInstance.sessions.size()
|
2015-11-29 17:18:24 -05:00
|
|
|
- var lastLevel = stats.levels.lastPlayed;
|
|
|
|
- var levelURL = "/play/level/"+lastLevel.slug+"?course="+courseInstance.get('courseID')+"&course-instance="+courseInstance.id;
|
2015-11-23 11:46:08 -05:00
|
|
|
a.btn.btn-success.btn-lg(href=levelURL)
|
|
|
|
| Continue
|
|
|
|
else
|
2015-11-29 17:18:24 -05:00
|
|
|
- var firstLevel = stats.levels.first;
|
|
|
|
- var levelURL = "/play/level/"+firstLevel.slug+"?course="+courseInstance.get('courseID')+"&course-instance="+courseInstance.id;
|
2015-11-23 11:46:08 -05:00
|
|
|
a.btn.btn-info.btn-lg(href=levelURL)
|
2015-11-25 18:13:43 -05:00
|
|
|
| Start
|
2015-11-29 17:18:24 -05:00
|
|
|
|
|
|
|
div
|
|
|
|
span Playtime
|
|
|
|
span.spr :
|
|
|
|
span= moment.duration(stats.playtime, 'seconds').humanize()
|
|
|
|
|
|
|
|
if stats.levels.lastPlayed
|
|
|
|
div
|
|
|
|
span Last Level
|
|
|
|
span.spr :
|
|
|
|
span= stats.levels.lastPlayed.name
|
|
|
|
|
|
|
|
.progress
|
|
|
|
.progress-bar(style="width:"+stats.levels.pctDone)= stats.levels.pctDone
|
|
|
|
|
2015-11-30 19:43:24 -05:00
|
|
|
|