diff --git a/group_manager/static/group_manager/js/group_manager.js b/group_manager/static/group_manager/js/group_manager.js
index e3a6e331..0a145d4a 100644
--- a/group_manager/static/group_manager/js/group_manager.js
+++ b/group_manager/static/group_manager/js/group_manager.js
@@ -2408,32 +2408,28 @@ $(function () {
$groupPanel.find('.create-button').removeClass('disabled')
}
- let a = ''
// Indicate which groups are managed by this user.
+ const groupList = document.querySelector('#group-list')
+ let icons = ''
for (const groupName in this.groups) {
- a = '
'
+ const group = groupList.querySelector('.group[data-name="' + Yoda.escapeQuotes(groupName) + '"]')
+
+ icons = ''
if (groupName.match(/^(research)-/)) {
- a += ' | '
+ icons += ' | '
}
if (this.isManagerOfGroup(groupName)) {
- $('#group-list .group[data-name="' + Yoda.escapeQuotes(groupName) + '"]').append(
- a + ' ' + ' |
'
- )
+ icons += ' ' + ' |
'
} else if (!this.isMemberOfGroup(groupName) && this.isRodsAdmin) {
- $('#group-list .group[data-name="' + Yoda.escapeQuotes(groupName) + '"]').append(
- a + ' ' + ' | '
- )
+ icons += ' ' + ' | '
} else if (this.isMemberOfGroup(groupName) && this.groups[groupName].members[this.userNameFull].access === 'reader') {
- $('#group-list .group[data-name="' + Yoda.escapeQuotes(groupName) + '"]').append(
- a + ' ' + ' | '
- )
+ icons += ' ' + ' | '
} else {
- $('#group-list .group[data-name="' + Yoda.escapeQuotes(groupName) + '"]').append(
- a + ' | '
- )
+ icons += ' | '
}
+ group.insertAdjacentHTML('beforeend', icons)
}
const isCollapsed = Yoda.storage.session.get('is-collapsed')