use Storable;
use Time::HiRes qw(time);
use File::Path qw(mkpath);
-use Text::Unaccent::PurePerl;
+use Text::Unaccent;
use Digest::MD5;
use Statistics::Descriptive;
sub load {
my $self = shift;
- my $path = $self->param('path') || return $self->redirect_to( '/data/index' );
-
my @paths = $self->param('paths');
warn "# paths ", dump @paths;
$self->_load_path( $_ ) foreach @paths;
+ my $path = $self->param('path') || $self->session('path') || @paths[0] || $self->redirect_to('/data/index');
+
warn "# path $path\n";
$self->_load_path( $path );
sub __unac {
my $n = shift;
- $n = unac_string($n);
+ $n = unac_string('utf-8',$n);
$n =~ s/\W+/_/g;
return $n;
}
my $code_path = $self->app->home->rel_dir('public') . "/code";
if ( $commit ) {
+ __path_modified( $path, 'commit' );
+
warn "# commit on ", $#$filtered + 1, " items:\n$code\n";
( $key, $value, $out ) = ( 'key', 'value' );
foreach ( 0 .. $#$filtered ) {
keys %$loaded;
}
+sub reload {
+ my $self = shift;
+ $self->stash( reload => 1 );
+ $self->remove;
+# $self->_load_path( $self->param('path') );
+ $self->redirect_to('/data/load?path=' . $self->param('path') );
+}
+
sub remove {
my $self = shift;
my $path = $self->param('path');
} else {
warn "WARNING: $path unlink ignored";
}
+ return if $self->stash('reload');
return $self->redirect_to( '/data/load' );
}