2014-12-23 08:48:28 -08:00
|
|
|
var User = require('../models/User'),
|
|
|
|
resources = require('./resources.json'),
|
|
|
|
questions = resources.questions,
|
|
|
|
steps = resources.steps;
|
2014-12-10 20:44:33 -08:00
|
|
|
|
2014-12-23 08:48:28 -08:00
|
|
|
//NOTE(BERKS): Async, total users may not available before it is used.
|
|
|
|
var totalUsers = 0;
|
|
|
|
User.count({}, function(err, count) {
|
|
|
|
totalUsers = count;
|
2014-12-10 20:44:33 -08:00
|
|
|
});
|
|
|
|
|
2014-11-10 10:29:16 -08:00
|
|
|
/**
|
|
|
|
* GET /
|
|
|
|
* Resources.
|
|
|
|
*/
|
2014-12-23 08:48:28 -08:00
|
|
|
//TODO: Stats view
|
|
|
|
module.exports = {
|
|
|
|
learnToCode: function(req, res) {
|
|
|
|
res.render('learn-to-code', {
|
|
|
|
title: 'Learn to Code'
|
2014-11-23 15:08:46 -06:00
|
|
|
});
|
2014-12-23 08:48:28 -08:00
|
|
|
},
|
2014-11-29 15:16:47 -08:00
|
|
|
|
2014-12-23 08:48:28 -08:00
|
|
|
privacy: function privacy(req, res) {
|
|
|
|
res.render('privacy', {
|
|
|
|
title: 'Privacy'
|
2014-11-29 23:01:49 -08:00
|
|
|
});
|
2014-12-23 08:48:28 -08:00
|
|
|
},
|
2014-11-29 23:01:49 -08:00
|
|
|
|
2014-12-23 08:48:28 -08:00
|
|
|
statistics: function statistics(req, res) {
|
|
|
|
res.render('statistics', {
|
|
|
|
title: 'Code Camper Statistics'
|
|
|
|
//totalUsers: totalUsers,
|
|
|
|
//usersOverTenChallenges: usersOverTenChallenges
|
2014-12-10 20:44:33 -08:00
|
|
|
});
|
2014-12-23 08:48:28 -08:00
|
|
|
},
|
2014-12-10 20:44:33 -08:00
|
|
|
|
2014-12-23 08:48:28 -08:00
|
|
|
chromebook: function chromebook(req, res) {
|
|
|
|
res.render('chromebook', {
|
|
|
|
title: 'Win a Chromebook'
|
2014-12-11 21:24:44 -08:00
|
|
|
});
|
2014-12-23 08:48:28 -08:00
|
|
|
},
|
2014-12-11 21:24:44 -08:00
|
|
|
|
2014-12-23 08:48:28 -08:00
|
|
|
jqueryExercises: function jqueryExercises(req, res) {
|
|
|
|
res.render('jquery-exercises', {
|
|
|
|
title: 'jQuery Exercises'
|
2014-11-29 15:16:47 -08:00
|
|
|
});
|
2014-12-23 08:48:28 -08:00
|
|
|
},
|
2014-12-09 22:30:18 -08:00
|
|
|
|
2014-12-23 08:48:28 -08:00
|
|
|
livePairProgramming: function(req, res) {
|
|
|
|
res.render('live-pair-programming', {
|
|
|
|
title: 'Live Pair Programming'
|
2014-12-14 22:24:54 -08:00
|
|
|
});
|
2014-12-23 08:48:28 -08:00
|
|
|
},
|
2014-12-14 22:24:54 -08:00
|
|
|
|
2014-12-23 08:48:28 -08:00
|
|
|
javaScriptInYourInbox: function(req, res) {
|
|
|
|
res.render('javascript-in-your-inbox', {
|
|
|
|
title: 'JavaScript in your Inbox'
|
2014-12-14 22:24:54 -08:00
|
|
|
});
|
2014-12-23 08:48:28 -08:00
|
|
|
},
|
2014-12-14 22:24:54 -08:00
|
|
|
|
2014-12-23 08:48:28 -08:00
|
|
|
programmerInterviewQuestionsApp: function(req, res) {
|
|
|
|
res.render('programmer-interview-questions-app', {
|
|
|
|
title: 'Programmer Interview Questions App'
|
2014-12-09 22:30:18 -08:00
|
|
|
});
|
2014-12-23 08:48:28 -08:00
|
|
|
},
|
2014-12-09 22:30:18 -08:00
|
|
|
|
2014-12-23 08:48:28 -08:00
|
|
|
pairProgramWithTeamViewer: function(req, res) {
|
2014-12-15 21:10:13 -08:00
|
|
|
res.render('pair-program-with-team-viewer', {
|
2014-12-23 08:48:28 -08:00
|
|
|
title: 'Challenge: Pair Program with Team Viewer',
|
|
|
|
name: 'Pair Program with Team Viewer',
|
|
|
|
video: '',
|
|
|
|
time: 30,
|
|
|
|
steps: steps,
|
|
|
|
cc: req.user.challengesHash
|
2014-12-09 22:30:18 -08:00
|
|
|
});
|
2014-12-23 08:48:28 -08:00
|
|
|
},
|
|
|
|
|
|
|
|
about: function(req, res) {
|
2014-11-23 15:08:46 -06:00
|
|
|
res.render('about', {
|
2014-12-23 08:48:28 -08:00
|
|
|
title: 'About Free Code Camp and Our Team of Volunteers'
|
2014-12-16 10:31:19 -08:00
|
|
|
});
|
2014-12-23 08:48:28 -08:00
|
|
|
},
|
2014-12-16 10:31:19 -08:00
|
|
|
|
2014-12-23 08:48:28 -08:00
|
|
|
doneWithFirst100Hours: function(req, res) {
|
2014-12-16 10:31:19 -08:00
|
|
|
res.render('done-with-first-100-hours', {
|
2014-12-23 08:48:28 -08:00
|
|
|
title:
|
|
|
|
'Congratulations on finishing the first 100 hours of Free Code Camp!'
|
2014-11-23 15:08:46 -06:00
|
|
|
});
|
2014-12-23 08:48:28 -08:00
|
|
|
},
|
|
|
|
|
|
|
|
interviewQuestions: function(req, res) {
|
|
|
|
res.json(questions);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2014-11-11 17:52:03 -08:00
|
|
|
|