From 6a289fbac96db0a800afe50834c05f2b6dd7151b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 29 Jul 2019 18:26:29 -0400 Subject: [PATCH] fix: #7789 --- install/data/defaults.json | 1 + .../en-GB/admin/manage/post-queue.json | 2 +- .../language/en-GB/admin/settings/post.json | 2 + src/posts/queue.js | 2 +- src/views/admin/manage/post-queue.tpl | 2 +- src/views/admin/settings/post.tpl | 41 +++++++++++-------- 6 files changed, 31 insertions(+), 19 deletions(-) diff --git a/install/data/defaults.json b/install/data/defaults.json index 3c9221aa1a..bfdcd18f1d 100644 --- a/install/data/defaults.json +++ b/install/data/defaults.json @@ -20,6 +20,7 @@ "chatDeleteDuration": 0, "chatMessageDelay": 200, "newbiePostDelayThreshold": 3, + "postQueueReputationThreshold": 0, "minimumPostLength": 8, "maximumPostLength": 32767, "minimumTagsPerTopic": 0, diff --git a/public/language/en-GB/admin/manage/post-queue.json b/public/language/en-GB/admin/manage/post-queue.json index 4de24c991b..2742e3a7af 100644 --- a/public/language/en-GB/admin/manage/post-queue.json +++ b/public/language/en-GB/admin/manage/post-queue.json @@ -1,6 +1,6 @@ { "post-queue": "Post Queue", - "description": "There are no posts in the post queue.
To enable this feature, go to Settings → Post → Posting Restrictions and enable Post Queue.", + "description": "There are no posts in the post queue.
To enable this feature, go to Settings → Post → Post Queue and enable Post Queue.", "user": "User", "category": "Category", "title": "Title", diff --git a/public/language/en-GB/admin/settings/post.json b/public/language/en-GB/admin/settings/post.json index 7fc74a4d6b..b10ebe2c35 100644 --- a/public/language/en-GB/admin/settings/post.json +++ b/public/language/en-GB/admin/settings/post.json @@ -7,9 +7,11 @@ "sorting.most-posts": "Most Posts", "sorting.topic-default": "Default Topic Sorting", "length": "Post Length", + "post-queue": "Post Queue", "restrictions": "Posting Restrictions", "restrictions-new": "New User Restrictions", "restrictions.post-queue": "Enable post queue", + "restrictions.post-queue-rep-threshold": "Reputation required to bypass post queue", "restrictions-new.post-queue": "Enable new user restrictions", "restrictions.post-queue-help": "Enabling post queue will put the posts of new users in a queue for approval", "restrictions-new.post-queue-help": "Enabling new user restrictions will set restrictions on posts created by new users", diff --git a/src/posts/queue.js b/src/posts/queue.js index f84e707c7a..e811eaaa16 100644 --- a/src/posts/queue.js +++ b/src/posts/queue.js @@ -16,7 +16,7 @@ var socketHelpers = require('../socket.io/helpers'); module.exports = function (Posts) { Posts.shouldQueue = async function (uid, data) { const userData = await user.getUserFields(uid, ['uid', 'reputation', 'postcount']); - const shouldQueue = meta.config.postQueue && (!userData.uid || userData.reputation < meta.config.newbiePostDelayThreshold || userData.postcount <= 0); + const shouldQueue = meta.config.postQueue && (!userData.uid || userData.reputation < meta.config.postQueueReputationThreshold || userData.postcount <= 0); const result = await plugins.fireHook('filter:post.shouldQueue', { shouldQueue: !!shouldQueue, uid: uid, diff --git a/src/views/admin/manage/post-queue.tpl b/src/views/admin/manage/post-queue.tpl index f06acf6832..0f605613ab 100644 --- a/src/views/admin/manage/post-queue.tpl +++ b/src/views/admin/manage/post-queue.tpl @@ -7,7 +7,7 @@

- [[admin/manage/post-queue:description, {config.relative_path}/admin/settings/post#posting-restrictions]] + [[admin/manage/post-queue:description, {config.relative_path}/admin/settings/post#post-queue]]

diff --git a/src/views/admin/settings/post.tpl b/src/views/admin/settings/post.tpl index 24060b1391..e558141158 100644 --- a/src/views/admin/settings/post.tpl +++ b/src/views/admin/settings/post.tpl @@ -94,6 +94,29 @@ + +
+ + +
+ +
+ + +
+ +
+ + +
+ + + + +
+
[[admin/settings/post:post-queue]]
+
+
@@ -110,22 +133,8 @@
- - -
-
-
-
-
-
- - -
-
-
-
- - + +