2015-11-03 19:41:06 -05:00
|
|
|
extends /templates/base
|
|
|
|
|
|
|
|
block content
|
2015-11-21 14:38:34 -05:00
|
|
|
.pull-right
|
|
|
|
a(href="/teachers") Teachers, click here!
|
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;
|
|
|
|
if view.hocCourseInstance
|
|
|
|
- var campaign = view.campaigns.get(view.hocCourseInstance.get('CampaignID'));
|
|
|
|
- showHOCComplete = campaign.sessions.allDone();
|
|
|
|
|
|
|
|
.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!
|
|
|
|
ul
|
|
|
|
li Use gems to unlock new items!
|
|
|
|
li Play through brand new worlds and challenges
|
|
|
|
li Learn even more programming!
|
|
|
|
a.btn.btn-lg.btn-success(href="/play")
|
2015-11-22 03:08:46 -05:00
|
|
|
|
|
|
|
if view.hocCourseInstance
|
|
|
|
h2 Saved Games
|
|
|
|
hr
|
2015-11-21 14:38:34 -05:00
|
|
|
|
2015-11-22 03:08:46 -05:00
|
|
|
.course-instance-entry
|
|
|
|
h2
|
|
|
|
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-23 11:46:08 -05:00
|
|
|
+course-instance-body(hocCourseInstance)
|
|
|
|
|
|
|
|
if view.classrooms.size()
|
|
|
|
h2 My Classes
|
|
|
|
for classroom in view.classrooms
|
|
|
|
- var classroomClass = classroom.justAdded ? 'just-added' : '';
|
|
|
|
if classroom.justAdded
|
|
|
|
.text-center.text-info Class successfully added!
|
2015-11-25 18:13:43 -05:00
|
|
|
|
|
|
|
//- sigh
|
|
|
|
div(class=classroomClass)
|
2015-11-23 11:46:08 -05:00
|
|
|
h2
|
|
|
|
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
|
|
|
|
|
|
|
|
.course-instance-body
|
|
|
|
- var course = view.courses.get(courseInstance.get('courseID'));
|
|
|
|
h2
|
|
|
|
span.spr= course.get('name')
|
|
|
|
small
|
|
|
|
// TODO: where do we show list of levels?
|
|
|
|
a(href="/courses/classrooms/"+classroom.id) view levels
|
|
|
|
+course-instance-body(hocCourseInstance)
|
|
|
|
|
|
|
|
h2 Join A Class
|
|
|
|
|
|
|
|
form#join-class-form.form-inline
|
|
|
|
.form-group
|
|
|
|
.help-block
|
|
|
|
em Ask your teacher if you have a CodeCombat class code! If so, enter it below:
|
|
|
|
input#class-code-input.form-control
|
|
|
|
input#join-class-button(type="submit" value="Join")
|
|
|
|
|
|
|
|
if view.state === 'enrolling'
|
|
|
|
.progress.progress-striped.active
|
|
|
|
.progress-bar(style="width: 100%") Joining class
|
2015-11-25 18:13:43 -05:00
|
|
|
|
2015-11-23 11:46:08 -05:00
|
|
|
if view.state === 'unknown_error'
|
|
|
|
.alert.alert-danger= view.stateMessage
|
|
|
|
|
2015-11-22 03:08:46 -05:00
|
|
|
|
2015-11-21 14:38:34 -05:00
|
|
|
#begin-hoc-area.hide
|
|
|
|
h2.text-center(data-i18n="common.loading")
|
|
|
|
.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'));
|
|
|
|
- var campaign = view.campaigns.get(course.get('CampaignID'));
|
|
|
|
- var levels = view.campaigns.levelsCollection();
|
|
|
|
if campaign.sessions.allDone()
|
|
|
|
.text-success
|
|
|
|
span.glyphicon.glyphicon-ok
|
|
|
|
span.spl Course Complete!
|
|
|
|
.pull-right
|
|
|
|
if campaign.sessions.allDone()
|
|
|
|
- var arenaLevel = sessions.findWhere({ type: 'course-ladder' });
|
|
|
|
- var arenaURL = "/play/ladder/"+arenaLevel.get('slug')+"/course/"+courseInstance.id;
|
|
|
|
a.btn.btn-warning.btn-lg(href=arenaURL)
|
|
|
|
| Play Arena
|
|
|
|
else if campaign.sessions.size()
|
|
|
|
- var lastSession = campaign.sessions.last();
|
|
|
|
- var lastLevel = levels.findWhere({original: lastSession.get('level').original});
|
2015-11-25 18:13:43 -05:00
|
|
|
- var levelURL = "/play/level/"+lastLevel.get('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
|
|
|
|
- var firstLevel = levels.first();
|
2015-11-25 18:13:43 -05:00
|
|
|
- var levelURL = "/play/level/"+firstLevel.get('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
|