Merge branch 'courseware' into challenge-restructure

This commit is contained in:
Quincy Larson
2015-05-18 23:33:03 -07:00
12 changed files with 3561 additions and 2705 deletions

View File

@@ -43,7 +43,7 @@ module.exports = {
coursewareList = resources.allCoursewareNames();
completedCoursewareList = noDuplicatedCoursewares;
waypoints = coursewareList.filter(function(challenge) {
if (challenge.challengeType === 2) { return challenge }
if (challenge.challengeType === 2 || challenge.challengeType === 0) { return challenge }
});
ziplines = coursewareList.filter(function(challenge) {
if (challenge.challengeType === 3) { return challenge }

View File

@@ -28,9 +28,6 @@ exports.returnNextCourseware = function(req, res, next) {
if (!req.user) {
return res.redirect('../challenges/learn-how-free-code-camp-works');
}
if (req.user.finishedWaypoints && req.user.uncompletedBonfires.length > 0) {
return res.redirect('../bonfires')
}
var completed = req.user.completedCoursewares.map(function (elem) {
return elem._id;
@@ -46,7 +43,6 @@ exports.returnNextCourseware = function(req, res, next) {
var uncompletedCoursewares = req.user.uncompletedCoursewares[0];
var displayedCoursewares = Courseware.find({'_id': uncompletedCoursewares});
displayedCoursewares.exec(function(err, courseware) {
if (err) {

View File

@@ -207,6 +207,10 @@ module.exports = {
}
},
catPhotoSubmit: function catPhotoSubmit(req, res) {
res.send('Success! You have submitted your cat photo. Return to your website by typing any letter into your code editor.')
},
nonprofits: function nonprofits(req, res) {
res.render('resources/nonprofits', {
title: 'A guide to our Nonprofit Projects'