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

albertel lon-capa-cvs-allow@mail.lon-capa.org
Tue, 06 Nov 2007 19:02:59 -0000


albertel		Tue Nov  6 14:02:59 2007 EDT

  Modified files:              
    /loncom/interface	loncommon.pm 
  Log:
  - nesting of data tables should render with proper row colorings and border colorings
  
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.609 loncom/interface/loncommon.pm:1.610
--- loncom/interface/loncommon.pm:1.609	Mon Nov  5 23:39:19 2007
+++ loncom/interface/loncommon.pm	Tue Nov  6 14:02:57 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.609 2007/11/06 04:39:19 raeburn Exp $
+# $Id: loncommon.pm,v 1.610 2007/11/06 19:02:57 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -4397,6 +4397,7 @@
   border: 1px solid #000000;
   border-collapse: separate;
   border-spacing: 1px;
+  background: $pgbg;
 }
 .LC_data_table_dense {
   font-size: small;
@@ -4419,12 +4420,12 @@
   background-color: $data_table_head;
   font-size: smaller;
 }
-table.LC_data_table tr td, 
+table.LC_data_table tr.LC_odd_row > td, 
 table.LC_aboutme_port tr td {
   background-color: $data_table_light;
   padding: 2px;
 }
-table.LC_data_table tr.LC_even_row td,
+table.LC_data_table tr.LC_even_row > td,
 table.LC_aboutme_port tr.LC_even_row td {
   background-color: $data_table_dark;
 }
@@ -5510,30 +5511,30 @@
 }
 
 {
-    my $row_count;
+    my @row_count;
     sub start_data_table {
 	my ($add_class) = @_;
 	my $css_class = (join(' ','LC_data_table',$add_class));
-	undef($row_count);
+	unshift(@row_count,0);
 	return '<table class="'.$css_class.'">'."\n";
     }
 
     sub end_data_table {
-	undef($row_count);
+	shift(@row_count);
 	return '</table>'."\n";;
     }
 
     sub start_data_table_row {
 	my ($add_class) = @_;
-	$row_count++;
-	my $css_class = ($row_count % 2)?'':'LC_even_row';
+	$row_count[0]++;
+	my $css_class = ($row_count[0] % 2)?'LC_odd_row':'LC_even_row';
 	$css_class = (join(' ',$css_class,$add_class));
 	return  '<tr class="'.$css_class.'">'."\n";;
     }
     
     sub continue_data_table_row {
 	my ($add_class) = @_;
-	my $css_class = ($row_count % 2)?'':'LC_even_row';
+	my $css_class = ($row_count[0] % 2)?'LC_odd_row':'LC_even_row';
 	$css_class = (join(' ',$css_class,$add_class));
 	return  '<tr class="'.$css_class.'">'."\n";;
     }
@@ -5543,7 +5544,7 @@
     }
 
     sub start_data_table_empty_row {
-	$row_count++;
+	$row_count[0]++;
 	return  '<tr class="LC_empty_row" >'."\n";;
     }