You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
831 B
JavaScript

'use strict';
9 years ago
var nconf = require('nconf');
9 years ago
9 years ago
var topics = require('../topics');
var meta = require('../meta');
var helpers = require('./helpers');
var recentController = {};
recentController.get = function(req, res, next) {
var stop = (parseInt(meta.config.topicsPerList, 10) || 20) - 1;
9 years ago
topics.getTopicsFromSet('topics:recent', req.uid, 0, stop, function(err, data) {
if (err) {
return next(err);
}
9 years ago
data['feeds:disableRSS'] = parseInt(meta.config['feeds:disableRSS'], 10) === 1;
data.rssFeedUrl = nconf.get('relative_path') + '/recent.rss';
data.title = '[[pages:recent]]';
if (req.path.startsWith('/api/recent') || req.path.startsWith('/recent')) {
data.breadcrumbs = helpers.buildBreadcrumbs([{text: '[[recent:title]]'}]);
}
res.render('recent', data);
});
};
module.exports = recentController;