[LON-CAPA-cvs] cvs: loncom /interface loncoursedata.pm lonhtmlcommon.pm lonuserutils.pm
raeburn
raeburn at source.lon-capa.org
Wed Apr 29 20:27:07 EDT 2026
raeburn Thu Apr 30 00:27:07 2026 EDT
Modified files:
/loncom/interface loncoursedata.pm lonhtmlcommon.pm lonuserutils.pm
Log:
- WCAG 2 compliance.
Include labels for form elements.
Group form elements in fieldset with legend for screenreaders.
Satisfy minimum spacing between touch targets.
-------------- next part --------------
Index: loncom/interface/loncoursedata.pm
diff -u loncom/interface/loncoursedata.pm:1.212 loncom/interface/loncoursedata.pm:1.213
--- loncom/interface/loncoursedata.pm:1.212 Tue Sep 9 05:01:24 2025
+++ loncom/interface/loncoursedata.pm Thu Apr 30 00:27:07 2026
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: loncoursedata.pm,v 1.212 2025/09/09 05:01:24 raeburn Exp $
+# $Id: loncoursedata.pm,v 1.213 2026/04/30 00:27:07 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2636,6 +2636,7 @@
sub CL_AUTHORQUOTA { return 18; }
sub CL_AUTHORUSAGE { return 19; }
sub CL_CAMANAGER {return 20; }
+sub CL_NUMCIDS { return 21; }
sub get_classlist {
my ($cdom,$cnum) = @_;
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.430 loncom/interface/lonhtmlcommon.pm:1.431
--- loncom/interface/lonhtmlcommon.pm:1.430 Tue Apr 28 02:36:03 2026
+++ loncom/interface/lonhtmlcommon.pm Thu Apr 30 00:27:07 2026
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common html routines
#
-# $Id: lonhtmlcommon.pm,v 1.430 2026/04/28 02:36:03 raeburn Exp $
+# $Id: lonhtmlcommon.pm,v 1.431 2026/04/30 00:27:07 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2723,7 +2723,7 @@
.$pickspec.'</label>'
.' '.$courseform.' '
.&mt('[_1] selected.',
- '<input type="text" value="0" size="4" name="coursetotal" readonly="readonly" />'
+ '<input type="text" value="0" size="2" name="coursetotal" readonly="readonly" aria-label="'.&mt('Total selected (set automatically)').'" />'
.'<input type="hidden" name="courselist" value="" />')
.'<br />'."\n";
return $output;
Index: loncom/interface/lonuserutils.pm
diff -u loncom/interface/lonuserutils.pm:1.231 loncom/interface/lonuserutils.pm:1.232
--- loncom/interface/lonuserutils.pm:1.231 Sat Apr 18 06:39:48 2026
+++ loncom/interface/lonuserutils.pm Thu Apr 30 00:27:07 2026
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Utility functions for managing LON-CAPA user accounts
#
-# $Id: lonuserutils.pm,v 1.231 2026/04/18 06:39:48 raeburn Exp $
+# $Id: lonuserutils.pm,v 1.232 2026/04/30 00:27:07 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1698,7 +1698,14 @@
sub forceid_change {
my ($context) = @_;
- my $output =
+ my $output;
+ if ($context eq 'domain') {
+ $output = '<fieldset class="LC_borderless" style="line-height: 185%;">'
+ .'<legend class="LC_visually_hidden">'
+ .&mt('Actions to take if student/employee ID changed')
+ .'</legend>';
+ }
+ $output .=
'<label><input type="checkbox" name="forceid" value="yes" />'
.&mt('Force change of existing ID')
.'</label>'.&Apache::loncommon::help_open_topic('ForceIDChange')."\n";
@@ -1706,7 +1713,8 @@
$output .=
'<br />'
.'<label><input type="checkbox" name="recurseid" value="yes" />'
- .&mt("Update ID in user's course(s).").'</label>'."\n";
+ .&mt("Update ID in user's course(s).").'</label>'
+ .'</fieldset>'."\n";
}
return $output;
}
@@ -2314,7 +2322,7 @@
$codetitles,$idlist,$idlist_titles,$crstype,
\@standardnames);
$r->print('<div class="LC_left_float">'.
- '<fieldset><legend>'.$title.'</legend>'."\n".
+ '<fieldset style="line-height: 185%;"><legend>'.$title.'</legend>'."\n".
$courseform."\n".
'</fieldset></div><br clear="all" />'.
'<p><input type="hidden" name="origroletype" value="'.$env{'form.roletype'}.'" />'.
@@ -2905,6 +2913,8 @@
}
}
}
+ $userdata{'extent'} =~ s{\Q<br />\E$}{};
+ $userdata{'numcids'} = $numcids;
}
if ($userdata{'status'} ne '') {
&build_user_record($context,\%userdata,$userinfo,
@@ -3099,6 +3109,7 @@
$index->{'authorquota'} = &Apache::loncoursedata::CL_AUTHORQUOTA();
$index->{'authorusage'} = &Apache::loncoursedata::CL_AUTHORUSAGE();
$index->{'manager'} = &Apache::loncoursedata::CL_CAMANAGER();
+ $index->{'numcids'} = &Apache::loncoursedata::CL_NUMCIDS();
foreach my $key (keys(%{$index})) {
$keylist->[$index->{$key}] = $key;
}
@@ -3317,7 +3328,7 @@
$context,$permission,$mode,$crstype);
$r->print('<b>'.$results_description.'</b><br clear="all" />');
}
- my ($output,$actionselect,%canchange,%canchangesec);
+ my ($output,$actionselect,$unamesty,$extent_cdescs,%canchange,%canchangesec);
if ($mode eq 'html' || $mode eq 'view' || $mode eq 'autoenroll' || $mode eq 'pickauthor') {
if ($mode ne 'autoenroll' && $mode ne 'pickauthor') {
if ($permission->{'cusr'}) {
@@ -3442,6 +3453,14 @@
$output .= "\n<th>#</th>\n";
if ($actionselect) {
$output .= '<th class="LC_nobreak" valign="top">'.&mt('select').'</th>'."\n";
+ } else {
+ $unamesty = ' style="line-height: 170%;"';
+ if (($context eq 'domain') &&
+ (($setting eq 'course') || ($setting eq 'community'))) {
+ if (grep(/^extent$/, at cols)) {
+ $extent_cdescs = 1;
+ }
+ }
}
}
foreach my $item (@cols) {
@@ -3905,7 +3924,12 @@
}
foreach my $item (@cols) {
if ($item eq 'username') {
- $r->print('<td>'.&print_username_link($mode,\%in).'</td>');
+ if (($unamesty) && ((!$extent_cdescs) || ($in{'numcids'} <= 1))) {
+ $r->print('<td'.$unamesty.'>');
+ } else {
+ $r->print('<td>');
+ }
+ $r->print(&print_username_link($mode,\%in).'</td>');
} elsif ($item eq 'status') {
my $showitem = $in{$item};
if (defined($ltstatus{$in{$item}})) {
More information about the LON-CAPA-cvs
mailing list