mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-04 21:15:55 +01:00
closes #6728
add option to disable a category on creation show disabled categories on manage privileges
This commit is contained in:
@@ -68,5 +68,6 @@
|
||||
"alert.find-group": "Find a Group",
|
||||
"alert.group-search": "Search for a group here...",
|
||||
"collapse-all": "Collapse All",
|
||||
"expand-all": "Expand All"
|
||||
"expand-all": "Expand All",
|
||||
"disable-on-create": "Disable on create"
|
||||
}
|
||||
@@ -35,7 +35,7 @@ module.exports = function (Categories) {
|
||||
parentCid: parentCid,
|
||||
topic_count: 0,
|
||||
post_count: 0,
|
||||
disabled: 0,
|
||||
disabled: data.disabled ? 1 : 0,
|
||||
order: order,
|
||||
link: data.link || '',
|
||||
numRecentReplies: 1,
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
var async = require('async');
|
||||
|
||||
var db = require('../../database');
|
||||
var categories = require('../../categories');
|
||||
var privileges = require('../../privileges');
|
||||
|
||||
@@ -19,7 +20,19 @@ privilegesController.get = function (req, res, callback) {
|
||||
privileges.categories.list(cid, next);
|
||||
}
|
||||
},
|
||||
allCategories: async.apply(categories.buildForSelect, req.uid, 'read'),
|
||||
allCategories: function (next) {
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
db.getSortedSetRange('cid:0:children', 0, -1, next);
|
||||
},
|
||||
function (cids, next) {
|
||||
categories.getCategories(cids, req.uid, next);
|
||||
},
|
||||
function (categoriesData, next) {
|
||||
categories.buildForSelectCategories(categoriesData, next);
|
||||
},
|
||||
], next);
|
||||
},
|
||||
}, next);
|
||||
},
|
||||
function (data) {
|
||||
|
||||
@@ -25,6 +25,13 @@
|
||||
<input id="cloneChildren" name="cloneChildren" type="checkbox">
|
||||
<strong>[[admin/manage/categories:clone-children]]</strong>
|
||||
</label>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>
|
||||
<input id="disabled" name="disabled" type="checkbox">
|
||||
<strong>[[admin/manage/categories:disable-on-create]]</strong>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
Reference in New Issue
Block a user