Please review pull request #60: (#9500) adds scope properties to table headers opened by (djsauble2)

Description:

This is necessary so that screen readers will know whether a
th element is referring to a column or row. Eliminates any
ambiguity that may be present.

Fixes https://projects.puppetlabs.com/issues/9500

  • Opened: Thu Nov 17 00:53:21 UTC 2011
  • Based on: puppetlabs:master (139ab0d67fe23a37ee272a36899791b678411372)
  • Requested merge: djsauble2:9500_add_scope_to_th (303491d505fcb65764011bcf59116750df5546f9)

Diff follows:

diff --git a/app/views/node_classes/index.html.haml b/app/views/node_classes/index.html.haml
index efe8a1f..efb7f1d 100644
--- a/app/views/node_classes/index.html.haml
+++ b/app/views/node_classes/index.html.haml
@@ -12,7 +12,7 @@
       %tr
         -# %th.check
           -# = check_box_tag "check_all"
-        %th.name
+        %th.name{:scope => :col}
           Name
     - if @node_classes.present?
       %tbody
diff --git a/app/views/node_groups/_form.html.haml b/app/views/node_groups/_form.html.haml
index 2dff5f5..0ea1b9d 100644
--- a/app/views/node_groups/_form.html.haml
+++ b/app/views/node_groups/_form.html.haml
@@ -15,8 +15,8 @@
       %table#parameters.inspector
         %thead
           %tr
-            %th.key Key
-            %th.value Value
+            %th.key{:scope => :col} Key
+            %th.value{:scope => :col} Value
         %tbody
           - if form.object.parameters.blank?
             = render :partial => 'parameters/parameter_input', :object => form.object.parameters.build
diff --git a/app/views/node_groups/index.html.haml b/app/views/node_groups/index.html.haml
index e442dcb..49c8fe9 100644
--- a/app/views/node_groups/index.html.haml
+++ b/app/views/node_groups/index.html.haml
@@ -12,7 +12,7 @@
       %tr
         -# %th.check
           -# = check_box_tag "check_all"
-        %th.name
+        %th.name{:scope => :col}
           Name
     - if @node_groups.present?
       %tbody
diff --git a/app/views/node_groups/show.html.haml b/app/views/node_groups/show.html.haml
index e69677a..2bf1a85 100644
--- a/app/views/node_groups/show.html.haml
+++ b/app/views/node_groups/show.html.haml
@@ -22,8 +22,8 @@
         %table.inspector
           %thead
             %tr
-              %th Group
-              %th Source
+              %th{:scope => :col} Group
+              %th{:scope => :col} Source
           %tbody
             - @node_group.node_group_children_with_sources.sort.each do |group,sources|
               %tr
diff --git a/app/views/nodes/_inspections.html.haml b/app/views/nodes/_inspections.html.haml
index 046479e..d819266 100644
--- a/app/views/nodes/_inspections.html.haml
+++ b/app/views/nodes/_inspections.html.haml
@@ -7,10 +7,10 @@
     %table.inspector
       %thead
         %tr
-          %th.status
-          %th Reported at
-          %th Total
-          %th Runtime
+          %th.status{:scope => :col}
+          %th{:scope => :col} Reported at
+          %th{:scope => :col} Total
+          %th{:scope => :col} Runtime
       %tbody
         - node.reports.inspections.limit(reports_limit).each do |report|
           %tr
diff --git a/app/views/nodes/_nodes.html.haml b/app/views/nodes/_nodes.html.haml
index 2e79035..ba6dd2a 100644
--- a/app/views/nodes/_nodes.html.haml
+++ b/app/views/nodes/_nodes.html.haml
@@ -22,21 +22,21 @@
   %table.main
     %thead
       %tr
-        %th.empty{:colspan => container.nil? ? 3 : 4}
+        %th.empty{:scope => :col, :colspan => container.nil? ? 3 : 4}
           = link_to "Export nodes as CSV", url_for(:controller => "nodes", :action ="" selected_status == "all" ? :index : selected_status, :format => 'csv')
         - unless column_filter[ selected_status ] && column_filter[ selected_status ].empty?
-          %th(colspan="5")
+          %th{:scope => :col, :colspan => "5"}
             Resources
       %tr
-        %th.status
-        %th.node
+        %th.status{:scope => :col}
+        %th.node{:scope => :col}
           Node
         - unless container.nil?
-          %th Source
-        %th.latest_report.desc
+          %th{:scope => :col} Source
+        %th.latest_report.desc{:scope => :col}
           ↓ Latest report
         - column_filter[ selected_status ].each do |status|
-          %th
+          %th{:scope => :col}
             = status.capitalize
     %tfoot
       %tr
diff --git a/app/views/puppet/transaction/reports/_report.haml b/app/views/puppet/transaction/reports/_report.haml
index dd27166..c14968b 100644
--- a/app/views/puppet/transaction/reports/_report.haml
+++ b/app/views/puppet/transaction/reports/_report.haml
@@ -14,10 +14,10 @@
     %table.inspector
       %thead
         %tr
-          %th Level
-          %th Message
-          %th Source
-          %th Time
+          %th{:scope => :col} Level
+          %th{:scope => :col} Message
+          %th{:scope => :col} Source
+          %th{:scope => :col} Time
       %tbody
         = render report.logs
 
diff --git a/app/views/reports/_log.html.haml b/app/views/reports/_log.html.haml
index 96668cf..b02163d 100644
--- a/app/views/reports/_log.html.haml
+++ b/app/views/reports/_log.html.haml
@@ -5,12 +5,12 @@
       %table.inspector
         %thead
           %tr
-            %th Level
-            %th Message
-            %th Source
-            %th File
-            %th Line
-            %th Time
+            %th{:scope => :col} Level
+            %th{:scope => :col} Message
+            %th{:scope => :col} Source
+            %th{:scope => :col} File
+            %th{:scope => :col} Line
+            %th{:scope => :col} Time
         %tbody
           = render :partial => 'puppet/util/logs/log', :collection => puppet_log_sorter(report.logs.compact)
   - else
diff --git a/app/views/reports/_reports_table.html.haml b/app/views/reports/_reports_table.html.haml
index 1fc7fc9..e7d088d 100644
--- a/app/views/reports/_reports_table.html.haml
+++ b/app/views/reports/_reports_table.html.haml
@@ -1,20 +1,20 @@
 %table.inspector
   %thead
     %tr
-      %th.status
+      %th.status{:scope => :col}
          
-      %th Reported at ↓
+      %th{:scope => :col} Reported at ↓
       - unless node
-        %th Node
-      %th Total
-      %th Failed
-      %th Changed
-      %th Unchanged
-      %th Pending
-      %th Skipped
-      %th Failed restarts
-      %th Config retrieval
-      %th Runtime
+        %th{:scope => :col} Node
+      %th{:scope => :col} Total
+      %th{:scope => :col} Failed
+      %th{:scope => :col} Changed
+      %th{:scope => :col} Unchanged
+      %th{:scope => :col} Pending
+      %th{:scope => :col} Skipped
+      %th{:scope => :col} Failed restarts
+      %th{:scope => :col} Config retrieval
+      %th{:scope => :col} Runtime
   %tfoot
     - if reports.present?
       - if defined? tfoot and tfoot
diff --git a/app/views/reports/_resource_statuses.html.haml b/app/views/reports/_resource_statuses.html.haml
index a561466..063b6bc 100644
--- a/app/views/reports/_resource_statuses.html.haml
+++ b/app/views/reports/_resource_statuses.html.haml
@@ -19,8 +19,8 @@
             %dd.expandable.collapsed{:id => "expandable-#{index}"}
               %table
                 %tr
-                  %th Property
-                  %th Message
+                  %th{:scope => :col} Property
+                  %th{:scope => :col} Message
                 - status.events.each do |event|
                   %tr{:class => "status #{event.status}"}
                     %td= event.property
diff --git a/app/views/reports/search.html.haml b/app/views/reports/search.html.haml
index 5f407f0..aacc23e 100644
--- a/app/views/reports/search.html.haml
+++ b/app/views/reports/search.html.haml
@@ -30,10 +30,10 @@
           %table.inspector
             %thead
               %tr
-                %th.status  
-                %th Time
-                %th Node ↑
-                %th Checksum
+                %th.status{:scope => :col}  
+                %th{:scope => :col} Time
+                %th{:scope => :col} Node ↑
+                %th{:scope => :col} Checksum
             %tbody
               - results.each do |file|
                 %tr
diff --git a/app/views/shared/_classes.html.haml b/app/views/shared/_classes.html.haml
index f986cbe..390dfb4 100644
--- a/app/views/shared/_classes.html.haml
+++ b/app/views/shared/_classes.html.haml
@@ -4,8 +4,8 @@
     %table.inspector
       %thead
         %tr
-          %th.name Class
-          %th Source
+          %th.name{:scope => :col} Class
+          %th{:scope => :col} Source
       %tbody
         - resource.node_classes_with_sources.each do |node_class,sources|
           %tr
diff --git a/app/views/shared/_groups.html.haml b/app/views/shared/_groups.html.haml
index fbcbd90..02ea111 100644
--- a/app/views/shared/_groups.html.haml
+++ b/app/views/shared/_groups.html.haml
@@ -4,8 +4,8 @@
     %table.inspector
       %thead
         %tr
-          %th Group
-          %th Source
+          %th{:scope => :col} Group
+          %th{:scope => :col} Source
       %tbody
         - resource.node_groups_with_sources.sort.each do |group,sources|
           %tr
diff --git a/app/views/shared/_inspector.html.haml b/app/views/shared/_inspector.html.haml
index e102798..625a188 100644
--- a/app/views/shared/_inspector.html.haml
+++ b/app/views/shared/_inspector.html.haml
@@ -3,9 +3,9 @@
     %caption= options[:caption]
   %thead
     %tr
-      %th.key= (options[:key_title] || key).to_s.titleize
+      %th.key{:scope => :col}= (options[:key_title] || key).to_s.titleize
       - unless options[:key_only]
-        %th.value{:colspan => 2}= (options[:value_title] || value).to_s.titleize
+        %th.value{:scope => :col, :colspan => 2}= (options[:value_title] || value).to_s.titleize
   %tbody
     - inspector.each do |key, value|
       %tr
diff --git a/app/views/shared/_parameters.html.haml b/app/views/shared/_parameters.html.haml
index baad290..ce33d46 100644
--- a/app/views/shared/_parameters.html.haml
+++ b/app/views/shared/_parameters.html.haml
@@ -10,9 +10,9 @@
     %table.inspector
       %thead
         %tr
-          %th Key
-          %th Value
-          %th Source
+          %th{:scope => :col} Key
+          %th{:scope => :col} Value
+          %th{:scope => :col} Source
       %tbody
         - resource.compiled_parameters(true).each do |param|
           %tr
diff --git a/app/views/statuses/_run_failure.html.haml b/app/views/statuses/_run_failure.html.haml
index d38593d..d0dae7f 100644
--- a/app/views/statuses/_run_failure.html.haml
+++ b/app/views/statuses/_run_failure.html.haml
@@ -13,7 +13,7 @@
     %thead
       %tr.labels
         - statuses.each do |status|
-          %th= status.start.strftime('%Y-%m-%d')
+          %th{:scope => :col}= status.start.strftime('%Y-%m-%d')
     %tbody
       %tr.unchanged
         - statuses.each do |status|
diff --git a/app/views/statuses/_run_time.html.haml b/app/views/statuses/_run_time.html.haml
index 3c56216..66bae99 100644
--- a/app/views/statuses/_run_time.html.haml
+++ b/app/views/statuses/_run_time.html.haml
@@ -5,7 +5,7 @@
     %thead
       %tr.labels
         - reports.map{|r| r.time}.each do |time|
-          %th= time.to_s(:time)
+          %th{:scope => :col}= time.to_s(:time)
     %tbody
       %tr.runtimes
         - reports.map{|r| r.total_time}.compact.each do |time|

    

--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to puppet-dev@googlegroups.com.
To unsubscribe from this group, send email to puppet-dev+unsubscr...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to