From 1dc6f5a4371f97458001a648e5ea4184ce9139e3 Mon Sep 17 00:00:00 2001 From: Jaimos Skriletz Date: Sat, 9 Nov 2024 12:45:41 -0700 Subject: [PATCH] Use checkbox list instead of select for admin users. This way it is harder to unselect the admin users, to avoid accidentally unselected them if ctrl isn't being held down. --- .../CourseAdmin/add_course_form.html.ep | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/templates/ContentGenerator/CourseAdmin/add_course_form.html.ep b/templates/ContentGenerator/CourseAdmin/add_course_form.html.ep index 1601558a99..78d54307aa 100644 --- a/templates/ContentGenerator/CourseAdmin/add_course_form.html.ep +++ b/templates/ContentGenerator/CourseAdmin/add_course_form.html.ep @@ -41,12 +41,18 @@ <%= maketext( 'Select admin course users to add to the new course (as the stated permission) below.') =%> -
- <%= select_field 'add-admin-users' => [ map { - my $val = $db->getPermissionLevel($_)->permission; - my $level = maketext((grep { $ce->{userRoles}{$_} eq $val } keys %{ $ce->{userRoles} })[0]); - [ "$_ ($level)" => $_, $val == 20 ? (selected => undef) : () ] } $db->listUsers ], - size => 5, multiple => undef, class =>'form-select mb-1' =%> +
+ % for my $user ($db->listUsers) { + % my $val = $db->getPermissionLevel($user)->permission; + % my $level = maketext((grep { $ce->{userRoles}{$_} eq $val } keys %{ $ce->{userRoles} })[0]); +
+ +
+ % }