changed numRecentTopics to numRecentReplies, that makes more sense now

v1.18.x
psychobunny 11 years ago
parent 1d69436b44
commit 98a646fa62

@ -85,8 +85,8 @@
</div> </div>
<div class="col-sm-4 col-xs-12"> <div class="col-sm-4 col-xs-12">
<div class="form-group"> <div class="form-group">
<label for="cid-{categories.cid}-numRecentTopics"># of Recent Topics Displayed</label> <label for="cid-{categories.cid}-numRecentReplies"># of Recent Replies Displayed</label>
<input id="cid-{categories.cid}-numRecentTopics" type="text" class="form-control" placeholder="2" data-name="numRecentTopics" value="{categories.numRecentTopics}" /> <input id="cid-{categories.cid}-numRecentReplies" type="text" class="form-control" placeholder="2" data-name="numRecentReplies" value="{categories.numRecentReplies}" />
</div> </div>
</div> </div>
</div> </div>

@ -55,7 +55,7 @@ var path = require('path'),
}); });
function iterator(category, callback) { function iterator(category, callback) {
categories.getRecentReplies(category.cid, parseInt(category.numRecentTopics, 10), function (err, posts) { categories.getRecentReplies(category.cid, parseInt(category.numRecentReplies, 10), function (err, posts) {
category.posts = posts; category.posts = posts;
category.post_count = posts.length > 2 ? 2 : posts.length; // this was a hack to make metro work back in the day, post_count should just = length category.post_count = posts.length > 2 ? 2 : posts.length; // this was a hack to make metro work back in the day, post_count should just = length
callback(null); callback(null);

@ -145,14 +145,14 @@ Upgrade.upgrade = function(callback) {
} }
for (var cid in cids) { for (var cid in cids) {
db.setObjectField('category:' + cids[cid], 'numRecentTopics', '2'); db.setObjectField('category:' + cids[cid], 'numRecentReplies', '2');
} }
winston.info('[2013/12/31] Added categories.numRecentTopics fields'); winston.info('[2013/12/31] Added categories.numRecentReplies fields');
next(); next();
}); });
} else { } else {
winston.info('[2014/1/3] categories.numRecentTopics fields skipped'); winston.info('[2014/1/3] categories.numRecentReplies fields skipped');
next(); next();
} }
} }

Loading…
Cancel
Save