improve the footer
This commit is contained in:
@@ -364,6 +364,7 @@ exports.completedZiplineOrBasejump = function (req, res, next) {
|
||||
});
|
||||
|
||||
var index = req.user.uncompletedCoursewares.indexOf(coursewareHash);
|
||||
console.log('index here', index)
|
||||
if (index > -1) {
|
||||
req.user.progressTimestamps.push(Date.now() || 0);
|
||||
req.user.uncompletedCoursewares.splice(index, 1);
|
||||
|
||||
@@ -87,7 +87,7 @@ module.exports = {
|
||||
res.redirect('http://gitter.im/freecodecamp/freecodecamp');
|
||||
} else {
|
||||
res.render('resources/chat', {
|
||||
title: "Enter Free Code Camp's Chat Rooms"
|
||||
title: "Watch us code live on Twitch.tv"
|
||||
});
|
||||
}
|
||||
},
|
||||
@@ -98,6 +98,12 @@ module.exports = {
|
||||
});
|
||||
},
|
||||
|
||||
twitch: function twitch(req, res) {
|
||||
res.render('resources/twitch', {
|
||||
title: "Enter Free Code Camp's Chat Rooms"
|
||||
});
|
||||
},
|
||||
|
||||
githubCalls: function(req, res) {
|
||||
var githubHeaders = {headers: {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1521.3 Safari/537.36'}, port:80 };
|
||||
request('https://api.github.com/repos/freecodecamp/freecodecamp/pulls?client_id=' + secrets.github.clientID + '&client_secret=' + secrets.github.clientSecret, githubHeaders, function(err, status1, pulls) {
|
||||
|
||||
@@ -9,6 +9,7 @@ var R = require('ramda'),
|
||||
mongodb = require('mongodb'),
|
||||
MongoClient = mongodb.MongoClient,
|
||||
secrets = require('../config/secrets'),
|
||||
nodemailer = require('nodemailer'),
|
||||
sanitizeHtml = require('sanitize-html');
|
||||
|
||||
function hotRank(timeValue, rank) {
|
||||
@@ -384,6 +385,7 @@ exports.commentSubmit = function(req, res, next) {
|
||||
topLevel: true,
|
||||
commentOn: Date.now()
|
||||
});
|
||||
|
||||
commentSave(comment, Story, res, next);
|
||||
};
|
||||
|
||||
@@ -438,8 +440,74 @@ function commentSave(comment, Context, res, next) {
|
||||
res.send(true);
|
||||
});
|
||||
}
|
||||
User.findOne({'profile.username': associatedStory.author.username}, function(err, recipient) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
Comment.findById(associatedStory._id, function(err, originalStory) {
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
debug('is it a comment?', originalStory);
|
||||
if (!originalStory) {
|
||||
Story.findById(associatedStory.associatedPost, function(err, originalStory) {
|
||||
debug('is it a story?', originalStory);
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
var transporter = nodemailer.createTransport({
|
||||
service: 'Mandrill',
|
||||
auth: {
|
||||
user: secrets.mandrill.user,
|
||||
pass: secrets.mandrill.password
|
||||
}
|
||||
});
|
||||
console.log('1!');
|
||||
var mailOptions = {
|
||||
to: recipient.email,
|
||||
from: 'Team@freecodecamp.com',
|
||||
subject: originalStory.author.username + " replied to you on Camper News!",
|
||||
text: [
|
||||
"<a href='http://freecodecamp.com/stories/" + originalStory.storyLink + "'>Here.</a>",
|
||||
'- the Volunteer Camp Counselor Team'
|
||||
].join('')
|
||||
};
|
||||
console.log('2!');
|
||||
transporter.sendMail(mailOptions, function(err) {
|
||||
if (err) { return err; }
|
||||
done(null, null);
|
||||
});
|
||||
});
|
||||
} else {
|
||||
console.log('definitely a comment');
|
||||
var transporter = nodemailer.createTransport({
|
||||
service: 'Mandrill',
|
||||
auth: {
|
||||
user: secrets.mandrill.user,
|
||||
pass: secrets.mandrill.password
|
||||
}
|
||||
});
|
||||
console.log('1!');
|
||||
var mailOptions = {
|
||||
to: recipient.email,
|
||||
from: 'Team@freecodecamp.com',
|
||||
subject: originalStory.author.username + " replied to you on Camper News!",
|
||||
text: [
|
||||
"<a href='http://freecodecamp.com/stories/" + originalStory.storyLink + "'>Here.</a>",
|
||||
'- the Volunteer Camp Counselor Team'
|
||||
].join('')
|
||||
};
|
||||
console.log('2!');
|
||||
transporter.sendMail(mailOptions, function(err) {
|
||||
if (err) { return err; }
|
||||
done(null, null);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
} catch (e) {
|
||||
debug('hey there\'s error');
|
||||
// delete comment
|
||||
return next(err);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user