Removing needless CDN call, optimizing account view for slow page loads

This commit is contained in:
Nathan Leniz
2015-02-03 01:00:12 -05:00
parent 6ece608f01
commit 43234825cf
2 changed files with 1 additions and 18 deletions

View File

@ -158,18 +158,9 @@ exports.postEmailSignup = function(req, res, next) {
*/ */
exports.getAccount = function(req, res) { exports.getAccount = function(req, res) {
Challenge.find({}, null, { sort: { challengeNumber: 1 } }, function(err, c) {
if (err) {
console.error('Challenge err: ', err);
next(err);
}
res.render('account/account', { res.render('account/account', {
title: 'Manage your Free Code Camp Account', title: 'Manage your Free Code Camp Account'
challenges: c,
ch: req.user.challengesHash,
moment: moment
}); });
});
}; };
/** /**
@ -177,15 +168,9 @@ exports.getAccount = function(req, res) {
*/ */
exports.getAccountAngular = function(req, res) { exports.getAccountAngular = function(req, res) {
Challenge.find({}, null, { sort: { challengeNumber: 1 } }, function(err, c) {
if (err) {
console.error('Challenge err: ', err);
next(err);
}
res.json({ res.json({
user: req.user user: req.user
}); });
});
}; };
/** /**

View File

@ -4,10 +4,8 @@ html(ng-app='profileValidation', lang='en')
script(src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js") script(src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js")
script(src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular.min.js") script(src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular.min.js")
script(src="//cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.12.0/ui-bootstrap-tpls.min.js") script(src="//cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.12.0/ui-bootstrap-tpls.min.js")
link(rel='shortcut icon', href='//s3.amazonaws.com/freecodecamp/favicon.ico')
link(rel='stylesheet', href='//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css') link(rel='stylesheet', href='//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css')
link(rel='stylesheet', href='//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css') link(rel='stylesheet', href='//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css')
link(rel='stylesheet', href='//code.ionicframework.com/ionicons/2.0.0/css/ionicons.min.css')
include partials/meta include partials/meta
title #{title} | Free Code Camp title #{title} | Free Code Camp
meta(charset='utf-8') meta(charset='utf-8')