Persisting completion of bonfire challenges into User model, split routes for bonfires and challenges, refactored class selectors to be challenge type specific

This commit is contained in:
Nathan Leniz
2015-01-24 03:11:01 -05:00
parent 6b4475a5b8
commit a3cf6c3ee2
7 changed files with 106 additions and 264 deletions

View File

@@ -56,7 +56,9 @@ exports.returnBonfire = function(req, res, next) {
debug('bonfire err: ', err);
next(err);
}
debug(bonfire[bonfireNumber]._id);
res.render('bonfire/show', {
completedWith: null,
title: bonfire[bonfireNumber].name,
name: bonfire[bonfireNumber].name,
number: bonfire[bonfireNumber].bonfireNumber,
@@ -69,7 +71,8 @@ exports.returnBonfire = function(req, res, next) {
points: req.user ? req.user.points : undefined,
verb: verbs[Math.floor(Math.random() * verbs.length)],
phrase: phrases[Math.floor(Math.random() * phrases.length)],
bonfires: bonfire
bonfires: bonfire,
bonfireHash: bonfire[bonfireNumber]._id
});
});
};