show png pictures below each export or items
authorDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 22 Jun 2010 20:50:23 +0000 (22:50 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 22 Jun 2010 20:50:23 +0000 (22:50 +0200)
lib/MojoFacets/Data.pm
templates/data/export.html.ep

index a02a563..7344f89 100644 (file)
@@ -1043,7 +1043,7 @@ sub export {
                }
        }
 
-       my @files = glob( $self->_export_path . '*' );
+       my @files = grep { ! /\.png$/ } glob( $self->_export_path . '*' );
        my $mtime = { map { $_ => (stat($_))[9] } @files };
        @files = sort { $mtime->{$b} <=> $mtime->{$a} } @files;
        $self->render( export => [ @files ] );
index adb628f..05812a2 100644 (file)
@@ -8,8 +8,8 @@
 <a target="<%= $path %>" href="/export/<%= $path %>"><%= $path %></a>
 </tt>
 <%= -s $e %> bytes
-%  if ( $path =~ m/\.png$/ ) {
-<img src="/export/<%= $path %>">
+%  if ( -e $e . '.png' ) {
+<br><img src="/export/<%= $path %>.png">
 %  } elsif ( $path =~ m/filter\./ ) {
 <a href="?import=<%= $path %>">import</a>
 %  }