reformat edits into table
[MojoFacets.git] / templates / changes / edits.html.ep
index fc721b8..7192346 100644 (file)
@@ -1,5 +1,49 @@
 % layout 'default';
 
+
+% my $apply_on_path = param('apply_on_path');
+
+<form method=post>
+<input type=submit value="Apply"> on
+<select name=apply_on_path>
+% foreach my $p ( @$loaded ) {
+<option<%= $p eq $apply_on_path ? ' selected' : '' %>><%= $p %></option>
+% }
+</select>
+</form>
+
+% if ( $apply_on_path ) {
+<ul>
+%  foreach my $status ( keys %$stats ) {
+<li><%= $status %> <span class=count><%= $stats->{$status} %></span>
+%  }
+</ul>
+% }
+
+<table>
+<tr><th></th><th>old</th><th>new</th></tr>
+
 % foreach my $e ( @$edits ) {
-<pre class=debug><%= dumper $e %></pre>
+<tr class="edit edit-<%= $e->{_status} || 'unknown' %>">
+<td>
+<%= $e->{time} %>
+
+%  if ( my $status = $e->{_status} ) {
+%    my ( $pk, $id ) = %{ $e->{unique} };
+<a href="<%= url_for( controller => 'data', action => 'filter' )->query( filter_name => $pk, filter_vals => $id ) %>"><%= $id %></a>
+<%= $status %>
+%  } else {
+<a href="<%= url_for( action => 'edit' )->query( remove => $e->{time} ) %>">remove</a>
+%  }
+
+</td><td><%== defined $e->{old} && join('<span class=d>&para;</span>', @{$e->{old}}) %>
+</td><td><%== defined $e->{new} && join('<span class=d>&para;</span>', @{$e->{new}}) %>
+
+</tr>
 % }
+
+</table>
+
+<pre class=debug>
+<%= dumper( $stats ) %>
+</pre>