diff --git a/install/package.json b/install/package.json index 0aea970134..a6c3bba32c 100644 --- a/install/package.json +++ b/install/package.json @@ -101,10 +101,10 @@ "nodebb-plugin-ntfy": "1.0.15", "nodebb-plugin-spam-be-gone": "2.1.1", "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-peace": "2.0.32", - "nodebb-theme-persona": "13.1.7", + "nodebb-theme-persona": "13.1.8", "nodebb-widget-essentials": "7.0.13", "nodemailer": "6.9.3", "nprogress": "0.2.0", diff --git a/public/src/admin/appearance/themes.js b/public/src/admin/appearance/themes.js index 36a98c6a38..f2a023206f 100644 --- a/public/src/admin/appearance/themes.js +++ b/public/src/admin/appearance/themes.js @@ -46,20 +46,20 @@ define('admin/appearance/themes', ['bootbox', 'translator', 'alerts'], function }); $('#revert_theme').on('click', function () { - if (config['theme:id'] === 'nodebb-theme-persona') { + if (config['theme:id'] === 'nodebb-theme-harmony') { return; } bootbox.confirm('[[admin/appearance/themes:revert-confirm]]', function (confirm) { if (confirm) { socket.emit('admin.themes.set', { type: 'local', - id: 'nodebb-theme-persona', + id: 'nodebb-theme-harmony', }, function (err) { if (err) { return alerts.error(err); } - config['theme:id'] = 'nodebb-theme-persona'; - highlightSelectedTheme('nodebb-theme-persona'); + config['theme:id'] = 'nodebb-theme-harmony'; + highlightSelectedTheme('nodebb-theme-harmony'); alerts.alert({ alert_id: 'admin:theme', type: 'success', diff --git a/public/src/modules/helpers.common.js b/public/src/modules/helpers.common.js index d607d7e20f..123b5eccc6 100644 --- a/public/src/modules/helpers.common.js +++ b/public/src/modules/helpers.common.js @@ -327,11 +327,11 @@ module.exports = function (utils, Benchpress, relative_path) { } function generateRepliedTo(post, timeagoCutoff) { - const username = post.parent && post.parent.username ? - post.parent.username : '[[global:guest]]'; + const displayname = post.parent && post.parent.displayname ? + post.parent.displayname : '[[global:guest]]'; const isBeforeCutoff = post.timestamp < (Date.now() - (timeagoCutoff * oneDayInMs)); 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) { diff --git a/src/middleware/helpers.js b/src/middleware/helpers.js index a0ebb06d20..dde0c3b749 100644 --- a/src/middleware/helpers.js +++ b/src/middleware/helpers.js @@ -65,7 +65,7 @@ helpers.buildBodyClass = function (req, res, templateData = {}) { 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) { parts.push('user-loggedin'); diff --git a/src/topics/posts.js b/src/topics/posts.js index 58ad3d20c9..438844d753 100644 --- a/src/topics/posts.js +++ b/src/topics/posts.js @@ -186,13 +186,13 @@ module.exports = function (Topics) { const parentUids = _.uniq(parentPosts.map(postObj => postObj && postObj.uid)); const userData = await user.getUsersFields(parentUids, ['username']); - const usersMap = {}; - userData.forEach((user) => { - usersMap[user.uid] = user.username; - }); + const usersMap = _.zipObject(parentUids, userData); const parents = {}; 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) => {