Remove debug statements from story.js and clean up one linting error. Rename href in navbar from news to stories to unify API names.

This commit is contained in:
terakilobyte
2015-06-09 16:57:23 -04:00
parent 25e500a457
commit 5ec532f3d9
2 changed files with 5 additions and 14 deletions

View File

@ -2,7 +2,7 @@ var nodemailer = require('nodemailer'),
sanitizeHtml = require('sanitize-html'), sanitizeHtml = require('sanitize-html'),
moment = require('moment'), moment = require('moment'),
mongodb = require('mongodb'), mongodb = require('mongodb'),
debug = require('debug')('freecc:cntr:story'), // debug = require('debug')('freecc:cntr:story'),
utils = require('../utils'), utils = require('../utils'),
MongoClient = mongodb.MongoClient, MongoClient = mongodb.MongoClient,
secrets = require('../../config/secrets'); secrets = require('../../config/secrets');
@ -42,20 +42,12 @@ module.exports = function(app) {
return hotness; return hotness;
} }
function hotJSON(req, res, next) { function hotJSON(req, res, next) { // no-unused-vars
//var story = Story.find({}).sort({'timePosted': -1}).limit(1000);
//story.exec(function(err, stories) {
// if (err) {
// return next(err);
// }
//Story.find([{$match: {}},
// {$sort: {'timePosted': -1}},
// {$limit: 1000}], function(err, stories) {
Story.find({order: 'timePosted DESC', limit: 1000}, function(err, stories) { Story.find({order: 'timePosted DESC', limit: 1000}, function(err, stories) {
if (err) { if (err) {
return next(err); return next(err);
} }
debug(stories);
var foundationDate = 1413298800000; var foundationDate = 1413298800000;
var sliceVal = stories.length >= 100 ? 100 : stories.length; var sliceVal = stories.length >= 100 ? 100 : stories.length;
@ -132,7 +124,6 @@ module.exports = function(app) {
function returnIndividualStory(req, res, next) { function returnIndividualStory(req, res, next) {
debug('hit return individual route');
var dashedName = req.params.storyName; var dashedName = req.params.storyName;
var storyName = dashedName.replace(/\-/g, ' ').trim(); var storyName = dashedName.replace(/\-/g, ' ').trim();
@ -198,7 +189,7 @@ module.exports = function(app) {
} }
database.collection('stories').find({ database.collection('stories').find({
'$text': { '$text': {
'$search': req.body.data ? req.body.data.searchValue : "" '$search': req.body.data ? req.body.data.searchValue : ''
} }
}, { }, {
headline: 1, headline: 1,

View File

@ -20,7 +20,7 @@ nav.navbar.navbar-default.navbar-fixed-top.nav-height
li li
a(href='/challenges/waypoint-join-our-chat-room') Chat a(href='/challenges/waypoint-join-our-chat-room') Chat
li li
a(href='/news') News a(href='/stories') News
li li
a(href='/field-guide') Guide a(href='/field-guide') Guide
li li