fix privilege filters

This commit is contained in:
Barış Soner Uşaklı
2022-09-13 10:17:41 -04:00
parent d2e972cf6c
commit b25a0769d5
3 changed files with 30 additions and 22 deletions

View File

@@ -36,7 +36,7 @@ define('admin/manage/privileges', [
Privileges.setupPrivilegeTable();
highlightRow();
$('.privilege-filters button:last-child').click();
$('.privilege-filters button:first-child').click();
};
Privileges.setupPrivilegeTable = function () {
@@ -133,7 +133,7 @@ define('admin/manage/privileges', [
throwConfirmModal('copyToAllGroup', Privileges.copyPrivilegesToAllCategories.bind(null, cid, groupName));
});
$privTableCon.on('click', '.privilege-filters > button', filterPrivileges);
$privTableCon.on('click', '.privilege-filters button', filterPrivileges);
mousetrap.bind('ctrl+s', function (ev) {
throwConfirmModal('save', Privileges.commit);

View File

@@ -2,13 +2,15 @@
<table class="table table-striped privilege-table">
<thead>
<tr class="privilege-table-header">
<th class="privilege-filters btn-toolbar" colspan="100">
<th class="privilege-filters" colspan="100">
<div class="btn-toolbar justify-content-end gap-1">
<button type="button" data-filter="3,5" class="btn btn-outline-secondary">[[admin/manage/categories:privileges.section-viewing]]</button>
<button type="button" data-filter="6,15" class="btn btn-outline-secondary">[[admin/manage/categories:privileges.section-posting]]</button>
<button type="button" data-filter="16,18" class="btn btn-outline-secondary">[[admin/manage/categories:privileges.section-moderation]]</button>
<!-- IF privileges.columnCountGroupOther -->
<button type="button" data-filter="19,99" class="btn btn-outline-secondary float-end">[[admin/manage/categories:privileges.section-other]]</button>
<button type="button" data-filter="19,99" class="btn btn-outline-secondary">[[admin/manage/categories:privileges.section-other]]</button>
<!-- END -->
<button type="button" data-filter="16,18" class="btn btn-outline-secondary float-end">[[admin/manage/categories:privileges.section-moderation]]</button>
<button type="button" data-filter="6,15" class="btn btn-outline-secondary float-end">[[admin/manage/categories:privileges.section-posting]]</button>
<button type="button" data-filter="3,5" class="btn btn-outline-secondary float-end">[[admin/manage/categories:privileges.section-viewing]]</button>
</div>
</th>
</tr><tr><!-- zebrastripe reset --></tr>
<tr>
@@ -85,13 +87,15 @@
<table class="table table-striped privilege-table">
<thead>
<tr class="privilege-table-header">
<th class="privilege-filters btn-toolbar" colspan="100">
<th class="privilege-filters" colspan="100">
<div class="btn-toolbar justify-content-end gap-1">
<button type="button" data-filter="3,5" class="btn btn-outline-secondary">[[admin/manage/categories:privileges.section-viewing]]</button>
<button type="button" data-filter="6,15" class="btn btn-outline-secondary">[[admin/manage/categories:privileges.section-posting]]</button>
<button type="button" data-filter="16,18" class="btn btn-outline-secondary">[[admin/manage/categories:privileges.section-moderation]]</button>
<!-- IF privileges.columnCountUserOther -->
<button type="button" data-filter="19,99" class="btn btn-outline-secondary float-end">[[admin/manage/categories:privileges.section-other]]</button>
<button type="button" data-filter="19,99" class="btn btn-outline-secondary">[[admin/manage/categories:privileges.section-other]]</button>
<!-- END -->
<button type="button" data-filter="16,18" class="btn btn-outline-secondary float-end">[[admin/manage/categories:privileges.section-moderation]]</button>
<button type="button" data-filter="6,15" class="btn btn-outline-secondary float-end">[[admin/manage/categories:privileges.section-posting]]</button>
<button type="button" data-filter="3,5" class="btn btn-outline-secondary float-end">[[admin/manage/categories:privileges.section-viewing]]</button>
</div>
</th>
</tr><tr><!-- zebrastripe reset --></tr>
<tr>

View File

@@ -3,13 +3,15 @@
<thead>
{{{ if !isAdminPriv }}}
<tr class="privilege-table-header">
<th class="privilege-filters btn-toolbar" colspan="100">
<th class="privilege-filters" colspan="100">
<div class="btn-toolbar justify-content-end gap-1">
<button type="button" data-filter="9,15" class="btn btn-outline-secondary">[[admin/manage/categories:privileges.section-viewing]]</button>
<button type="button" data-filter="3,8" class="btn btn-outline-secondary">[[admin/manage/categories:privileges.section-posting]]</button>
<button type="button" data-filter="16,18" class="btn btn-outline-secondary">[[admin/manage/categories:privileges.section-moderation]]</button>
<!-- IF privileges.columnCountGroupOther -->
<button type="button" data-filter="19,99" class="btn btn-outline-secondary float-end">[[admin/manage/categories:privileges.section-other]]</button>
<button type="button" data-filter="19,99" class="btn btn-outline-secondary">[[admin/manage/categories:privileges.section-other]]</button>
<!-- END -->
<button type="button" data-filter="16,18" class="btn btn-outline-secondary float-end">[[admin/manage/categories:privileges.section-moderation]]</button>
<button type="button" data-filter="3,8" class="btn btn-outline-secondary float-end">[[admin/manage/categories:privileges.section-posting]]</button>
<button type="button" data-filter="9,15" class="btn btn-outline-secondary float-end">[[admin/manage/categories:privileges.section-viewing]]</button>
</div>
</th>
</tr><tr><!-- zebrastripe reset --></tr>
{{{ end }}}
@@ -65,13 +67,15 @@
<thead>
{{{ if !isAdminPriv }}}
<tr class="privilege-table-header">
<th class="privilege-filters btn-toolbar" colspan="100">
<th class="privilege-filters" colspan="100">
<div class="btn-toolbar justify-content-end gap-1">
<button type="button" data-filter="9,15" class="btn btn-outline-secondary">[[admin/manage/categories:privileges.section-viewing]]</button>
<button type="button" data-filter="16,18" class="btn btn-outline-secondary">[[admin/manage/categories:privileges.section-moderation]]</button>
<button type="button" data-filter="3,8" class="btn btn-outline-secondary">[[admin/manage/categories:privileges.section-posting]]</button>
<!-- IF privileges.columnCountUserOther -->
<button type="button" data-filter="19,99" class="btn btn-outline-secondary float-end">[[admin/manage/categories:privileges.section-other]]</button>
<button type="button" data-filter="19,99" class="btn btn-outline-secondary">[[admin/manage/categories:privileges.section-other]]</button>
<!-- END -->
<button type="button" data-filter="16,18" class="btn btn-outline-secondary float-end">[[admin/manage/categories:privileges.section-moderation]]</button>
<button type="button" data-filter="3,8" class="btn btn-outline-secondary float-end">[[admin/manage/categories:privileges.section-posting]]</button>
<button type="button" data-filter="9,15" class="btn btn-outline-secondary float-end">[[admin/manage/categories:privileges.section-viewing]]</button>
</div>
</th>
</tr><tr><!-- zebrastripe reset --></tr>
{{{ end }}}