Skip to content

Commit f42e4ed

Browse files
committed
Improve GroupRights UI for groups with many members
Show subgroup memberships in a collapsible <details> element below the group heading, expanded by default, so large member lists don't dominate the page.
1 parent 624f6a0 commit f42e4ed

1 file changed

Lines changed: 16 additions & 8 deletions

File tree

share/html/Admin/Elements/EditRights

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ for my $category (@$Principals) {
104104
my $id = "acl-" . $obj->PrincipalId;
105105
</%perl>
106106
<li class="rt-rights-role nav-item mb-1">
107-
<a href="#<% $id %>" class="nav-link" id="<% "principal-tab-$id" %>" data-bs-toggle="tab" role="tab" aria-controls="<% $id %>" aria-selected="false">
107+
<a href="#<% $id %>" class="nav-link small" id="<% "principal-tab-$id" %>" data-bs-toggle="tab" role="tab" aria-controls="<% $id %>" aria-selected="false">
108108
<% $loc ? loc($display) : $display %>
109109
</a>
110110
</li>
@@ -148,23 +148,31 @@ for my $category (@$Principals) {
148148
</%perl>
149149

150150
<div id="<% $id %>" class="tab-pane fade" role="tabpanel" aria-labelledby="<% $id %>-tab">
151-
<h3>
152-
<% $loc ? loc($display) : $display %>
151+
<h3><% $loc ? loc($display) : $display %></h3>
153152
<%perl>
154153
if ($obj->isa('RT::Group') and $obj->Domain eq 'UserDefined') {
155154
my $subgroups = $obj->GroupMembersObj( Recursively => 1 );
156155
$subgroups->LimitToUserDefinedGroups;
157156
$subgroups->Limit( FIELD => 'Name', OPERATOR => '!=', VALUE => $obj->Name, CASESENSITIVE => 0 );
158157

159158
if ( $subgroups->Count ) {
160-
my $inc = join ", ", map $_->Name, @{$subgroups->ItemsArrayRef};
161-
</%perl>
162-
<span class="subgroups"><&|/l, $inc &>includes [_1]</&></span>\
163-
<%perl>
159+
my $web_path = RT->Config->Get('WebPath');
160+
my @links = map {
161+
my $name = $m->interp->apply_escapes( $_->Name, 'h' );
162+
my $id = $_->id;
163+
qq{<a href="$web_path/Admin/Groups/Modify.html?id=$id">$name</a>}
164+
} @{$subgroups->ItemsArrayRef};
165+
my $count = scalar @links;
166+
my $summary = loc('Group memberships ([_1])', $count);
167+
$m->out(
168+
'<details class="mt-1" open>'
169+
. '<summary class="text-secondary">' . $summary . '</summary>'
170+
. '<p class="text-secondary small mt-1 ms-2">' . join(', ', @links) . '</p>'
171+
. '</details>'
172+
);
164173
}
165174
}
166175
</%perl>
167-
</h3>
168176
<& EditRightsCategoryTabs, Context => $Context, Principal => $obj, id => $id &>
169177
</div>
170178
<%perl>

0 commit comments

Comments
 (0)