2014-12-23 16:48:28 +00:00
|
|
|
var User = require('../models/User'),
|
|
|
|
resources = require('./resources.json'),
|
|
|
|
questions = resources.questions,
|
|
|
|
steps = resources.steps;
|
2014-12-11 04:44:33 +00:00
|
|
|
|
2014-12-23 16:48:28 +00: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-11 04:44:33 +00:00
|
|
|
});
|
|
|
|
|
2014-11-10 18:29:16 +00:00
|
|
|
/**
|
|
|
|
* GET /
|
|
|
|
* Resources.
|
|
|
|
*/
|
2014-12-23 16:48:28 +00:00
|
|
|
//TODO: Stats view
|
|
|
|
module.exports = {
|
|
|
|
learnToCode: function(req, res) {
|
|
|
|
res.render('learn-to-code', {
|
|
|
|
title: 'Learn to Code'
|
2014-11-23 21:08:46 +00:00
|
|
|
});
|
2014-12-23 16:48:28 +00:00
|
|
|
},
|
2014-11-29 23:16:47 +00:00
|
|
|
|
2014-12-23 16:48:28 +00:00
|
|
|
privacy: function privacy(req, res) {
|
|
|
|
res.render('privacy', {
|
|
|
|
title: 'Privacy'
|
2014-11-30 07:01:49 +00:00
|
|
|
});
|
2014-12-23 16:48:28 +00:00
|
|
|
},
|
2014-11-30 07:01:49 +00:00
|
|
|
|
2014-12-23 16:48:28 +00:00
|
|
|
statistics: function statistics(req, res) {
|
|
|
|
res.render('statistics', {
|
|
|
|
title: 'Code Camper Statistics'
|
|
|
|
//totalUsers: totalUsers,
|
|
|
|
//usersOverTenChallenges: usersOverTenChallenges
|
2014-12-11 04:44:33 +00:00
|
|
|
});
|
2014-12-23 16:48:28 +00:00
|
|
|
},
|
2014-12-11 04:44:33 +00:00
|
|
|
|
2014-12-23 16:48:28 +00:00
|
|
|
chromebook: function chromebook(req, res) {
|
|
|
|
res.render('chromebook', {
|
|
|
|
title: 'Win a Chromebook'
|
2014-12-12 05:24:44 +00:00
|
|
|
});
|
2014-12-23 16:48:28 +00:00
|
|
|
},
|
2014-12-12 05:24:44 +00:00
|
|
|
|
2014-12-23 16:48:28 +00:00
|
|
|
jqueryExercises: function jqueryExercises(req, res) {
|
|
|
|
res.render('jquery-exercises', {
|
|
|
|
title: 'jQuery Exercises'
|
2014-11-29 23:16:47 +00:00
|
|
|
});
|
2014-12-23 16:48:28 +00:00
|
|
|
},
|
2014-12-10 06:30:18 +00:00
|
|
|
|
2014-12-23 16:48:28 +00:00
|
|
|
livePairProgramming: function(req, res) {
|
|
|
|
res.render('live-pair-programming', {
|
|
|
|
title: 'Live Pair Programming'
|
2014-12-15 06:24:54 +00:00
|
|
|
});
|
2014-12-23 16:48:28 +00:00
|
|
|
},
|
2014-12-15 06:24:54 +00:00
|
|
|
|
2014-12-23 16:48:28 +00:00
|
|
|
javaScriptInYourInbox: function(req, res) {
|
|
|
|
res.render('javascript-in-your-inbox', {
|
|
|
|
title: 'JavaScript in your Inbox'
|
2014-12-15 06:24:54 +00:00
|
|
|
});
|
2014-12-23 16:48:28 +00:00
|
|
|
},
|
2014-12-15 06:24:54 +00:00
|
|
|
|
2014-12-23 16:48:28 +00:00
|
|
|
programmerInterviewQuestionsApp: function(req, res) {
|
|
|
|
res.render('programmer-interview-questions-app', {
|
|
|
|
title: 'Programmer Interview Questions App'
|
2014-12-10 06:30:18 +00:00
|
|
|
});
|
2014-12-23 16:48:28 +00:00
|
|
|
},
|
2014-12-10 06:30:18 +00:00
|
|
|
|
2014-12-23 16:48:28 +00:00
|
|
|
pairProgramWithTeamViewer: function(req, res) {
|
2014-12-16 05:10:13 +00:00
|
|
|
res.render('pair-program-with-team-viewer', {
|
2014-12-23 16:48:28 +00: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-10 06:30:18 +00:00
|
|
|
});
|
2014-12-23 16:48:28 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
about: function(req, res) {
|
2014-11-23 21:08:46 +00:00
|
|
|
res.render('about', {
|
2014-12-23 16:48:28 +00:00
|
|
|
title: 'About Free Code Camp and Our Team of Volunteers'
|
2014-12-16 18:31:19 +00:00
|
|
|
});
|
2014-12-23 16:48:28 +00:00
|
|
|
},
|
2014-12-16 18:31:19 +00:00
|
|
|
|
2014-12-23 16:48:28 +00:00
|
|
|
doneWithFirst100Hours: function(req, res) {
|
2014-12-16 18:31:19 +00:00
|
|
|
res.render('done-with-first-100-hours', {
|
2014-12-23 16:48:28 +00:00
|
|
|
title:
|
|
|
|
'Congratulations on finishing the first 100 hours of Free Code Camp!'
|
2014-11-23 21:08:46 +00:00
|
|
|
});
|
2014-12-23 16:48:28 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
interviewQuestions: function(req, res) {
|
|
|
|
res.json(questions);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2014-11-12 01:52:03 +00:00
|
|
|
|