------------------------------------------------------------
revno: 1719
committer: Mark Sapiro <m...@msapiro.net>
branch nick: 2.1
timestamp: Sat 2017-06-24 14:34:48 -0700
message:
  Added screen reader labels to some admindb radio buttons.
modified:
  Mailman/Cgi/admindb.py
  Mailman/htmlformat.py
  NEWS


--
lp:mailman/2.1
https://code.launchpad.net/~mailman-coders/mailman/2.1

Your team Mailman Checkins is subscribed to branch lp:mailman/2.1.
To unsubscribe from this branch go to 
https://code.launchpad.net/~mailman-coders/mailman/2.1/+edit-subscription
=== modified file 'Mailman/Cgi/admindb.py'
--- Mailman/Cgi/admindb.py	2017-06-09 21:49:45 +0000
+++ Mailman/Cgi/admindb.py	2017-06-24 21:34:48 +0000
@@ -95,8 +95,9 @@
     space = '&nbsp;' * spacing
     btns = Table(cellspacing='5', cellpadding='0')
     btns.AddRow([space + text + space for text in labels])
-    btns.AddRow([Center(RadioButton(btnname, value, default))
-                 for value, default in zip(values, defaults)])
+    btns.AddRow([Center(RadioButton(btnname, value, default).Format()
+                     + '<div class=hidden>' + label + '</div>')
+                 for label, value, default in zip(labels, values, defaults)])
     return btns
 
 
@@ -747,20 +748,14 @@
     when = msgdata.get('received_time')
     if when:
         t.AddRow([Bold(_('Received:')), time.ctime(when)])
-        t.AddCellInfo(row+2, col-1, align='right')
-    # We can't use a RadioButtonArray here because horizontal placement can be
-    # confusing to the user and vertical placement takes up too much
-    # real-estate.  This is a hack!
-    buttons = Table(cellspacing="5", cellpadding="0")
-    buttons.AddRow(map(lambda x, s='&nbsp;'*5: s+x+s,
-                       (_('Defer'), _('Approve'), _('Reject'), _('Discard'))))
-    buttons.AddRow([Center(RadioButton(id, mm_cfg.DEFER, 1)),
-                    Center(RadioButton(id, mm_cfg.APPROVE, 0)),
-                    Center(RadioButton(id, mm_cfg.REJECT, 0)),
-                    Center(RadioButton(id, mm_cfg.DISCARD, 0)),
-                    ])
+        t.AddCellInfo(row+3, col-1, align='right')
+    buttons = hacky_radio_buttons(id,
+                (_('Defer'), _('Approve'), _('Reject'), _('Discard')),
+                (mm_cfg.DEFER, mm_cfg.APPROVE, mm_cfg.REJECT, mm_cfg.DISCARD),
+                (1, 0, 0, 0),
+                spacing=5)
     t.AddRow([Bold(_('Action:')), buttons])
-    t.AddCellInfo(row+3, col-1, align='right')
+    t.AddCellInfo(t.GetCurrentRowIndex(), col-1, align='right')
     t.AddRow(['&nbsp;',
               '<label>' +
               CheckBox('preserve-%d' % id, 'on', 0).Format() +

=== modified file 'Mailman/htmlformat.py'
--- Mailman/htmlformat.py	2017-06-21 16:59:41 +0000
+++ Mailman/htmlformat.py	2017-06-24 21:34:48 +0000
@@ -318,15 +318,9 @@
                           'content="text/html; charset=%s">' % charset)
             if self.title:
                 output.append('%s<TITLE>%s</TITLE>' % (tab, self.title))
-            # This is a kluge to only add this style to the page that needs it.
-            parts = Utils.GetPathPieces()
-            if parts:
-                if len(parts) > 2 and parts[-1] not in ('add', 'remove',
-                                                       'change'):
-                    parts[2] = 'list'
-                if (len(parts) == 2 and parts[1] == 'members' or
-                    len(parts) > 2 and parts[1:3] == ['members', 'list']):
-                    output.append("""\
+            # Add CSS to visually hide some labeling text but allow screen
+            # readers to read it.
+            output.append("""\
 <style type="text/css">
     div.hidden
         {position:absolute;

=== modified file 'NEWS'
--- NEWS	2017-06-21 16:59:41 +0000
+++ NEWS	2017-06-24 21:34:48 +0000
@@ -17,6 +17,7 @@
     - The admin Membership List now includes text for screen readers which
       identifies the function of each checkbox.  CSS is added to the page to
       visually hide the text but still allow screan readers to read it.
+      Similar text has been added to some radio buttons on the admindb pages.
 
   Bug fixes and other patches
 

_______________________________________________
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org

Reply via email to