mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: new nav items will show group select
This commit is contained in:
@@ -69,6 +69,7 @@ define('admin/general/navigation', ['translator', 'iconSelect', 'benchpress', 'j
|
||||
data.index = (parseInt($('#enabled').children().last().attr('data-index'), 10) || 0) + 1;
|
||||
data.title = translator.escape(data.title);
|
||||
data.text = translator.escape(data.text);
|
||||
data.groups = ajaxify.data.groups;
|
||||
Benchpress.parse('admin/general/navigation', 'navigation', { navigation: [data] }, function (li) {
|
||||
translator.translate(li, function (li) {
|
||||
li = $(translator.unescape(li));
|
||||
|
||||
@@ -13,13 +13,13 @@ navigationController.get = async function (req, res) {
|
||||
]);
|
||||
|
||||
allGroups.sort((a, b) => b.system - a.system);
|
||||
const groupsData = allGroups.map(group => ({ name: group.name, displayName: group.displayName }));
|
||||
|
||||
admin.groups = allGroups.map(group => ({ name: group.name, displayName: group.displayName }));
|
||||
admin.enabled.forEach(function (enabled, index) {
|
||||
enabled.index = index;
|
||||
enabled.selected = index === 0;
|
||||
|
||||
enabled.groups = groupsData.map(function (group) {
|
||||
enabled.groups = admin.groups.map(function (group) {
|
||||
return {
|
||||
displayName: group.displayName,
|
||||
selected: enabled.groups.includes(group.name),
|
||||
|
||||
Reference in New Issue
Block a user