mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-04 21:15:55 +01:00
first pass at a custom title function (not ready for prod)
This commit is contained in:
14
src/meta.js
14
src/meta.js
@@ -79,4 +79,18 @@ var utils = require('./../public/src/utils.js'),
|
||||
// ...
|
||||
}
|
||||
}
|
||||
|
||||
Meta.build_title = function(title, current_user, callback) {
|
||||
var user = require('./user');
|
||||
|
||||
if (!title) title = global.config.title || 'NodeBB';
|
||||
else title += ' | ' + global.config.title || 'NodeBB';
|
||||
|
||||
// Grab the number of unread notifications
|
||||
user.notifications.getUnreadCount(current_user, function(err, count) {
|
||||
if (!err && count > 0) title = '(' + count + ') ' + title;
|
||||
|
||||
callback(err, title);
|
||||
});
|
||||
}
|
||||
}(exports));
|
||||
Reference in New Issue
Block a user