From d8deb322ffdb1a25c462d8cb860d754e8464bdd6 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Wed, 31 Jan 2018 13:21:15 -0500 Subject: [PATCH 01/13] closes #6295 --- src/views/admin/manage/category.tpl | 319 ++++++++++++++-------------- 1 file changed, 157 insertions(+), 162 deletions(-) diff --git a/src/views/admin/manage/category.tpl b/src/views/admin/manage/category.tpl index cf8ab89312..79a19664d7 100644 --- a/src/views/admin/manage/category.tpl +++ b/src/views/admin/manage/category.tpl @@ -1,174 +1,169 @@ -
- -
-
-
- -
+ +
+
+
+
-
+
-
-
-
-
-
-
+
+
+ +
+
+
+ +
+
+
+
+
+ +
+
+
+
+ +
+ +
+ +
+ +

+ +
+
+ +
+ +
+
+ +
+
+ +
+
+ + +
+ +
+
+
+ +
+
- -
+
+ + + +
From a9f6726b3dd3896d964c7fe31f424dc99ad2d541 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 31 Jan 2018 15:55:15 -0500 Subject: [PATCH 04/13] closes #6296 --- public/src/admin/general/navigation.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/src/admin/general/navigation.js b/public/src/admin/general/navigation.js index 9e44ac0468..8987c1aa23 100644 --- a/public/src/admin/general/navigation.js +++ b/public/src/admin/general/navigation.js @@ -67,7 +67,8 @@ define('admin/general/navigation', ['translator', 'iconSelect', 'benchpress', 'j data.enabled = false; data.index = (parseInt($('#enabled').children().last().attr('data-index'), 10) || 0) + 1; - + data.title = translator.escape(data.title); + data.text = translator.escape(data.text); Benchpress.parse('admin/general/navigation', 'navigation', { navigation: [data] }, function (li) { translator.translate(li, function (li) { li = $(translator.unescape(li)); From 42b447ce6ace722ddc66b94ad9ee78c6cc5a3e9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 31 Jan 2018 15:57:57 -0500 Subject: [PATCH 05/13] closes #6297 --- src/views/admin/appearance/skins.tpl | 2 +- src/views/admin/appearance/themes.tpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/admin/appearance/skins.tpl b/src/views/admin/appearance/skins.tpl index 6e87580557..4b0b89323b 100644 --- a/src/views/admin/appearance/skins.tpl +++ b/src/views/admin/appearance/skins.tpl @@ -1,5 +1,5 @@
-
+
[[admin/appearance/skins:loading]]
diff --git a/src/views/admin/appearance/themes.tpl b/src/views/admin/appearance/themes.tpl index 8203c84e8b..c0d9884b81 100644 --- a/src/views/admin/appearance/themes.tpl +++ b/src/views/admin/appearance/themes.tpl @@ -1,5 +1,5 @@
-
+
[[admin/appearance/themes:checking-for-installed]]
From 688ade1fc7077397fccebfddfdeff86440f09da8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Thu, 1 Feb 2018 11:04:58 -0500 Subject: [PATCH 06/13] up composer --- install/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/package.json b/install/package.json index f957023191..d14895a993 100644 --- a/install/package.json +++ b/install/package.json @@ -59,7 +59,7 @@ "morgan": "^1.9.0", "mousetrap": "^1.6.1", "nconf": "^0.9.1", - "nodebb-plugin-composer-default": "6.0.11", + "nodebb-plugin-composer-default": "6.0.12", "nodebb-plugin-dbsearch": "2.0.9", "nodebb-plugin-emoji": "2.0.9", "nodebb-plugin-emoji-android": "2.0.0", From 2e2032cca1c663078ea37e64f00ddccacf31331d Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 1 Feb 2018 11:27:44 -0500 Subject: [PATCH 07/13] bump mentions, julianlam/nodebb-plugin-mentions#96, @BenLubar --- install/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/package.json b/install/package.json index d14895a993..cc2d6d9cee 100644 --- a/install/package.json +++ b/install/package.json @@ -64,7 +64,7 @@ "nodebb-plugin-emoji": "2.0.9", "nodebb-plugin-emoji-android": "2.0.0", "nodebb-plugin-markdown": "8.3.0", - "nodebb-plugin-mentions": "2.2.2", + "nodebb-plugin-mentions": "2.2.3", "nodebb-plugin-soundpack-default": "1.0.0", "nodebb-plugin-spam-be-gone": "0.5.1", "nodebb-rewards-essentials": "0.0.11", From b084a596fa06d8273a8d7c1e374a6af21bd255cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Thu, 1 Feb 2018 14:33:00 -0500 Subject: [PATCH 08/13] closes #6301 --- src/database/mongo/hash.js | 2 +- src/database/redis/hash.js | 8 ++++++-- test/database/hash.js | 12 ++++++++++++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/database/mongo/hash.js b/src/database/mongo/hash.js index aef54bf124..263ad79849 100644 --- a/src/database/mongo/hash.js +++ b/src/database/mongo/hash.js @@ -277,7 +277,7 @@ module.exports = function (db, module) { callback = callback || helpers.noop; value = parseInt(value, 10); if (!key || isNaN(value)) { - return callback(); + return callback(null, null); } var data = {}; diff --git a/src/database/redis/hash.js b/src/database/redis/hash.js index 1a9388f0a2..6f3c799027 100644 --- a/src/database/redis/hash.js +++ b/src/database/redis/hash.js @@ -117,14 +117,18 @@ module.exports = function (redisClient, module) { }; module.incrObjectField = function (key, field, callback) { - redisClient.hincrby(key, field, 1, callback); + module.incrObjectFieldBy(key, field, 1, callback); }; module.decrObjectField = function (key, field, callback) { - redisClient.hincrby(key, field, -1, callback); + module.incrObjectFieldBy(key, field, -1, callback); }; module.incrObjectFieldBy = function (key, field, value, callback) { + value = parseInt(value, 10); + if (!key || isNaN(value)) { + return callback(null, null); + } redisClient.hincrby(key, field, value, callback); }; }; diff --git a/test/database/hash.js b/test/database/hash.js index 3eb84c693b..cd64acba56 100644 --- a/test/database/hash.js +++ b/test/database/hash.js @@ -438,5 +438,17 @@ describe('Hash methods', function () { done(); }); }); + + it('should return null if value is NaN', function (done) { + db.incrObjectFieldBy('testObject15', 'lastonline', 'notanumber', function (err, newValue) { + assert.ifError(err); + assert.strictEqual(newValue, null); + db.isObjectField('testObject15', 'lastonline', function (err, isField) { + assert.ifError(err); + assert(!isField); + done(); + }); + }); + }); }); }); From 6533c664d6fa38749315dac0338343fd4ad873cb Mon Sep 17 00:00:00 2001 From: psychobunny Date: Thu, 1 Feb 2018 16:49:53 -0500 Subject: [PATCH 09/13] fix font size in appearance menus --- public/less/admin/appearance/themes.less | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/public/less/admin/appearance/themes.less b/public/less/admin/appearance/themes.less index 4fed5205b2..50987f0da4 100644 --- a/public/less/admin/appearance/themes.less +++ b/public/less/admin/appearance/themes.less @@ -38,8 +38,12 @@ background-size: contain; } - .mdl-card__supporting-text h2 { - margin-bottom: 15px; + .mdl-card__supporting-text { + font-size: 1.5rem; + + h2 { + margin-bottom: 15px; + } } } From 69a8eb11008856c902b87ffc4d42029ff6d21672 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Thu, 1 Feb 2018 17:00:43 -0500 Subject: [PATCH 10/13] extra fixes for #6297 --- public/less/admin/appearance/themes.less | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/less/admin/appearance/themes.less b/public/less/admin/appearance/themes.less index 50987f0da4..f69222999b 100644 --- a/public/less/admin/appearance/themes.less +++ b/public/less/admin/appearance/themes.less @@ -40,8 +40,10 @@ .mdl-card__supporting-text { font-size: 1.5rem; + margin: 0 auto; - h2 { + .mdl-card__title-text { + display: inline-block; margin-bottom: 15px; } } From ed506c32a23830f6122bc4e754d8c09346778bc2 Mon Sep 17 00:00:00 2001 From: "Misty (Bot)" Date: Fri, 2 Feb 2018 09:25:01 +0000 Subject: [PATCH 11/13] Latest translations and fallbacks --- public/language/zh-CN/modules.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/language/zh-CN/modules.json b/public/language/zh-CN/modules.json index 484962b740..cab48a8174 100644 --- a/public/language/zh-CN/modules.json +++ b/public/language/zh-CN/modules.json @@ -18,7 +18,7 @@ "chat.seven_days": "7天", "chat.thirty_days": "30天", "chat.three_months": "3个月", - "chat.delete_message_confirm": "确认删除此消息吗?", + "chat.delete_message_confirm": "你确定删除此消息吗?", "chat.add-users-to-room": "向此聊天室中添加成员", "chat.confirm-chat-with-dnd-user": "该用户将其状态设置为DnD(请勿打扰)。 你还想和他们聊天吗?", "composer.compose": "编写帮助", From e3966a7b8f7dea56ca242fc16691b8b6d368e180 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Fri, 2 Feb 2018 10:15:43 -0500 Subject: [PATCH 12/13] up widget-essentials --- install/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/package.json b/install/package.json index cc2d6d9cee..36d6add398 100644 --- a/install/package.json +++ b/install/package.json @@ -72,7 +72,7 @@ "nodebb-theme-persona": "7.2.20", "nodebb-theme-slick": "1.1.4", "nodebb-theme-vanilla": "8.1.9", - "nodebb-widget-essentials": "4.0.1", + "nodebb-widget-essentials": "4.0.2", "nodemailer": "4.4.1", "passport": "^0.4.0", "passport-local": "1.0.0", From 9d3b00f77855cacb96ac90abd3f5bbb5f2b5bc97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Fri, 2 Feb 2018 10:35:47 -0500 Subject: [PATCH 13/13] shuffle suggested topics, search in same category --- src/topics/suggested.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/topics/suggested.js b/src/topics/suggested.js index 830631d302..0c6ae1a661 100644 --- a/src/topics/suggested.js +++ b/src/topics/suggested.js @@ -24,8 +24,8 @@ module.exports = function (Topics) { }, next); }, function (results, next) { - var tids = results.tagTids.concat(results.searchTids).concat(results.categoryTids); - tids = _.uniq(tids).filter(function (_tid) { + var tids = _.shuffle(_.uniq(results.tagTids.concat(results.searchTids).concat(results.categoryTids))); + tids = tids.filter(function (_tid) { return parseInt(_tid, 10) !== parseInt(tid, 10); }); @@ -59,10 +59,10 @@ module.exports = function (Topics) { function getSearchTids(tid, callback) { async.waterfall([ function (next) { - Topics.getTopicField(tid, 'title', next); + Topics.getTopicFields(tid, ['title', 'cid'], next); }, - function (title, next) { - search.searchQuery('topic', title, [], [], next); + function (topicData, next) { + search.searchQuery('topic', topicData.title, [topicData.cid], [], next); }, ], callback); }