Skip to content

Node.js based forum software built for the modern web

refactor: split registration-queue message

Barış Soner Uşaklı7564afc53b81
diff --git a/public/language/en-GB/registration-queue.json b/public/language/en-GB/registration-queue.json
index 43875f96d9..7d7e28e832 100644
--- a/public/language/en-GB/registration-queue.json
+++ b/public/language/en-GB/registration-queue.json
@@ -1,6 +1,7 @@
{
"queue": "Queue",
- "description": "There are no users in the registration queue. <br> To enable this feature, go to <a href=\"%1\">Settings &rarr; User &rarr; User Registration</a> and set <strong>Registration Type</strong> to \"Admin Approval\".",
+ "no-users-in-queue": "There are no users in the registration queue.",
+ "description": "To enable this feature, go to <a href=\"%1\">Settings &rarr; User &rarr; User Registration</a> and set <strong>Registration Type</strong> to \"Admin Approval\".",
"reject-all": "Reject All",
"reject-all-confirm": "Do you want to reject all registration requests?",
"list.name": "Name",
diff --git a/src/controllers/api.js b/src/controllers/api.js
index 7d5bc912fc..4c2f4dc2dd 100644
--- a/src/controllers/api.js
+++ b/src/controllers/api.js
@@ -30,7 +30,7 @@ apiController.loadConfig = async function (req) {
upload_url,
asset_base_url,
siteTitle: meta.config.title || meta.config.browserTitle || 'NodeBB',
- browserTitle: meta.config.browserTitle || meta.config.title || 'NodeB',
+ browserTitle: meta.config.browserTitle || meta.config.title || 'NodeBB',
description: meta.config.description || '',
keywords: meta.config.keywords || '',
'brand:logo': meta.config['brand:logo'],
diff --git a/src/controllers/globalmods.js b/src/controllers/globalmods.js
index 685f5bd1f2..1fad36a615 100644
--- a/src/controllers/globalmods.js
+++ b/src/controllers/globalmods.js
@@ -54,6 +54,7 @@ globalModsController.registrationQueue = async function (req, res, next) {
invites,
users,
registrationQueueCount,
+ queueEnabled: meta.config.registrationApprovalType === 'admin-approval' || meta.config.registrationApprovalType === 'admin-approval-ip',
});
};
diff --git a/src/views/registration-queue.tpl b/src/views/registration-queue.tpl
index 13b509923f..bdf939c294 100644
--- a/src/views/registration-queue.tpl
+++ b/src/views/registration-queue.tpl
@@ -39,15 +39,20 @@
aria-labelledby="registration-queue-tab"
tabindex="0"
>
+ {{{ if users.length }}}
<div class="text-end">
<button data-action="reject-all" class="btn btn-sm btn-light ff-secondary">[[registration-queue:reject-all]]</button>
</div>
+ {{{ end }}}
<div class="registration mb-3">
- {{{ if !users.length }}}
- <p class="">
- [[registration-queue:description, {config.relative_path}/admin/settings/user#user-registration]]
- </p>
+ {{{ if !queueEnabled }}}
+ <p>{{tx("registration-queue:description", concat(config.relative_path, "/admin/settings/user#user-registration"))}}</p>
{{{ end }}}
+ {{{ if queueEnabled }}}
+ {{{ end }}}
+ {{{ if !users.length }}}
+ <p>[[registration-queue:no-users-in-queue]]</p>
+ {{{ else }}}
<div class="table-responsive">
<table class="table table-sm text-sm users-list">
<thead>
@@ -136,6 +141,7 @@
</tbody>
</table>
</div>
+ {{{ end }}}
<!-- IMPORT admin/partials/paginator.tpl -->
</div>