[Rt-commit] rt branch, 4.2/chart-tables, created. rt-4.1.13-216-g0a07444

Thomas Sibley trs at bestpractical.com
Fri Jul 5 19:54:31 EDT 2013


The branch, 4.2/chart-tables has been created
        at  0a0744445fdda233c4e2c6a17e1c5603e6efd73e (commit)

- Log -----------------------------------------------------------------
commit 0a0744445fdda233c4e2c6a17e1c5603e6efd73e
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Fri Jul 5 16:53:14 2013 -0700

    Visual distinction between chart grouping labels spanning rows

diff --git a/lib/RT/Report/Tickets.pm b/lib/RT/Report/Tickets.pm
index 3042ff7..fa6e016 100644
--- a/lib/RT/Report/Tickets.pm
+++ b/lib/RT/Report/Tickets.pm
@@ -917,13 +917,16 @@ sub FormatTable {
     }
     @footer = ({ even => ++$i%2, cells => []});
 
+    my $g = 0;
     foreach my $column ( @{ $columns{'Groups'} } ) {
         $i = 0;
         my $last;
         while ( my $entry = $self->Next ) {
             my $value = $entry->LabelValue( $column );
             if ( !$last || $last->{'value'} ne $value ) {
-                push @{ $body[ $i++ ]{'cells'} }, $last = { type => 'label', value => $value, };
+                push @{ $body[ $i++ ]{'cells'} }, $last = { type => 'label', value => $value };
+                $last->{even} = $g++ % 2
+                    unless $column eq $columns{'Groups'}[-1];
             }
             else {
                 $i++;
diff --git a/share/html/Search/Elements/ChartTable b/share/html/Search/Elements/ChartTable
index a9557cd..09378b9 100644
--- a/share/html/Search/Elements/ChartTable
+++ b/share/html/Search/Elements/ChartTable
@@ -79,6 +79,8 @@ foreach my $section (qw(thead tbody tfoot)) {
 
             my @class = ('collection-as-table');
             push @class, ($cell->{'type'}) unless $cell->{'type'} eq 'head';
+            push @class, $cell->{'even'} ? 'evenline' : 'oddline'
+                if defined $cell->{'even'};
             $m->out(' class="'. $eh->( join ' ', @class ) .'"');
 
             foreach my $dir ( grep $cell->{$_}, qw(rowspan colspan) ) {
diff --git a/share/static/css/base/charts.css b/share/static/css/base/charts.css
index c1b751b..31baf7c 100644
--- a/share/static/css/base/charts.css
+++ b/share/static/css/base/charts.css
@@ -19,3 +19,10 @@
 .chart-wrapper .collection-as-table th {
     text-shadow: 0 0 3px #ddd;
 }
+
+.chart-wrapper .collection-as-table tr th.evenline {
+    background: #eee;
+}
+.chart-wrapper .collection-as-table tr th.oddline {
+    background: #ddd;
+}

-----------------------------------------------------------------------


More information about the Rt-commit mailing list