mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
feat: warn user if whitelisted tags are less than minTags
This commit is contained in:
@@ -76,6 +76,7 @@
|
|||||||
"alert.user-search": "Search for a user here...",
|
"alert.user-search": "Search for a user here...",
|
||||||
"alert.find-group": "Find a Group",
|
"alert.find-group": "Find a Group",
|
||||||
"alert.group-search": "Search for a group here...",
|
"alert.group-search": "Search for a group here...",
|
||||||
|
"alert.not-enough-whitelisted-tags": "Whitelisted tags are less than minimum tags, you need to create more whitelisted tags!",
|
||||||
"collapse-all": "Collapse All",
|
"collapse-all": "Collapse All",
|
||||||
"expand-all": "Expand All",
|
"expand-all": "Expand All",
|
||||||
"disable-on-create": "Disable on create"
|
"disable-on-create": "Disable on create"
|
||||||
|
|||||||
@@ -48,6 +48,11 @@ define('admin/manage/category', [
|
|||||||
$('[data-name="bgColor"], [data-name="color"]').each(enableColorPicker);
|
$('[data-name="bgColor"], [data-name="color"]').each(enableColorPicker);
|
||||||
|
|
||||||
$('#save').on('click', function () {
|
$('#save').on('click', function () {
|
||||||
|
var tags = $('#tag-whitelist').val() ? $('#tag-whitelist').val().split(',') : [];
|
||||||
|
if (tags.length && tags.length < parseInt($('#cid-min-tags').val(), 10)) {
|
||||||
|
return app.alertError('[[admin/manage/categories:alert.not-enough-whitelisted-tags]]');
|
||||||
|
}
|
||||||
|
|
||||||
if (Object.keys(modified_categories).length) {
|
if (Object.keys(modified_categories).length) {
|
||||||
socket.emit('admin.categories.update', modified_categories, function (err, result) {
|
socket.emit('admin.categories.update', modified_categories, function (err, result) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|||||||
Reference in New Issue
Block a user