automatically dump right header for each type once
authorDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 24 Jun 2010 18:57:36 +0000 (20:57 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 24 Jun 2010 19:05:55 +0000 (21:05 +0200)
templates/actions/changes.html.ep

index 0835766..612e4b4 100644 (file)
@@ -39,10 +39,23 @@ Changes commited to <a href="<%= url_for( controller => 'data', action => 'load'
 
 </form>
 
+% my $tr = { new => [ qw( old new ) ], code => [ qw( code columns_changed ) ] };
+
 <table>
-<tr><th></th><th>old</th><th>new</th></tr>
 
 % foreach my $e ( @$changes ) {
+
+%  foreach my $type ( keys %$tr ) {
+%   if ( exists $e->{$type} ) {
+<tr>
+<th></th>
+<th><%= $tr->{$type}->[0] %></th>
+<th><%= $tr->{$type}->[1] %></th>
+</tr>
+%    delete $tr->{$type}; last;
+%   }
+%  }
+
 <tr class="change <%= $e->{_status} || 'unknown' %>">
 <td>
 <%= $e->{time} %>