mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-08-07 16:49:08 +02:00
Merge branch 'master' into develop
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user