Merge branch 'master' into develop

isekai-main
Barış Soner Uşaklı 2 years ago
commit edd8ca997f

@ -101,10 +101,10 @@
"nodebb-plugin-ntfy": "1.0.15", "nodebb-plugin-ntfy": "1.0.15",
"nodebb-plugin-spam-be-gone": "2.1.1", "nodebb-plugin-spam-be-gone": "2.1.1",
"nodebb-rewards-essentials": "0.2.3", "nodebb-rewards-essentials": "0.2.3",
"nodebb-theme-harmony": "1.0.65", "nodebb-theme-harmony": "1.0.66",
"nodebb-theme-lavender": "7.1.1", "nodebb-theme-lavender": "7.1.1",
"nodebb-theme-peace": "2.0.32", "nodebb-theme-peace": "2.0.32",
"nodebb-theme-persona": "13.1.7", "nodebb-theme-persona": "13.1.8",
"nodebb-widget-essentials": "7.0.13", "nodebb-widget-essentials": "7.0.13",
"nodemailer": "6.9.3", "nodemailer": "6.9.3",
"nprogress": "0.2.0", "nprogress": "0.2.0",

@ -46,20 +46,20 @@ define('admin/appearance/themes', ['bootbox', 'translator', 'alerts'], function
}); });
$('#revert_theme').on('click', function () { $('#revert_theme').on('click', function () {
if (config['theme:id'] === 'nodebb-theme-persona') { if (config['theme:id'] === 'nodebb-theme-harmony') {
return; return;
} }
bootbox.confirm('[[admin/appearance/themes:revert-confirm]]', function (confirm) { bootbox.confirm('[[admin/appearance/themes:revert-confirm]]', function (confirm) {
if (confirm) { if (confirm) {
socket.emit('admin.themes.set', { socket.emit('admin.themes.set', {
type: 'local', type: 'local',
id: 'nodebb-theme-persona', id: 'nodebb-theme-harmony',
}, function (err) { }, function (err) {
if (err) { if (err) {
return alerts.error(err); return alerts.error(err);
} }
config['theme:id'] = 'nodebb-theme-persona'; config['theme:id'] = 'nodebb-theme-harmony';
highlightSelectedTheme('nodebb-theme-persona'); highlightSelectedTheme('nodebb-theme-harmony');
alerts.alert({ alerts.alert({
alert_id: 'admin:theme', alert_id: 'admin:theme',
type: 'success', type: 'success',

@ -327,11 +327,11 @@ module.exports = function (utils, Benchpress, relative_path) {
} }
function generateRepliedTo(post, timeagoCutoff) { function generateRepliedTo(post, timeagoCutoff) {
const username = post.parent && post.parent.username ? const displayname = post.parent && post.parent.displayname ?
post.parent.username : '[[global:guest]]'; post.parent.displayname : '[[global:guest]]';
const isBeforeCutoff = post.timestamp < (Date.now() - (timeagoCutoff * oneDayInMs)); const isBeforeCutoff = post.timestamp < (Date.now() - (timeagoCutoff * oneDayInMs));
const langSuffix = isBeforeCutoff ? 'on' : 'ago'; const langSuffix = isBeforeCutoff ? 'on' : 'ago';
return `[[topic:replied-to-user-${langSuffix}, ${post.toPid}, ${relative_path}/post/${post.toPid}, ${username}, ${relative_path}/post/${post.pid}, ${post.timestampISO}]]`; return `[[topic:replied-to-user-${langSuffix}, ${post.toPid}, ${relative_path}/post/${post.toPid}, ${displayname}, ${relative_path}/post/${post.pid}, ${post.timestampISO}]]`;
} }
function generateWrote(post, timeagoCutoff) { function generateWrote(post, timeagoCutoff) {

@ -65,7 +65,7 @@ helpers.buildBodyClass = function (req, res, templateData = {}) {
parts.push(`page-status-${res.statusCode}`); parts.push(`page-status-${res.statusCode}`);
parts.push(`theme-${meta.config['theme:id'].split('-')[2]}`); parts.push(`theme-${(meta.config['theme:id'] || '').split('-')[2]}`);
if (req.loggedIn) { if (req.loggedIn) {
parts.push('user-loggedin'); parts.push('user-loggedin');

@ -186,13 +186,13 @@ module.exports = function (Topics) {
const parentUids = _.uniq(parentPosts.map(postObj => postObj && postObj.uid)); const parentUids = _.uniq(parentPosts.map(postObj => postObj && postObj.uid));
const userData = await user.getUsersFields(parentUids, ['username']); const userData = await user.getUsersFields(parentUids, ['username']);
const usersMap = {}; const usersMap = _.zipObject(parentUids, userData);
userData.forEach((user) => {
usersMap[user.uid] = user.username;
});
const parents = {}; const parents = {};
parentPosts.forEach((post, i) => { parentPosts.forEach((post, i) => {
parents[parentPids[i]] = { username: usersMap[post.uid] }; parents[parentPids[i]] = {
username: usersMap[post.uid].username,
displayname: usersMap[post.uid].displayname,
};
}); });
postData.forEach((post) => { postData.forEach((post) => {

Loading…
Cancel
Save