give row an error class if data structure contains an error message
Robert 'phaylon' Sedlacek [Tue, 19 Jun 2012 21:46:23 +0000 (21:46 +0000)]
br.pl

diff --git a/br.pl b/br.pl
index 9cd6f6d..21eec68 100644 (file)
--- a/br.pl
+++ b/br.pl
@@ -176,7 +176,7 @@ sub render_table {
       ($data->{wrapper}||sub{@_})->(
         '', <table>, "\n",
           (map { my $el = $_;
-            '  ', <tr>,
+            '  ', ($el->{key} eq '__error__') ? <tr class="error"> : <tr>,
               (map {
                 <td>, $self->render_el($el, $_, $el->{$_}), </td>
               } @{$data->{columns}}),