mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-17 19:21:04 +01:00
closes #3590
This commit is contained in:
@@ -19,7 +19,14 @@ var terms = {
|
||||
|
||||
popularController.get = function(req, res, next) {
|
||||
|
||||
var term = terms[req.params.term] || 'day';
|
||||
var term = terms[req.params.term] || 'alltime';
|
||||
|
||||
var termToBreadcrumb = {
|
||||
day: '[[recent:day]]',
|
||||
week: '[[recent:week]]',
|
||||
month: '[[recent:month]]',
|
||||
alltime: '[[global:header.popular]]'
|
||||
};
|
||||
|
||||
if (!req.uid) {
|
||||
if (anonCache[term] && (Date.now() - lastUpdateTime) < 60 * 60 * 1000) {
|
||||
@@ -40,7 +47,13 @@ popularController.get = function(req, res, next) {
|
||||
};
|
||||
|
||||
if (req.path.startsWith('/api/popular') || req.path.startsWith('/popular')) {
|
||||
data.breadcrumbs = helpers.buildBreadcrumbs([{text: '[[global:header.popular]]'}]);
|
||||
var breadcrumbs = [{text: termToBreadcrumb[term]}];
|
||||
|
||||
if (req.params.term) {
|
||||
breadcrumbs.unshift({text: '[[global:header.popular]]', url: '/popular'});
|
||||
}
|
||||
|
||||
data.breadcrumbs = helpers.buildBreadcrumbs(breadcrumbs);
|
||||
}
|
||||
|
||||
if (!req.uid) {
|
||||
|
||||
Reference in New Issue
Block a user