somewhat nicer results of apply
authorDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 3 Jun 2010 20:00:38 +0000 (22:00 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 3 Jun 2010 20:00:38 +0000 (22:00 +0200)
lib/MojoFacets/Changes.pm
public/mojo_facets.css
templates/changes/edits.html.ep

index 86ae074..6db19ea 100644 (file)
@@ -72,7 +72,7 @@ sub edits {
                        }
                        my $i = $unique2id->{$pk}->{$id};
                        my $status = defined $i ? 'found' : 'missing';
-                       $e->{_apply} = $status;
+                       $e->{_status} = $status;
                        $stats->{$status}++;
                }
                push @$edits, $e;
index 1612414..93d83b6 100644 (file)
@@ -174,13 +174,11 @@ a.facet {
        text-decoration: line-through;
 }
 
-div.edit a {
+.edit-options {
        margin-top: 3em;
        float: right;
-}
-
-div.edit {
-       border-bottom: 1px dashed #eee;
+       text-align: center;
+       
 }
 
 div.edit pre {
@@ -188,7 +186,7 @@ div.edit pre {
 }
 
 .edit-unknown {
-       border: 3px dotted #888;
+       border-bottom: 1px dotted #ccc;
 }
 
 .edit-found {
index 6545d99..0687c8f 100644 (file)
@@ -1,23 +1,39 @@
 % layout 'default';
 
-<pre class=debug>
-<%= dumper( $loaded ) %>
-<%= dumper( $stats ) %>
-</pre>
+
+% 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 %></option>
+<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>
+% }
+
 % foreach my $e ( @$edits ) {
-<div class="edit edit-<%= $e->{_apply} || 'unknown' %>">
+<div class="edit edit-<%= $e->{_status} || 'unknown' %>">
+<span class="edit-options">
 <a href="<%= url_for( action => 'edit' )->query( remove => $e->{time} ) %>">remove</a>
-<%= $e->{_apply} %>
+%  if ( my $status = $e->{_status} ) {
+<div title="status">
+<%= $status %>
+</div>
+%  }
+</span>
 <pre class=debug><%= dumper $e %></pre>
 </div>
 % }
+
+<pre class=debug>
+<%= dumper( $stats ) %>
+</pre>