freeCodeCamp/controllers/resources.js

99 lines
2.2 KiB
JavaScript
Raw Normal View History

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