From 1daa89176c0042d6f55f0cc54b3d45bf474b7f1f Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Sat, 16 Oct 2010 20:42:03 +0200 Subject: [PATCH] add remove link to storable file size --- lib/MojoFacets/Data.pm | 12 ++++++++++++ templates/data/index.html.ep | 5 ++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/MojoFacets/Data.pm b/lib/MojoFacets/Data.pm index 3cd9206..b5decf5 100644 --- a/lib/MojoFacets/Data.pm +++ b/lib/MojoFacets/Data.pm @@ -1204,4 +1204,16 @@ sub __loaded_paths { keys %$loaded; } +sub unlink { + my $self = shift; + my $path = $self->param('path'); + if ( $path =~ m{^/tmp/mojo_facets.} ) { + unlink $path; + warn "# unlink $path"; + } else { + warn "WARNING: $path unlink ignored"; + } + $self->redirect_to( '/data/load' ); +} + 1; diff --git a/templates/data/index.html.ep b/templates/data/index.html.ep index 0e440e1..edd00ba 100644 --- a/templates/data/index.html.ep +++ b/templates/data/index.html.ep @@ -17,7 +17,10 @@ <%= $n %> <%= $size->{$n} %> -<%= -s $dump_path->{$n} %> + +% if ( my $size = -s $dump_path->{$n} ) { +<%= $size %> +% } <%= defined $loaded->{$n}->{data} ? $#{ $loaded->{$n}->{data}->{items} } + 1 : '' %> <%= defined $changes->{$n} ? $#{ $changes->{$n} } + 1 : '' %> {$n}->{stats} ? 'checked' : '' %>> -- 2.20.1