fixed #912, added new page string for popular topics

v1.18.x
Julian Lam 11 years ago
parent b5496b5680
commit 031e8128c7

@ -1,6 +1,7 @@
{ {
"home": "Home", "home": "Home",
"unread": "Unread Topics", "unread": "Unread Topics",
"popular": "Popular Topics",
"recent": "Recent Topics", "recent": "Recent Topics",
"users": "Registered Users", "users": "Registered Users",
"notifications": "Notifications", "notifications": "Notifications",

@ -132,16 +132,6 @@ module.exports.server = server;
href: nconf.get('relative_path') + '/favicon.ico' href: nconf.get('relative_path') + '/favicon.ico'
}); });
// Browser Title
var metaTitle = templateValues.metaTags.filter(function(tag) {
return tag.property === 'og:title';
});
if (metaTitle.length > 0 && metaTitle[0].content) {
templateValues.browserTitle = metaTitle[0].content;
} else {
templateValues.browserTitle = meta.config.browserTitle || 'NodeBB';
}
if(options.req.user && options.req.user.uid) { if(options.req.user && options.req.user.uid) {
uid = options.req.user.uid; uid = options.req.user.uid;
} }
@ -153,15 +143,34 @@ module.exports.server = server;
templateValues.customCSS = meta.config.customCSS; templateValues.customCSS = meta.config.customCSS;
} }
user.isAdministrator(uid, function(err, isAdmin) { async.parallel([
templateValues.isAdmin = isAdmin; function(next) {
translator.get('pages:' + path.basename(options.req.url), function(translated) {
var metaTitle = templateValues.metaTags.filter(function(tag) {
return tag.name === 'title';
});
if (translated) {
templateValues.browserTitle = translated;
} else if (metaTitle.length > 0 && metaTitle[0].content) {
templateValues.browserTitle = metaTitle[0].content;
} else {
templateValues.browserTitle = meta.config.browserTitle || 'NodeBB';
}
next();
});
},
function(next) {
user.isAdministrator(uid, function(err, isAdmin) {
templateValues.isAdmin = isAdmin || false;
next();
});
}
], function() {
translator.translate(templates.header.parse(templateValues), function(template) { translator.translate(templates.header.parse(templateValues), function(template) {
callback(null, template); callback(null, template);
}); });
}); });
}); });
}; };

Loading…
Cancel
Save