diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-05-25 15:57:51 +0300 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-05-25 16:00:52 +0300 |
commit | 4644841ba67e1e1f606011b51148303f59be3960 (patch) | |
tree | bed90cff434a5860c6cd8e4dc0171626c5c6a78f /settings/src | |
parent | 7b57c1a905e421955b14558b0142b0b88b368779 (diff) |
Do not show count on empty groups
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'settings/src')
-rw-r--r-- | settings/src/views/Users.vue | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/settings/src/views/Users.vue b/settings/src/views/Users.vue index da52efe4a60..17fe1bb9a56 100644 --- a/settings/src/views/Users.vue +++ b/settings/src/views/Users.vue @@ -234,12 +234,21 @@ export default { let item = {}; item.id = group.id.replace(' ', '_'); item.key = item.id; - item.router = { // router link to + item.utils = {} + + // router link to + item.router = { name: 'group', params: {selectedGroup: group.id} }; - item.text = group.name; // group name - item.utils = {counter: group.usercount - group.disabled}; // users count + + // group name + item.text = group.name; + + // users count + if (group.usercount - group.disabled > 0) { + item.utils.counter = group.usercount - group.disabled; + } if (item.id !== 'admin' && item.id !== 'disabled' && this.settings.isAdmin) { // add delete button on real groups @@ -268,13 +277,17 @@ export default { } // Add everyone group - groups.unshift({ + let everyoneGroup = { id: 'everyone', key: 'everyone', router: {name:'users'}, text: t('settings', 'Everyone'), - utils: {counter: this.userCount} - }); + }; + // users count + if (this.userCount > 0) { + everyoneGroup.utils = {counter: this.userCount}; + } + groups.unshift(everyoneGroup); // Return return { |