X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FSQL%2FTranslator%2FProducer%2FHTML.pm;h=6659fb37c836d5821557b784a8558f046123ad95;hb=5ca2365add682f4c4e6589a25cebc359f00837db;hp=9c530445f5499aff5c4b2b1d2a659633d7a5b4e4;hpb=a3de76be9a22a66ffcaa5c4f152411f0cc343d17;p=dbsrgits%2FSQL-Translator.git diff --git a/lib/SQL/Translator/Producer/HTML.pm b/lib/SQL/Translator/Producer/HTML.pm index 9c53044..6659fb3 100644 --- a/lib/SQL/Translator/Producer/HTML.pm +++ b/lib/SQL/Translator/Producer/HTML.pm @@ -1,9 +1,7 @@ package SQL::Translator::Producer::HTML; # ------------------------------------------------------------------- -# $Id: HTML.pm,v 1.12 2004-02-11 21:28:53 kycl4rk Exp $ -# ------------------------------------------------------------------- -# Copyright (C) 2002-4 SQLFairy Authors +# Copyright (C) 2002-2009 SQLFairy Authors # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as @@ -24,8 +22,9 @@ use strict; use Data::Dumper; use vars qw($VERSION $NOWRAP $NOLINKTABLE $NAME); -$VERSION = sprintf "%d.%02d", q$Revision: 1.12 $ =~ /(\d+)\.(\d+)/; -$NAME = join ', ', __PACKAGE__, $VERSION; +$VERSION = '1.59'; + +$NAME = __PACKAGE__; $NOWRAP = 0 unless defined $NOWRAP; $NOLINKTABLE = 0 unless defined $NOLINKTABLE; @@ -68,7 +67,7 @@ sub produce { -title => $title, %stylesheet, -meta => { generator => $NAME }, - }); + }), $q->h1({ -class => 'SchemaDescription' }, $title), $q->hr; } @@ -95,7 +94,7 @@ sub produce { ), ); - for my $table (sort @table_names) { + for my $table (@table_names) { my $table_name = $table->name; push @html, $q->comment("Start link to table '$table_name'"), @@ -150,6 +149,7 @@ sub produce { ) ); + my $i = 0; for my $field ( @fields ) { my $name = $field->name || ''; $name = qq[$name]; @@ -173,8 +173,10 @@ sub produce { push @other, 'UNIQUE' if $field->is_unique; push @other, 'NOT NULL' unless $field->is_nullable; push @other, $comment if $comment; + my $class = $i++ % 2 ? 'even' : 'odd'; push @html, $q->Tr( + { -class => "tr-$class" }, $q->td({ -class => "FieldCellName" }, $name), $q->td({ -class => "FieldCellType" }, $data_type), $q->td({ -class => "FieldCellSize" }, $size), @@ -330,7 +332,7 @@ insignificant whitespace and be generally smaller. =head1 AUTHORS -Ken Y. Clark Ekclark@cpan.orgE, +Ken Youens-Clark Ekclark@cpan.orgE, Darren Chamberlain Edarren@cpan.orgE. =cut