Permalink
Browse files

made pages group ready (future use)

  • Loading branch information...
1 parent 172bc84 commit fd422fff219842e7f0e65d844f2bc245c206ed4f @mikevalstar committed Jul 9, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/PublicPages.js
View
5 lib/PublicPages.js
@@ -16,7 +16,7 @@ PublicPages.prototype = {
app.get('/Blog', function(req, res) { self.pageIndex(req, res, false); });
app.get('/Blog/:page([0-9]+)', function(req, res) { self.pageIndex(req, res, {page: req.params.page}); });
app.get('/Blog/:year([0-9]+)/:month([0-9]+)', function(req, res) { self.pageIndex(req, res, {year: req.params.year, month: req.params.month}); });
- //app.get('/Blog/:group', function(req, res) { self.pageIndex(req, res, {search: req.params.group}); });
+ //app.get('/Blog/:group', function(req, res) { self.pageIndex(req, res, {group: req.params.group}); });
app.get('/Blog/s/:topic', function(req, res) { self.pageIndex(req, res, {search: req.params.topic}); });
app.get('/Blog/:id/:title', function(req, res) { self.pageBlogPost(req, res); });
@@ -28,7 +28,8 @@ PublicPages.prototype = {
var blogpost = this.db.model('blogPost');
var page = (nav && nav.page) ? nav.page - 1 : 0;
var query = {};
- if(nav && nav.search) query = {title: {$regex: new RegExp('.*' + Util.escapeRegEx(nav.search) + '.*', 'i')}};
+ if(nav && nav.search) query = {title: {$regex: new RegExp('.*' + Util.escapeRegEx(nav.search) + '.*', 'i')}};
+ if(nav && nav.group) query = {group: nav.group};
if(nav && nav.year){
var start = new Date(nav.year, nav.month, 1);
var end = new Date(nav.year, start.getMonth() + 1, 1);

0 comments on commit fd422ff

Please sign in to comment.