mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-05 05:25:49 +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.find-group": "Find a Group",
|
||||||
"alert.group-search": "Search for a group here...",
|
"alert.group-search": "Search for a group here...",
|
||||||
"collapse-all": "Collapse All",
|
"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,
|
parentCid: parentCid,
|
||||||
topic_count: 0,
|
topic_count: 0,
|
||||||
post_count: 0,
|
post_count: 0,
|
||||||
disabled: 0,
|
disabled: data.disabled ? 1 : 0,
|
||||||
order: order,
|
order: order,
|
||||||
link: data.link || '',
|
link: data.link || '',
|
||||||
numRecentReplies: 1,
|
numRecentReplies: 1,
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
var async = require('async');
|
var async = require('async');
|
||||||
|
|
||||||
|
var db = require('../../database');
|
||||||
var categories = require('../../categories');
|
var categories = require('../../categories');
|
||||||
var privileges = require('../../privileges');
|
var privileges = require('../../privileges');
|
||||||
|
|
||||||
@@ -19,7 +20,19 @@ privilegesController.get = function (req, res, callback) {
|
|||||||
privileges.categories.list(cid, next);
|
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);
|
}, next);
|
||||||
},
|
},
|
||||||
function (data) {
|
function (data) {
|
||||||
|
|||||||
@@ -25,6 +25,13 @@
|
|||||||
<input id="cloneChildren" name="cloneChildren" type="checkbox">
|
<input id="cloneChildren" name="cloneChildren" type="checkbox">
|
||||||
<strong>[[admin/manage/categories:clone-children]]</strong>
|
<strong>[[admin/manage/categories:clone-children]]</strong>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label>
|
||||||
|
<input id="disabled" name="disabled" type="checkbox">
|
||||||
|
<strong>[[admin/manage/categories:disable-on-create]]</strong>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
Reference in New Issue
Block a user