[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm lonuserutils.pm
raeburn
raeburn at source.lon-capa.org
Sat Apr 18 02:39:48 EDT 2026
raeburn Sat Apr 18 06:39:48 2026 EDT
Modified files:
/loncom/interface lonuserutils.pm loncommon.pm
Log:
- WCAG 2.2 compliance -- satisfy minimum spacing between touch targets.
Index: loncom/interface/lonuserutils.pm
diff -u loncom/interface/lonuserutils.pm:1.230 loncom/interface/lonuserutils.pm:1.231
--- loncom/interface/lonuserutils.pm:1.230 Sat Apr 18 06:35:05 2026
+++ loncom/interface/lonuserutils.pm Sat Apr 18 06:39:48 2026
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Utility functions for managing LON-CAPA user accounts
#
-# $Id: lonuserutils.pm,v 1.230 2026/04/18 06:35:05 raeburn Exp $
+# $Id: lonuserutils.pm,v 1.231 2026/04/18 06:39:48 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -3338,8 +3338,11 @@
$output .= <<"END";
<div class="LC_left_float"><fieldset><legend>$lt{'ac'}</legend>
$actionselect
-<br/><br /><input type="button" value="$lt{'ca'}" onclick="javascript:checkAll(document.$formname.actionlist)" />
-<input type="button" value="$lt{'ua'}" onclick="javascript:uncheckAll(document.$formname.actionlist)" /><br /><input type="button" value="$lt{'pr'}" onclick="javascript:verify_action('actionlist')" /></fieldset></div>
+<br /><br />
+<div style="display: inline-block; margin: 0 0 2px 0; padding: 0; line-height: 180%;">
+<input type="button" value="$lt{'ca'}" onclick="javascript:checkAll(document.$formname.actionlist)" />
+<input type="button" value="$lt{'ua'}" onclick="javascript:uncheckAll(document.$formname.actionlist)" /></div>
+<br /><input type="button" value="$lt{'pr'}" onclick="javascript:verify_action('actionlist')" /></fieldset></div>
END
my @allroles;
if ($env{'form.showrole'} eq 'Any') {
@@ -3388,7 +3391,7 @@
}
}
$output .= '<div class="LC_left_float"><fieldset><legend>'.$lt{'link'}.'</legend>'
- .'<div class="LC_floatleft" style="text-align: top">';
+ .'<div class="LC_floatleft" style="text-align: top; line-height: 185%;">';
my @linkdests = ('aboutme');
if ($permission->{'cusr'}) {
unshift (@linkdests,'modify');
@@ -3421,10 +3424,10 @@
}
$output .=
'</div><div class="LC_floatleft" style="border-left: 0px; vertical-align: top;">'
- .'<div class="LC_floatleft" style="border-left: 1px solid; margin: 0 0 0 10px; vertical-align: middle;">'
+ .'<div class="LC_floatleft" style="border-left: 1px solid; margin: 0 0 0 10px; vertical-align: middle; line-height: 200%;">'
.'<br /><span class="LC_nobreak"> <label>'
.'<input type="checkbox" name="userwin" value="1"'.$checkwin.' />'.$lt{'owin'}
- .'</label></span><br /><br /></div></fieldset></div>';
+ .'</label></span><br /><br /></div></div></fieldset></div>';
}
$output .= "\n".'<div style="padding:0;clear:both;margin:0;border:0"></div>'."\n".
&Apache::loncommon::start_data_table().
@@ -3825,7 +3828,7 @@
'<legend class="LC_visually_hidden">'.&mt('Enrollment type action').'</legend>'."\n".
'<table border="0" cellspacing="0">'."\n".
'<tr><th class="LC_enrolltype" rowspan="2">'.&mt('manual').'</th>'.
- '<td><span class="LC_nobreak">'.
+ '<td><span class="LC_nobreak" style="line-height: 170%;">'.
'<label><input type="checkbox" name="chgmanual" '.
'value="'.$in{'username'}.':'.$in{'domain'}.'"'.$disabled.' /> '.
&mt('Change').'</label></span></td></tr>'."\n".
@@ -4883,7 +4886,8 @@
&mt("How do I create a CSV file from a spreadsheet"))
."</div>\n";
$str .= &Apache::lonhtmlcommon::start_pick_box()
- .&Apache::lonhtmlcommon::row_title('<label for="upfile">'.&mt('File').'</label>');
+ .&Apache::lonhtmlcommon::row_title('<label for="upfile">'.&mt('File').'</label>','','',
+ 'style="line-height: 190%;"');
if (&Apache::lonlocal::current_language() ne 'en') {
if ($context eq 'course') {
$str .= '<p class="LC_info">'."\n"
@@ -7643,20 +7647,39 @@
&Apache::loncommon::end_data_table_header_row();
foreach my $priv (sort(keys(%{$full}))) {
my $privtext = &Apache::lonnet::plaintext($priv,$crstype);
- $output .= &Apache::loncommon::start_data_table_row().
- '<td><span id="'.$prefix.$priv.'">'.$privtext.'</span></td>';
+ my ($labelfor,$td_output);
foreach my $type ('course','domain','system') {
if (($type eq 'system') && ($priv eq 'bre') && ($crstype eq 'Community')) {
- $output .= '<td> </td>';
+ $td_output .= '<td> </td>';
} else {
- $output .= '<td>'.
+ my $arialabel;
+ if ($levels->{$type}{$priv}) {
+ if ($priv eq 'bre') {
+ my $no_mt_privtext = $Apache::lonnet::prp{$priv}{'std'};
+ my $showtype = $type;
+ if ($type eq 'course') {
+ $showtype = lc($crstype);
+ if ($crstype eq 'Community') {
+ $no_mt_privtext = $Apache::lonnet::prp{$priv}{'alt1'};
+ }
+ }
+ $arialabel = ' aria-label="'.&mt("$no_mt_privtext in $showtype").'"';
+ } else {
+ $labelfor = $prefix.$priv.$cr{$type};
+ }
+ }
+ $td_output .= '<td>'.
($levels->{$type}{$priv}?'<input type="checkbox" id="'.$prefix.$priv.$cr{$type}.'"'.
' name="'.$prefix.$priv.$cr{$type}.'"'.
- ($levelscurrent->{$type}{$priv}?' checked="checked"':'').' />':' ').
+ ($levelscurrent->{$type}{$priv}?' checked="checked"':'').$arialabel.' />':' ').
'</td>';
}
}
- $output .= &Apache::loncommon::end_data_table_row();
+ $output .= &Apache::loncommon::start_data_table_row().
+ '<td><span id="'.$prefix.$priv.'">'.
+ ($labelfor?'<label for="'.$labelfor.'">'.$privtext.'</label>':$privtext).
+ '</span></td>'.$td_output.
+ &Apache::loncommon::end_data_table_row();
}
$output .= &Apache::loncommon::end_data_table();
return $output;
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1513 loncom/interface/loncommon.pm:1.1514
--- loncom/interface/loncommon.pm:1.1513 Sat Apr 18 04:29:00 2026
+++ loncom/interface/loncommon.pm Sat Apr 18 06:39:48 2026
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.1513 2026/04/18 04:29:00 raeburn Exp $
+# $Id: loncommon.pm,v 1.1514 2026/04/18 06:39:48 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -16096,12 +16096,14 @@
tab => &mt('Tabulator separated'),
# xml => &mt('HTML/XML'),
);
- my $Str = '<input type="file" name="upfile" id="upfile" size="50" />'.
- '<br /><label>'.&mt('Type').': <select name="upfiletype">';
+ my $Str = '<span style="line-height: 185%;">'.
+ '<input type="file" name="upfile" id="upfile" size="50" /></span>'.
+ '<br /><span style="line-height: 185%">'.
+ '<label>'.&mt('Type').': <select name="upfiletype">';
foreach my $type (sort(keys(%Types))) {
$Str .= '<option value="'.$type.'" >'.$Types{$type}."</option>\n";
}
- $Str .= "</select></label>\n";
+ $Str .= "</select></label></span>\n";
return $Str;
}
More information about the LON-CAPA-cvs
mailing list