Skip to content

Commit

Permalink
feat: quick access dropdown on groups page to access privileges page
Browse files Browse the repository at this point in the history
  • Loading branch information
psychobunny committed Jul 23, 2020
1 parent 06143ca commit 2c83278
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions public/src/admin/manage/group.js
Expand Up @@ -88,6 +88,13 @@ define('admin/manage/group', [
});
});

$('[component="category/list"] [data-cid]').on('click', function () {
var cid = $(this).attr('data-cid');
if (cid) {
ajaxify.go('admin/manage/privileges/' + cid);
}
});

colorpicker.enable(changeGroupLabelColor, function (hsb, hex) {
groupLabelPreview.css('background-color', '#' + hex);
});
Expand Down
4 changes: 4 additions & 0 deletions src/controllers/admin/groups.js
Expand Up @@ -5,6 +5,7 @@ const validator = require('validator');

const db = require('../../database');
const user = require('../../user');
const categories = require('../../categories');
const groups = require('../../groups');
const meta = require('../../meta');
const pagination = require('../../pagination');
Expand Down Expand Up @@ -50,12 +51,15 @@ groupsController.get = async function (req, res, next) {
};
});

const allCategories = await categories.buildForSelectAll();

res.render('admin/manage/group', {
group: group,
groupNames: groupNameData,
allowPrivateGroups: meta.config.allowPrivateGroups,
maximumGroupNameLength: meta.config.maximumGroupNameLength,
maximumGroupTitleLength: meta.config.maximumGroupTitleLength,
categories: allCategories,
});
};

Expand Down
5 changes: 5 additions & 0 deletions src/views/admin/manage/group.tpl
Expand Up @@ -113,6 +113,11 @@
<option value="{groupNames.encodedName}" <!-- IF groupNames.selected -->selected<!-- ENDIF groupNames.selected -->>{groupNames.displayName}</option>
<!-- END groupNames -->
</select>
<br />
<div class="well">
<strong class="pull-left">[[admin/manage/privileges:edit-privileges]]</strong><br />
<!-- IMPORT partials/category-selector.tpl -->
</div>
</div>
</form>
</div>
Expand Down

0 comments on commit 2c83278

Please sign in to comment.