Skip to content

Commit 47ccbf0

Browse files
committed
Replace the "Sent do all/selected students" input group with separate radios.
This is much better for translations.
1 parent 02be89e commit 47ccbf0

File tree

1 file changed

+28
-18
lines changed

1 file changed

+28
-18
lines changed

lib/WeBWorK/ContentGenerator/Instructor/SendMail.pm

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -688,24 +688,34 @@ sub print_form {
688688
CGI::div(
689689
{ class => 'col-md-6 mb-2' },
690690
CGI::div(
691-
{ class => 'input-group input-group-sm mb-2' },
692-
CGI::span({ class => 'input-group-text' }, CGI::strong($r->maketext('Send to:'))),
693-
CGI::div(
694-
{ class => 'input-group-text' },
695-
CGI::radio_group({
696-
name => 'send_to',
697-
values => [ 'all_students', 'studentID' ],
698-
labels => {
699-
all_students => $r->maketext('all students'),
700-
studentID => $r->maketext('selected students')
701-
},
702-
default => $r->param('send_to') // 'studentID',
703-
linebreak => 0,
704-
class => 'form-check-input me-1',
705-
labelattributes => { class => 'form-check-label mx-1' }
706-
})
707-
),
708-
CGI::label({ for => 'classList', class => 'input-group-text' }, $r->maketext('students')),
691+
{ class => 'form-check' },
692+
CGI::input({
693+
name => 'send_to',
694+
id => 'send_to_all',
695+
value => 'all_students',
696+
type => 'radio',
697+
class => 'form-check-input',
698+
(($r->param('send_to') // '') eq 'all_students') ? (checked => undef) : ()
699+
}),
700+
CGI::label(
701+
{ for => 'send_to_all', class => 'form-check-label' },
702+
$r->maketext('Send to all students')
703+
)
704+
),
705+
CGI::div(
706+
{ class => 'form-check' },
707+
CGI::input({
708+
name => 'send_to',
709+
id => 'send_to_selected',
710+
value => 'studentID',
711+
type => 'radio',
712+
class => 'form-check-input',
713+
(!$r->param('send_to') || $r->param('send_to') eq 'studentID') ? (checked => undef) : ()
714+
}),
715+
CGI::label(
716+
{ for => 'send_to_selected', class => 'form-check-label' },
717+
$r->maketext('Send to selected students')
718+
)
709719
),
710720
CGI::div(
711721
{ class => 'mb-2' },

0 commit comments

Comments
 (0)