[LON-CAPA-cvs] cvs: loncom /interface lonbulletin.pm lontemplate.pm

raeburn raeburn at source.lon-capa.org
Sat Dec 27 15:51:57 EST 2025


raeburn		Sat Dec 27 20:51:57 2025 EDT

  Modified files:              
    /loncom/interface	lonbulletin.pm lontemplate.pm 
  Log:
  - WCAG 2 compliance
    - Support "Skip to main content" when tabbing in page.
    - Headings descend sequentially
    - Include labels for form elements
  
  
Index: loncom/interface/lonbulletin.pm
diff -u loncom/interface/lonbulletin.pm:1.71 loncom/interface/lonbulletin.pm:1.72
--- loncom/interface/lonbulletin.pm:1.71	Wed Dec 24 18:36:07 2025
+++ loncom/interface/lonbulletin.pm	Sat Dec 27 20:51:57 2025
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Bulletin Board Handler
 #
-# $Id: lonbulletin.pm,v 1.71 2025/12/24 18:36:07 raeburn Exp $
+# $Id: lonbulletin.pm,v 1.72 2025/12/27 20:51:57 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -168,7 +168,8 @@
                                             'bread_crumbs'   => $brcrum, 
                                             'group'          => $group,
                                             'force_register' => $registered}
-                                          );
+                                          )
+           .'<div class="LC_landmark" role="main" id="LC_main_content">'."\n";
         $r->print($start_page);
     }
     my ($allowed);
@@ -228,7 +229,11 @@
         #Print Topic as Heading
         my $titletext=&HTML::Entities::encode($syllabus{'aaa_title'},'<>&"');
         if ($target ne 'tex') {
-            $r->print('<h2>'.$titletext.'</h2>');
+            if ($titletext eq '') {
+                $r->print('<h2 class="LC_visually_hidden">'.&mt('No board title set yet').'</h2>');
+            } else {
+                $r->print('<h2>'.$titletext.'</h2>');
+            }
         } else {
             $r->print('\\\\\textbf{'.&Apache::lonxml::xmlparse($r,'tex',$titletext).'}\\\\');
         }
@@ -252,12 +257,13 @@
         #Outputbox and Inputbox for Image upload
         if ($allowed) {
         	my $message = '<img src="'.$syllabus{'uploaded.photourl'}.'" alt="'.&mt('Image').'"/>';
-        	&Apache::lontemplate::print_start_template($r, &mt('Upload a Photo'),'LC_Box');
+                &Apache::lontemplate::print_start_template($r, '<label for="uploaddoc">'.
+                                                           &mt('Upload a Photo').'</label>','LC_Box');
             $r->print($message);
             $r->print("<br /><br />");
             $r->print(
                 '<input type="hidden" name="forceedit" value="'.$env{'form.forceedit'}.'" />'.
-                '<input type="file" name="uploaddoc" size="50" />'.
+                '<input type="file" name="uploaddoc" id="uploaddoc" size="50" />'.
                 '<input type="submit" name="storeupl" value="'.&mt('Upload').'" />');
             &Apache::lontemplate::print_end_template($r);
         }
@@ -285,9 +291,11 @@
     }
     #Lists discussion posts and box for a new discussion post.
     if ($target ne 'tex') {
-        $r->print(&Apache::lonfeedback::list_discussion
-                      ('board','OPEN','bulletin___'.$marker.'___'.
-                       $r->uri,undef,$group));
+        unless ($allowed) {
+            $r->print(&Apache::lonfeedback::list_discussion
+                          ('board','OPEN','bulletin___'.$marker.'___'.
+                           $r->uri,undef,$group));
+        }
     } else {
         $r->print('\\\\'.&Apache::lonxml::xmlparse($r,'tex',&Apache::lonfeedback::list_discussion
                      ('board','OPEN','bulletin___'.$marker.'___'.
@@ -300,7 +308,7 @@
 sub print_end_page {
     my ($r,$target) = @_;
     if ($target ne 'tex') {
-        $r->print(&Apache::loncommon::end_page());
+        $r->print('</div>'.&Apache::loncommon::end_page());
     } else {
         $r->print('\end{document}');
     }
Index: loncom/interface/lontemplate.pm
diff -u loncom/interface/lontemplate.pm:1.52 loncom/interface/lontemplate.pm:1.53
--- loncom/interface/lontemplate.pm:1.52	Tue Jan 28 19:49:20 2025
+++ loncom/interface/lontemplate.pm	Sat Dec 27 20:51:57 2025
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # "Template" Functions to generate html output
 #
-# $Id: lontemplate.pm,v 1.52 2025/01/28 19:49:20 raeburn Exp $
+# $Id: lontemplate.pm,v 1.53 2025/12/27 20:51:57 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -109,7 +109,7 @@
 sub print_template {
 	my ($r,$topic,$content, $allowed,$boxclass) = @_;
 	$r->print('<div class="'.$boxclass.'">');
-	$r->print('<h4 class="LC_hcell">'.$topic.'</h4>');
+	$r->print('<h3 class="LC_heading_3 LC_hcell">'.$topic.'</h3>');
 	$r->print($content);
 	$r->print('</div>');
 }
@@ -121,7 +121,7 @@
             $idattrib = ' id="'.$id.'"';
         }
 	$r->print('<div class="'.$boxclass.'"'.$idattrib.$display.'>');
-	$r->print('<h4 class="LC_hcell">'.$topic.'</h4>');
+	$r->print('<h3 class="LC_heading_3 LC_hcell">'.$topic.'</h3>');
 }
 
 sub print_end_template {




More information about the LON-CAPA-cvs mailing list